function xigajax(xPhpFile,xElementId,doIt){if(doIt){if(xElementId=="detailzone"||xElementId=="mainzone")
{window.scroll(0,0);}
var onDate=new Date();if(xElementId){if(xElementId=="detailzone")
xElementId="mainzone";if(xElementId=="mainzone"){document.getElementById(xElementId).innerHTML='<div style="text-align:center; padding-top:30px"><img src="/usa/templates/default/images/loading.gif" border="0"></div>';}else{document.getElementById(xElementId).style.display="";}}
sendtotext(xPhpFile+'&rand='+onDate,xElementId);}else{document.getElementById("theframe").src="/usa/helper3.htm?"+xPhpFile+"~"+xElementId;}
return false;}
function resetiframe(){document.getElementById("currencylist").style.display='none';theframe.location.reload();}
function showdetail(){var o=document.getElementById("detailzone");if(o.style.display=="none"){document.getElementById("detailcontent").innerHTML="";}
document.getElementById("mainzone").style.display="none";o.style.display="block";}
function showmain(){document.getElementById("detailzone").style.display="none";document.getElementById("mainzone").style.display="block";}
function URLEncode(t)
{var SAFECHARS="0123456789"+"ABCDEFGHIJKLMNOPQRSTUVWXYZ"+"abcdefghijklmnopqrstuvwxyz"+"-_.!~*'()";var HEX="0123456789ABCDEF";var plaintext=t;var encoded="";for(var i=0;i<plaintext.length;i++){var ch=plaintext.charAt(i);if(ch==" "){encoded+="+";}else if(SAFECHARS.indexOf(ch)!=-1){encoded+=ch;}else{var charCode=ch.charCodeAt(0);if(charCode>255){alert("Unicode Character '"
+ ch
+"' cannot be encoded using standard URL encoding.\n"+"(URL encoding only supports 8-bit characters.)\n"+"A space (+) will be substituted.");encoded+="+";}else{encoded+="%";encoded+=HEX.charAt((charCode>>4)&0xF);encoded+=HEX.charAt(charCode&0xF);}}}
return encoded;};function lookupship(){var shipcountry=document.getElementById("shippingcountry").value;xigajax("/usa/con_workerbee.php?lookupshipping=1&entry_country="+shipcountry,"lookupshipdata");return false;}
function flashsuccess(prodID,x){document.getElementById("productsucmsg"+prodID).style.display="block";document.getElementById("productsucmsg"+prodID).innerHTML="<strong>Adding to "+x+"...</strong>";setTimeout('document.getElementById("productsucmsg'+prodID+'").innerHTML = ""',1000);setTimeout('document.getElementById("productsucmsg'+prodID+'").style.display = "none"',1005);}
function switchpull(o){document.forms[0].prodtype.selectedIndex=o;}
function resetsearch(){var s=document.getElementById("searchbox").value;if(s=="Search the site"){document.getElementById("searchbox").value='';}}
function opacity(id,opacStart,opacEnd,millisec){var speed=Math.round(millisec/100);var timer=0;if(opacStart>opacEnd){for(i=opacStart;i>=opacEnd;i--){setTimeout("changeOpac("+ i+",'"+ id+"')",(timer*speed));timer++;}}else if(opacStart<opacEnd){for(i=opacStart;i<=opacEnd;i++)
{setTimeout("changeOpac("+ i+",'"+ id+"')",(timer*speed));timer++;}}}
function changeOpac(opacity,id){var object=document.getElementById(id).style;object.opacity=(opacity/100);object.MozOpacity=(opacity/100);object.KhtmlOpacity=(opacity/100);object.filter="alpha(opacity="+ opacity+")";}
function shiftOpacity(id,millisec){if(document.getElementById(id).style.opacity==0){opacity(id,0,100,millisec);}else{opacity(id,100,0,millisec);}}
function blendimage(divid,imageid,imagefile,millisec){var speed=Math.round(millisec/100);var timer=0;document.getElementById(divid).style.backgroundImage="url("+ document.getElementById(imageid).src+")";changeOpac(0,imageid);document.getElementById(imageid).src=imagefile;for(i=0;i<=100;i++){setTimeout("changeOpac("+ i+",'"+ imageid+"')",(timer*speed));timer++;}}
function hidebask(){document.getElementById("theshoppingcartcontents").style.display="none";}
var closebask;function togglebasket(f){if(f=="addtobask"){clearTimeout(closebask);document.getElementById("theshoppingcartcontents").style.display="block";opacity("theshoppingcartcontents",0,100,300);}else if(f=="off"){opacity("theshoppingcartcontents",100,0,300);setTimeout('hidebask()',301);}else{var curr=document.getElementById("theshoppingcartcontents");if(curr.style.display=="none"||curr.style.display=="")
{curr.style.display="block";opacity("theshoppingcartcontents",0,100,300);}else{opacity("theshoppingcartcontents",100,0,300);setTimeout('hidebask()',301);}}}
function showbasketfade(){window.scroll(0,0);togglebasket("addtobask");closebask=setTimeout('togglebasket("off")',4700);}
function showwishfade(){document.getElementById("wishlistresponse").style.display="block";opacity("wishlistresponse",100,0,5000);setTimeout('document.getElementById("wishlistresponse").style.display = "none"',5001);}
function mySelect(){document.getElementById("matchstudio").value=document.getElementById("mySelector").value;}
function emptyme(s){opacity(s,100,0,500);setTimeout('document.getElementById("'+s+'").innerHTML = ""',501);setTimeout('document.getElementById("'+s+'").style.display = "none";',510);}
function toggle(e)
{var curr=document.getElementById(e);if(curr.style.display=="none"||curr.style.display=="")
{if(navigator.appName=="Microsoft Internet Explorer"){curr.style.display="block";}else{curr.style.display="table-row";}}else{curr.style.display="none";}}
function findsugg(i){xigajax("/usa/con_suggest.php?productid="+i,"thesuggestions","1");return false;}
function grabfilmcrave(e){xigajax("/usa/con_filmcrave.php?title="+e,"filmcravetrailer","1");return false;}
function toggleall(curID)
{var tlength=curID.length;var i;var divs=document.getElementsByTagName("TR");for(i=0;i<divs.length;i++){var curselect=divs[i].id;var tarea=curselect.substring(0,tlength);if(tarea==curID){if(navigator.appName=="Microsoft Internet Explorer"){document.getElementById(curselect).style.display="block";}else{document.getElementById(curselect).style.display="table-row";}}}}
function highlight_ship(profileID)
{var divs=document.getElementsByTagName("DIV");for(i=0;i<divs.length;i++){if(divs[i].id.indexOf("shipprof_")==0){divs[i].style.backgroundColor="#F2F2F2";}}
document.getElementById("shipprof_"+profileID).style.backgroundColor="#FFFFF3";}
function quickcheck(a){if(a=="emailaddress"){var str=document.getElementById("customers_email_address").value;var re=/^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/;if(!str.match(re)){document.getElementById("email_label").style.backgroundColor="#FF0000";document.getElementById("submitform").disabled=true;document.getElementById("showfix").style.display="";document.getElementById("emailerror").style.color="White";document.getElementById("emailerror").innerHTML="<br>invalid email";return false;}else{document.getElementById("email_label").style.backgroundColor="";document.getElementById("submitform").disabled=false;document.getElementById("showfix").style.display="none";}
theframe.location.href="/usa/workerbee.php?verifyvsdb=1&area=customers_email_address&value="+str;}}
