
var val=Array();function goto_step(stepname){document.step_form.step.value=stepname;document.step_form.submit();}
function submit_step(frm){var Dom1=YAHOO.util.Dom;var DDM=YAHOO.util.DragDropMgr;list=Dom1.get("ul1");var items=list.getElementsByTagName("li");var out='';for(i=0;i<items.length;i=i+1){if((i)!=(items.length-1)){out+=items[i].id+"-";}
else
{out+=items[i].id;}}
document.getElementById("items_list").value=out;document.getElementById(frm).submit();}
function goto_preview_step()
{document.back_to_preview.submit();}
function call_subcategory(s)
{main_cat=s.value;if(main_cat!="")
{subCat=new Yconnect('ajaxtpl/show_sub_category.php?mode=show_sub_category&main_category='+main_cat,'','show_sub_cat');subCat.SimpleResponse();}}
function generatePrinterFriendly(dest_div)
{var s=opener.document.getElementById(dest_div);var t=document.getElementById("PrinterBody");if(opener.document.getElementById("descimage")!=undefined){t.innerHTML=opener.document.getElementById("descimage").value;}
else{t.innerHTML='';}
t.innerHTML+=s.innerHTML;}
function print_script_area(pgtitle)
{var winURL="printer.php?pgtitle="+pgtitle;var winName="PrinterFriendly";var winOptions="width=630,height=562,toolbar=no,location=no,menu=no,status=no,scrollbars=yes";window.open(winURL,winName,winOptions);}
function submitScript(file_name,ord_id,package_type){document.getElementById('ygddfdiv').innerHTML='';script=new Yconnect('ajaxtpl/make_txt_script.php','script_form','script_'+file_name+'.jpg');script.ExecFunction="removeDialog();";script.SimpleResponse();setTimeout('goto("'+file_name+'")',1000);}
function goto(file_name){document.getElementById("ie6_fix").style.display="block";window.location="#script"+file_name;}
function close_script(divname,read_more,read_more_txt){document.getElementById(divname).style.display="none";document.getElementById(read_more).style.display="block";document.getElementById(read_more_txt).style.display="block";}
function show_more(divname,anchor_divname,og_divname,og_divname1){document.getElementById(og_divname).style.display="none";document.getElementById(og_divname1).style.display="none";document.getElementById(divname).style.display="block";document.getElementById(anchor_divname).style.display="none";}
function show_read_more(divname){document.getElementById(divname).style.display="block";}
function close_read_more(divname){document.getElementById(divname).style.display="none";}
function check_script_option(q,ord_id,package_type){chk_option=document.getElementById("chk_script_option").value;if(package_type=='4'){if(q.value=="script"){document.getElementById("WordsLeft").value="250";document.getElementById("maxwords").value="250";document.getElementById("descdiv").style.display='block';}
else if(q.value=="description"){document.getElementById("WordsLeft").value="500";document.getElementById("maxwords").value="500";document.getElementById("descdiv").style.display='block';}
else{document.getElementById("descdiv").style.display='none';}}
if(chk_option==""||chk_option==0){change_content(q,ord_id,package_type);}
else{exist_change_content(q,ord_id,package_type)}}
function exist_change_content(q,ord_id,package_type){var script_option=q.value;switch(script_option){case'script':{document.getElementById("show_script").style.display="block";document.getElementById("show_description").style.display="none";document.getElementById("a_script").style.display="block";document.getElementById("d_script").style.display="none";document.getElementById("read_more_desc").style.display="none";}
break;case'description':{document.getElementById("show_script").style.display="none";document.getElementById("show_description").style.display="block";document.getElementById("a_script").style.display="none";document.getElementById("d_script").style.display="block";document.getElementById("read_more_script").style.display="none";}
break;default:document.getElementById("a_script").style.display="none";document.getElementById("d_script").style.display="none";document.getElementById("show_script").style.display="none";document.getElementById("show_description").style.display="none";document.getElementById("read_more_script").style.display="none";document.getElementById("read_more_desc").style.display="none";break;}
document.getElementById("chk_script_option").value="1";var Dom1=YAHOO.util.Dom;var DDM=YAHOO.util.DragDropMgr;list=Dom1.get("ul1");var items=list.getElementsByTagName("li");var out='';for(i=0;i<items.length;i=i+1){if((i)!=(items.length-1)){out+=items[i].id+"-";}
else{out+=items[i].id;}}
var msg="[ WARNING : This will Delete Existing Voice Script(s) or Description(s) ] \n\n Are you sure you want to proceed?";var conf=confirm(msg);if(conf){curr_script_option=document.getElementById("script_option").value;ny=new Yconnect('ajaxtpl/delete_uploaded_image.php?mode=delete_txt_all&folder_name='+ord_id+'&curr_script_option='+curr_script_option,'','txt_file');ny.ExecFunction='refresh_script("'+out+'");';ny.SimpleResponse();}}
function refresh_script(out){document.txtdeleteall.items_list.value=out;document.txtdeleteall.script_option.value=document.getElementById("script_option").value;document.txtdeleteall.chk_music_option.value=document.getElementById("chk_music_option").value;document.txtdeleteall.chk_script_option.value="1";document.txtdeleteall.submit();}
function change_content(q,ord_id,package_type){var script_option=q.value;chk_option=document.getElementById("chk_script_option").value;switch(script_option){case'script':{document.getElementById("chk_script_option").value="1";document.getElementById("show_script").style.display="block";document.getElementById("show_description").style.display="none";document.getElementById("a_script").style.display="block";document.getElementById("d_script").style.display="none";document.getElementById("read_more_desc").style.display="none";}
break;case'description':{document.getElementById("chk_script_option").value="1";document.getElementById("show_script").style.display="none";document.getElementById("show_description").style.display="block";document.getElementById("a_script").style.display="none";document.getElementById("d_script").style.display="block";document.getElementById("read_more_script").style.display="none";}
break;default:document.getElementById("chk_script_option").value="1";document.getElementById("a_script").style.display="none";document.getElementById("d_script").style.display="none";document.getElementById("show_script").style.display="none";document.getElementById("show_description").style.display="none";document.getElementById("read_more_script").style.display="none";document.getElementById("read_more_desc").style.display="none";break;}}
function update_member_order_details(){var fldsarr=Array();var msgsarr=Array();fldsarr[0]=Array('firstname',Array('required','namelen','name'));fldsarr[1]=Array('lastname',Array('required','namelen','name'));fldsarr[2]=Array('email',Array('required','email'));msgsarr[0]=Array('firstname',Array(' &raquo; Please enter the First Name.','&raquo; Please enter valid First Name(name should be atleast 3 characters).'),' &raquo; Please enter valid First Name.');msgsarr[1]=Array('lastname',Array(' &raquo; Please enter the Last Name.','&raquo; Please enter valid Last Name(name should be atleast 3 characters).'),' &raquo; Please enter valid Last Name.');msgsarr[2]=Array('email',Array(' &raquo; Please enter email address.',' &raquo; Please enter valid email address.'));ny=new DomValidate(fldsarr,msgsarr);ny.txtClass='1px solid #7EBCF9';ny.msgtype='all';if(ny.validateForm("update_details_form")){document.getElementById("update_details_form").submit();}
else
{return false;}}
function edit_member_order_details(){document.edit_form.submit();}
function del_webmercial(frmname){var msg="[ WARNING : Aborting Vuit ] \n\n Are you sure you want to restart your Vuit?";var conf=confirm(msg);if(conf)
{document.getElementById("step").value="abort";document.getElementById(frmname).submit();return true;}}
function call_SelectImages(order_id,package_id,frm_name){var images=document.getElementById("want_images").value;switch(images)
{case'yes':{document.getElementById("image_div").style.display="none";for(var i=0;i<2;i++){obj=eval("document."+frm_name+".chk_image["+i+"]");obj.checked=false;}
var topX=(window.screen.width/2)-350;var topY=10;window.open('show_background_images.php?order_id='+order_id+'&package_id='+package_id,'','height=700,width=725,status=no,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,location=no,screenX='+topX+',screenY='+topY);}
break;case'yesown':{document.getElementById("image_div").style.display="block";}
break;default:{alert("Please Select an Option");document.getElementById("image_div").style.display="none";}
break;}}
function showMp3Player(order_id){var so=new SWFObject("flash/mp3player_small.swf?id="+order_id,"mp3player_small","400","188","5","");so.addParam("wmode","transparent");so.addParam('movie','flash/mp3player_small.swf?id='+order_id);so.write("show_mp3_player");}
function UploadMp3()
{}
function check_same_feature(a){var i;for(i=1;i<=9;i++)
{if(a.id!="category7_"+i)
{if(a.value==document.getElementById("category7_"+i).value)
{alert("You Cannot Select a Feature which is already Selected");a.value="";break;}}}}
function show_frames(package)
{switch(package)
{case'4':var frame_type=document.virtual_pack_2.frames_type.value;break;case'2':var frame_type=document.value_pack_2.frames_type.value;break;case'5':var frame_type=document.classic_pack_2.frames_type.value;break;}
if(frame_type!="")
{var topX=(window.screen.width/2)-350;var topY=10;window.open('show_frames.php?frames_type='+frame_type+'&package_id='+package,'','height=700,width=800,status=no,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,location=no,screenX='+topX+',screenY='+topY);}
else
{alert("Please Select a Frame Type");}}
function select_backdrop_images(q){var id;id=q.value;if(id=="")
{return false;}
else
{window.open('back_drop.php?id='+id,'Order Preview','height=410,width=700,status=no,toolbar=no,menubar=no,location=no');}}
function show_voice_accent_player(filename,voice_folder,divid,package,order_id)
{var path;switch(package)
{case'4':var name=document.virtual_pack_6.voice_type_accent.value;break;case'2':var name=document.value_pack_6.voice_type_accent.value;break;case'3':var name=document.basic_pack_5.voice_type_accent.value;break;default:break;}
var so=new SWFObject("flash/voice_accent_player.swf","voice_accent_player","400","300","5","");so.addParam('movie','flash/voice_accent_player.swf');so.addVariable('accent_type',name);so.addVariable('order_id',order_id);so.addParam("wmode","transparent");so.addParam('swliveconnect','true');so.write(divid);}
function from_voice_accent_player(voice_file_selected,order_id)
{voice_type=document.getElementById("voice_type_accent").value;var file_name=voice_file_selected.split('.');voice=new Yconnect('ajaxtpl/update_voiceover.php?filename='+file_name[0]+'&order_id='+order_id+'&voice_type='+voice_type,'','voice_update');voice.SimpleResponse();}
function show_voice_accent_check(filename,voice_folder,divid)
{var path;path=voice_folder+'/'+filename+'.swf';var so=new SWFObject(path,"flash","255","100","5","");so.addParam("wmode","transparent");so.write(divid);}
function show_voice_accent(q,voice_folder,divid)
{var path;if(q.value=="")
{return false;}
else
{filename=q.value;path=voice_folder+'/'+filename+'.swf';var so=new SWFObject(path,"flash","255","100","5","");so.addParam("wmode","transparent");so.write(divid);}}
function show_3d_flash(divid,ddd_folder,filename)
{var path;path=ddd_folder+filename;var so=new SWFObject(path,"flash","400","304","5","");so.addParam("wmode","transparent");so.write(divid);}
function show_actual_flash(music_id,music_path,divid)
{var path;fileid=music_id;filename="vms_"+fileid+".swf";path=music_path+"/"+filename;document.getElementById("music_filename").value=filename;if(fileid!="")
{var so1=new SWFObject(path,"flash","252","102","5","");so1.addParam("wmode","transparent");so1.write(divid);}}
function select_template(q)
{document.package_list.package_type.value=q.value;document.package_list.step.value='step1';if(q.value==1)
{document.package_list.action="order.php#order_page";}
if(q.value==2)
{document.package_list.action="order_value_pack.php#order_page";}
if(q.value==3)
{document.package_list.action="order_basic_pack.php#order_page";}
if(q.value==4)
{document.package_list.action="order_virtual_pack.php#order_page";}
if(q.value==5)
{document.package_list.action="order_classic_pack.php#order_page";}
if(q.value==6)
{document.package_list.action="order_free_pack.php#order_page";}
window.location="#order_page";document.package_list.submit();}
function call_anchor_screen()
{window.location="#order_page";}
function selectVoiceTypeAccent(m)
{if(m.value=='yes')
{document.getElementById("voice_type_accent_div").style.display='block';}
else
{document.getElementById("voice_type_accent_div").style.display='none';}}
function selectMaxWord(t)
{if(t.value==15)
{document.getElementById("WordsLeft").value=25;word_count=25;}
if(t.value==30)
{document.getElementById("WordsLeft").value=50;word_count=50;}
if(t.value==45)
{document.getElementById("WordsLeft").value=75;word_count=75;}
if(t.value==60)
{document.getElementById("WordsLeft").value=100;word_count=100;}}
function InputLengthCheck(formName,textArea,wordsTyped,wordsLeft,wordCount,charTyped,charLeft,charCount){if(formName=="virtual_pack_5"){wordCount=document.getElementById("maxwords").value;}
if(wordCount=="check"){wordCount=document.getElementById("WordsLeft").value;}
if(charCount==""){charCount=0;}
if(wordCount==""){wordCount=0;}
MaximumCharacters=charCount;MaximumWords=wordCount;FormName=formName;TextFieldName=textArea;CharactersTypedFieldName=charTyped;CharactersLeftFieldName=charLeft;WordsTypedFieldName=wordsTyped;WordsLeftFieldName=wordsLeft;WordsMonitor=0;MaxWords=parseInt(MaximumWords);MaxChars=parseInt(MaximumCharacters);textfield='document.'+FormName+'.'+TextFieldName+'.value';InputCharacterLengthCheck();if(MaxWords>0){InputWordLengthCheck();}
else{if(formName!="virtual_pack_5"){eval(textfield+' = \'\'');}}}
function InputCharacterLengthCheck(){if(MaxChars<=0){return;}
var currentstring=new String();eval('currentstring = '+textfield);var currentlength=currentstring.length;eval('currentstring = CharLengthCheck('+textfield+','+MaxChars+')');if(CharactersLeftFieldName.length>0){var left=0;eval('left = '+MaxChars+' - '+textfield+'.length');if(left<0){left=0;}
eval('document.'+FormName+'.'+CharactersLeftFieldName+'.value = '+left);if(currentstring.length<currentlength){eval(textfield+' = currentstring.substring(0)');}}
if(CharactersTypedFieldName.length>0){eval('document.'+FormName+'.'+CharactersTypedFieldName+'.value = '+textfield+'.length');if(currentstring.length<currentlength){eval(textfield+' = currentstring.substring(0)');}}}
function InputWordLengthCheck(){if(MaxWords<=0){return;}
var currentstring=new String();eval('currentstring = '+textfield);var currentlength=currentstring.length;eval('currentstring = WordLengthCheck('+textfield+','+MaxWords+')');if(WordsLeftFieldName.length>0){var left=MaxWords-WordsMonitor;if(left<0){left=0;}
eval('document.'+FormName+'.'+WordsLeftFieldName+'.value = '+left);if(currentstring.length<currentlength){eval(textfield+' = currentstring.substring(0)');}}
if(WordsTypedFieldName.length>0){eval('document.'+FormName+'.'+WordsTypedFieldName+'.value = '+WordsMonitor);if(currentstring.length<currentlength){eval(textfield+' = currentstring.substring(0)');}}}
function WordLengthCheck(s,l){WordsMonitor=0;var f=false;var ts=new String();for(var vi=0;vi<s.length;vi++){vs=s.substr(vi,1);if(vs!=' '){if(f==false){f=true;WordsMonitor++;if((l>0)&&(WordsMonitor>l)){s=s.substring(0,ts.length);vi=s.length;WordsMonitor--;}}}
else{f=false;}
ts+=vs;}
return s;}
var flash_open=null;function preview_flash(file_path,height,width){if(width=="607"){var topX=(window.screen.width/2)-302;}
else if(width=="819"){var topX=(window.screen.width/2)-408;}
else{var topX=(window.screen.width/2)-580;}
var topY=10;flash_open=window.open(file_path,'Vuitlive_Flash_Preview','height='+height+',width='+width+',status=no,toolbar=no,menubar=no,location=no,screenX='+topX+',screenY='+topY);}
function close_preview_flash(file_path){if(flash_open!=undefined){flash_open.close();}}
function display_flash_error(msg){alert(msg);}