/*gzip*/ 
var focusimage=1;function mageover(obj,i){document.getElementById('maini').src=obj.src.replace("pettyimg.php","medimg.php");focusimage=i;}
function openbigimg(i){obj=document.getElementById('id_prod').value;addadress="&image="+focusimage;window.open("viewbigimage.php?product="+obj+addadress,"","menubar=no,scrollbars=no,status=no,width=530,height=600");}
function copyshipinbill(obj)
{with(document.formuser)
{BillAddress.value=ShipAddress.value;BillCity.value=ShipCity.value;BillState.value=ShipState.value;BillCountry.value=ShipCountry.value;BillZip.value=ShipZip.value;}}
function test_order_inf()
{res=true;var email=/^.[^\s]+@.[^\s]+\.[A-Za-z]{2,4}$/;var phone=/[0-9]/;msg="";with(document.formuser)
{if(billasship.checked){copyshipinbill();}
if(FName.value==""){msg+="Inter Your Firdt Name!\n";}
if(LName.value==""){msg+="Inter Your Last Name!\n";}
if(!Email.value.match(email)){msg+="Invalid mail format!\n";}
if(Phone.value.length<5){msg+="Invalid phone. Is too short!\n";}else{str=Phone.value;for(i=0;i<str.length;i++){if(!str.charAt(i).match(phone)){msg+="Invalid phone. Using only numeric symbol!\n";break;}}}
msg2="";if(ShipAddress.value.length<4){msg2+="   Invalid Address!\n";}
if(ShipCity.value.length<4){msg2+="   Invalid City!\n";}
if(ShipState.value==""){msg2+="   Select the State!\n";}
if(ShipCountry.value==""){msg2+="   Select the Country!\n";}else if(ShipState.value!=""){if(ShipCountry.value=="US"&&(ShipState.value==""||ShipState.value=="XX")){msg2+="   For "+ShipCountry.options[ShipCountry.selectedIndex].text+" you have to choose the state!\n";}
if(ShipCountry.value!="US"&&ShipState.value!="XX"){msg2+="   There is no such state in "+ShipCountry.options[ShipCountry.selectedIndex].text+"!\n";}}
if(ShipZip.value.length<2){msg2+="   Invalid Zip Code!\n";}
if(msg2!=""){msg+="\nShip Information:\n"+msg2;}
if(!billasship.checked)
{msg2="";if(BillAddress.value.length<4){msg2+="   Invalid Address!\n";}
if(BillCity.value.length<4){msg2+="   Invalid City!\n";}
if(BillState.value==""){msg2+="   Select the State!\n";}
if(BillCountry.value==""){msg2+="   Select the Country!\n";}else if(BillState.value!=""){if(BillCountry.value=="US"&&(BillState.value==""||BillState.value=="XX")){msg2+="   For "+BillCountry.options[BillCountry.selectedIndex].text+" you have to choose the state!\n";}
if(BillCountry.value!="US"&&BillState.value!="XX"){msg2+="   There is no such state in "+BillCountry.options[BillCountry.selectedIndex].text+"!\n";}}
if(BillZip.value.length<2){msg2+="   Invalid Zip Code!\n";}
if(msg2!=""){msg+="\nBill Information:\n"+msg2;}}
if(msg!=""){alert(msg);res=false;}}
return res;}
function stopAllANews(anewsid){for(i=0;i<all_anews.length;i++){try{if(all_anews[i]!=anewsid){document.getElementById("anews"+all_anews[i].toString()).SetVariable("mp3Close",1);}else document.getElementById("anews"+all_anews[i].toString()).SetVariable("mp3Close",0);}catch(errorObject){}}}
function getClientWidth(){return document.compatMode=='CSS1Compat'&&!window.opera?document.documentElement.clientWidth:document.body.clientWidth;}
function getClientHeight(){return document.compatMode=='CSS1Compat'&&!window.opera?document.documentElement.clientHeight:document.body.clientHeight;}
function getDivLoadPos(){iobj=document.getElementById('loading0');w=iobj.width;h=iobj.height;wid=getClientWidth();wid=Math.floor((wid-w)/2);hid=getClientHeight();hid=Math.floor((hid-h)/2);dobj=document.getElementById('divload0');dobj.style.top=hid;dobj.style.left=wid;}
function setElementOpacity(sElemId,nOpacity){var opacityProp=getOpacityProperty();var elem=document.getElementById(sElemId);if(!elem||!opacityProp)return;if(opacityProp=="filter"){nOpacity*=100;var oAlpha=elem.filters['DXImageTransform.Microsoft.alpha']||elem.filters.alpha;if(oAlpha)oAlpha.opacity=nOpacity;else elem.style.filter+="progid:DXImageTransform.Microsoft.Alpha(opacity="+nOpacity+")";}else elem.style[opacityProp]=nOpacity;}
function getOpacityProperty(){if(typeof document.body.style.opacity=='string')
return'opacity';else if(typeof document.body.style.MozOpacity=='string')
return'MozOpacity';else if(typeof document.body.style.KhtmlOpacity=='string')
return'KhtmlOpacity';else if(document.body.filters&&navigator.appVersion.match(/MSIE ([\d.]+);/)[1]>=5.5)
return'filter';return false;}
function replace_item(arr,newsel,newid){if(IntegrityR=='0'){document.getElementById('unwith'+newsel).innerHTML=document.getElementById('label'+newsel+newid).innerHTML;}
if(arr.length>1){testNewSelection(arr,newsel,newid);}
setElementOpacity('maini',0.2);document.getElementById('divload0').style.display='';paramkey='';for(i=0;i<arr.length;i++){karr='';karr+=arr[i];paramkey+=karr;for(j=0;j<CountFilter[arr[i]];j++){obj=document.getElementById(karr+j);if(obj.checked){paramkey+=obj.value;break;}}}
DufProd=new Array();if(IntegrityR=='0'){if(iskey(AllProd,paramkey)){DufProd=AllProd[paramkey];}else{DufProd=['0','<span class="color:#FA0000;">-</span>','0','0'];DufProd[4]=new Array();DufProd[4][0]='no_image.gif';DufProd[5]='0';}}else{DufProd=AllProd[paramkey];}
document.getElementById('id_prod').value=DufProd[0];document.getElementById('bigname').innerHTML=DufProd[1];document.getElementById('priceour').innerHTML='$ '+DufProd[2];document.getElementById('priceuser').innerHTML='$ '+DufProd[3];document.getElementById('maini').src='medimg.php?i='+DufProd[4][0];if(DufProd[5]==1){document.getElementById('add_to_cart').style.display='';document.getElementById('outofstock').style.display='none';}else{document.getElementById('add_to_cart').style.display='none';document.getElementById('outofstock').style.display='';}
imgcount=DufProd[4];for(i=0;i<5;i++){document.getElementById('tbl'+i).style.display='none';}
for(k=0;k<imgcount.length;k++){document.getElementById('tbl'+k).style.display='';document.getElementById('sm'+k).src='pettyimg.php?i='+DufProd[4][k];if(!in_array(DufProd[4][k],LoadingImg)){AllImgOnLoad[k]=1;}}
if(!in_array(DufProd[4][0],LoadingImg)){AllImgOnLoad[5]=1;}}
var AllImgOnLoad=[0,0,0,0,0,0];var LoadingImg=new Array();function loadImg(n,obj){AllImgOnLoad[n]=0;SumLoad=0;iname=obj.src;riname=iname.split('=');if(!in_array(riname[1],LoadingImg)){LoadingImg[LoadingImg.length]=riname[1];}
for(i=0;i<6;i++){SumLoad+=AllImgOnLoad[i];}
if(SumLoad==0){document.getElementById('divload0').style.display='none';setElementOpacity('maini',1);}}
function setColor(oname){document.getElementById(oname).click();}
function in_array(str,narr){for(i=0;i<narr.length;i++){if(str==narr[i]){return true;}}
return false;}
function iskey(myarr,variable_name){try{test=myarr[variable_name];if(typeof(myarr[variable_name])=='undefined')return false;}catch(e){return false;}
return true;}
function testNewSelection(arr,newsel,newid){NewKeyList=new Array();NewKeyList[0]=new Array();NewKeyList[1]=new Array();keySeek=0;paramkey='';for(i=0;i<arr.length;i++){karr='';karr+=arr[i];if(karr==newsel){keySeek++;continue;}
for(j=0;j<CountFilter[arr[i]];j++){obj=document.getElementById(karr+j);addkey='';addkey+=karr;addkey+=obj.value;newarrlen=NewKeyList[keySeek];NewKeyList[keySeek][newarrlen.length]=addkey;}}
LenKeyLists=new Array();for(i=0;i<NewKeyList.length;i++){newarrlen=NewKeyList[i];if(newarrlen.length==0){NewKeyList[i][0]='';newarrlen=NewKeyList[i];}
LenKeyLists[i]=newarrlen.length;}
for(i=0;i<LenKeyLists[0];i++){TestKeyLeft=NewKeyList[0][i];for(j=0;j<LenKeyLists[1];j++){TestKeyRight=NewKeyList[1][j];TestKey=TestKeyLeft+newsel+newid+TestKeyRight;obj=document.getElementById(TestKeyLeft+TestKeyRight);if(!iskey(AllProd,TestKey)){if(IntegrityR=='1'){obj.disabled=true;}else{document.getElementById('un'+TestKeyLeft+TestKeyRight).className='filterNoIntegrity';}}else{obj.disabled=false;if(IntegrityR=='0'){document.getElementById('un'+TestKeyLeft+TestKeyRight).className='filterNoIntegrityW';}}}}}
var vote_is=0;function select_vote_ov(v)
{if(vote_is!=0)return false;for(i=1;i<=5;i++){document.getElementById('vote'+i).src="image/vote_h_gr_"+i+".gif";if(v==i)break;}}
function select_vote_ou(v){if(vote_is!=0)return false;for(i=1;i<=5;i++){document.getElementById('vote'+i).src="image/vote_h_g_"+i+".gif";}}
function click_vote(v){if(vote_is!=0)return false;for(i=1;i<=5;i++){document.getElementById('vote'+i).src="image/vote_h_gr_"+i+".gif";if(v==i)break;}
vote_is=v;votepic=new Image();votepic.src="vote.php?vote="+v+"";return false;}
function country_update(sobj){obj=document.getElementById(sobj+'CountryId0');obj2=document.getElementById(sobj+'StateId0');obj2.options.length=0;obj2.options[obj2.options.length]=new Option(" - Select the state - ","");if(AllCity[obj.value]!=undefined){for(var cabbr in AllCity[obj.value]){obj2.options[obj2.options.length]=new Option(AllCity[obj.value][cabbr],cabbr);}}else{obj2.options[obj2.options.length]=new Option(AllCity['XX']['XX'],'XX');}}
function set_answers_poll(aid){document.getElementById("pollceil1").style.display='none';document.getElementById("ploading0").style.display='';JsHttpRequest.query('do_poll_vote.php?h='+Math.random(),{'aid':aid},function(result,errors){if(result["txt"]!=undefined){if(result["txt"]!='none'){document.getElementById("ploading0").style.display='none';document.getElementById("pollceil1").style.display='';document.getElementById("pollceil0").innerHTML=result["name"];document.getElementById("pollceil1").innerHTML=result["txt"];}}});return false;}
function openballonhint(obj,obj2){document.getElementById(obj).style.display='';setBallonHintPos(obj,obj2);window.onresize=exstraOpenBallonHint;}
function closeballonhint(obj){document.getElementById(obj).style.display='none';window.onresize='';return false;}
function setBallonHintPos(obj,obj2){obj=document.getElementById(obj);obj2=document.getElementById(obj2);pObj=getAlignedPosition(obj2);obj.style.top=(pObj.y-obj.offsetHeight-(isie?ietruebody().scrollTop:0))-(window.opera?20:0)+"px";obj.style.left=(pObj.x-obj.offsetWidth-(isie?ietruebody().scrollLeft:0))-(window.opera?20:0)+"px";}
var isie=document.all&&!window.opera;var isns6=document.getElementById&&!document.all;Number.prototype.NaN0=function(){return isNaN(this)?0:this;};function ietruebody(){return(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body;}
function getAlignedPosition(e){var left=0;var top=0;while(e.offsetParent){left+=e.offsetLeft+(e.currentStyle?(parseInt(e.currentStyle.borderLeftWidth)).NaN0():0);top+=e.offsetTop+(e.currentStyle?(parseInt(e.currentStyle.borderTopWidth)).NaN0():0);e=e.offsetParent;if(e.scrollLeft)left-=e.scrollLeft;if(e.scrollTop)top-=e.scrollTop;}
var docBody=document.documentElement?document.documentElement:document.body;left+=e.offsetLeft+(e.currentStyle?(parseInt(e.currentStyle.borderLeftWidth)).NaN0():0)+(isie?(parseInt(docBody.scrollLeft)).NaN0():0)-(parseInt(docBody.clientLeft)).NaN0();top+=e.offsetTop+(e.currentStyle?(parseInt(e.currentStyle.borderTopWidth)).NaN0():0)+(isie?(parseInt(docBody.scrollTop)).NaN0():0)-(parseInt(docBody.clientTop)).NaN0();return{"x":left,"y":top};}
function selectPartnerCode(codestr){document.getElementById('partnercodeid').value=codestr;document.getElementById('ballonhint0').style.display='none';document.getElementById('goanych0').click();}
function exstraOpenBallonHint(){openballonhint('ballonhint0','partnercodeid');}
var TplMS=new Array();TplMS[0]="<div style='text-align:center;'><span class='Blue' style='font-size:18px;'><br />Your Shopping Cart is empty.<br /><br /></span></div>";TplMS[1]='<form id="ms_order_list" onsubmit="return false;" enctype="multipart/form-data"><table width="540" border="0" cellspacing="0" cellpadding="0"><tr><td colspan="6" style="height:19px;" class="fn"></td></tr><tr><td style="width:56px;height:28px;">&nbsp;</td><td style="width:184px;">&nbsp;</td><td style="width:78px;">&nbsp;</td><td style="width:65px;" align="center" valign="middle" class="minicell04">PRICE<br />PER UNIT</td><td style="width:70px;">&nbsp;</td><td style="width:87px;">&nbsp;</td></tr>';TplMS[2]='<tr><td style="width:60px;height:56px;" align="center" class="fn nowrap"><a class="sh_name" href="#_link"><img src="http://pimg.desiresecrets.com/pettyimg.php?i=#_img" width="36" height="36" alt="#_name" /></a></td><td class="nowrap" align="left"><a class="sh_name" href="#_link">#_name</a></td><td style="width:80px;" align="center" class="fn nowrap">#_qty</td><td align="left" class="black3 nowrap"><b>$ #_price1</b></td><td align="left" class="black3 nowrap"><b>$ #_price2</b></td><td align="center" class="fn nowrap"><input type="image" name="remove_#_key" onclick="add_in_cart(\'ms_order_list\',\'remove_#_key\');" src="image/remove.png" title="Remove this item" /></td></tr>';TplMS[3]='<tr><td colspan="6" class="minicell2x"></td></tr><tr><td colspan="6" class="minicell3x"></td></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td class="minicell44">Subtotal:&nbsp;&nbsp;</td><td class="minicell45" align="left">$ #_subtotal</td><td>&nbsp;</td></tr><tr><td style="height:56px;">&nbsp;</td><td colspan="4" align="center"><a href="?action=shoppingcart"><img src="/image/minishop_checkout.png" alt="checkout" border="0" /></a></td><td align="center"><a href="#" onclick="return ClickMiniShoppingTab();"><b>close</b></a></td></tr></table></form>';function openminishopcart(){var obj='aminishopcart';var obj2='minisctable';var test_open=false;document.getElementById("minishopcart_tab").className='minishopcart_b2';openminishopcarthint(obj,obj2);window.onresize=exstraOpenMiniShopCart;return false;}
function openminishopcart(){var obj='aminishopcart';var obj2='minisctable';FlashPlayerDispay('none');document.getElementById("minishopcart_tab").className='minishopcart_b2';openminishopcarthint(obj,obj2);window.onresize=exstraOpenMiniShopCart;return false;}
function openminishopcarthint(obj,obj2){setMiniShopCartPos(obj,obj2);}
function exstraOpenMiniShopCart(){openminishopcarthint('aminishopcart','minisctable');}
function closeminishopcart(){MiniShopTabClaasNameRestore();window.onresize='';return false;}
function MiniShopTabClaasNameRestore(){if(document.getElementById("aminishopcart").offsetHeight!=0){setTimeout("MiniShopTabClaasNameRestore()",100);}else{document.getElementById("minishopcart_tab").className='minishopcart_b';FlashPlayerDispay();}}
function setMiniShopCartPos(obj,obj2){obj=document.getElementById(obj);obj2=document.getElementById(obj2);pObj=getAlignedPosition(obj2);obj.style.top=(pObj.y+obj2.offsetHeight-(isie?ietruebody().scrollTop:0))-(window.opera?15:0)+"px";obj.style.left=(pObj.x+obj2.offsetWidth-obj.offsetWidth-(isie?ietruebody().scrollLeft:0))-(window.opera?20:5)+"px";}
var MiniShopTabLoaded=false;function loadAccordions(){if(MiniShopTabLoaded)return false;MiniShopTabLoaded=true;bottomAccordion=new accordion('minishopcartTab',{classNames:{toggle:'minishopcartTabt',toggleActive:'minishopcartTabt_active',content:'minishopcartTabt_content'},resizeSpeed:4});return false;}
function add_in_cart(value,addparam){LoadMiniShopCart(value,addparam);return false;}
function LoadMiniShopCart(value2,addparam){var AddUrlSuffix='';loadAccordions();if(value2==undefined){value2="addformopen";}else if(value2.substr(0,7)=="addform"||value2=="fprod"){AddUrlSuffix='?addtocart_x=1';}else if(value2=="ms_order_list"&&addparam!=undefined){if(addparam.substr(0,7)=="remove_"){AddUrlSuffix='?remove_='+addparam.substr(7);}else if(addparam=="update_"){AddUrlSuffix='?update_=1';}}
value=document.getElementById(value2);var minisc=new JsHttpRequest();minisc.onreadystatechange=function(){if(minisc.readyState==4){subtotal=0;allqty=0;if(minisc.responseJS.msdata==undefined){document.getElementById('minishopcart_tab_content').innerHTML=TplMS[0];setTimeout("ClickMiniShoppingTab();",5000);}else if(minisc.responseJS.msdata.length==0){document.getElementById('minishopcart_tab_content').innerHTML=TplMS[0];setTimeout("ClickMiniShoppingTab();",5000);}else{buffmsd='';for(var i=0;i<minisc.responseJS.msdata.length;i++){msd=minisc.responseJS.msdata[i];copyTplMS2=TplMS[2];copyTplMS2=copyTplMS2.replace(/#_link/g,msd[0]);copyTplMS2=copyTplMS2.replace(/#_name/g,msd[1]);copyTplMS2=copyTplMS2.replace(/#_img/g,msd[2]);copyTplMS2=copyTplMS2.replace(/#_qty/g,get_qty(msd[6],msd[7],msd[3]));copyTplMS2=copyTplMS2.replace(/#_price1/g,msd[4]);copyTplMS2=copyTplMS2.replace(/#_price2/g,msd[5]);copyTplMS2=copyTplMS2.replace(/#_key/g,msd[6]);buffmsd+=copyTplMS2;subtotal=msd[8];allqty+=parseInt(msd[3]);}
document.getElementById('minishopcart_tab_content').innerHTML=TplMS[1]+buffmsd+TplMS[3].replace(/#_subtotal/g,subtotal);if(minisc.responseJS.notinstocke!=undefined){if(minisc.responseJS.notinstocke!="true"){MsgAlert=minisc.responseJS.notinstocke;alert('"'+MsgAlert+'" not in stock!');}}}
document.getElementById('btotal').innerHTML="$"+subtotal;document.getElementById('bqty').innerHTML=allqty;document.getElementById('minishopcartloading').style.display='none';if(document.getElementById("aminishopcart").offsetHeight==0){bottomAccordion.activate($$('#minishopcartTab .minishopcartTabt')[0]);}}};minisc.ontimeout=function(){};minisc.onerror=function(){};MyScrollTop=getBodyScrollTop();MyScrollLeft=getBodyScrollLeft();if(MyScrollTop!=0){window.scrollTo(MyScrollLeft,0);}
document.getElementById('minishopcartloading').style.display='';minisc.open('POST','do_minishopcart.php'+AddUrlSuffix,true);minisc.send({q:value});}
function ClickMiniShoppingTab(){loadAccordions();if(document.getElementById("aminishopcart").offsetHeight==0){LoadMiniShopCart();}else{bottomAccordion.activate($$('#minishopcartTab .minishopcartTabt')[0]);}
return false;}
function get_qty(name,kol,s_is){result="";for(var i=1;i<=kol;i++){result+='<option value="'+i+'" '+(s_is==i?"selected='selected'":"")+'>'+i+'</option>';if(i>=10)break;}
return'<select name="qty_'+name+'" class="qty" onchange="add_in_cart(\'ms_order_list\',\'update_\');">'+result+'</select>';}
function FlashPlayerDispay(display_param){if(display_param==undefined)display_param='visible';else display_param='hidden';try{if(all_anews!=undefined){for(i=0;i<all_anews.length;i++){try{document.getElementById("anews"+all_anews[i].toString()).style.visibility=display_param;}catch(errorObject){}}}}catch(errorObject){}}
function getBodyScrollTop(){return self.pageYOffset||(document.documentElement&&document.documentElement.scrollTop)||(document.body&&document.body.scrollTop);}
function getBodyScrollLeft(){return self.pageXOffset||(document.documentElement&&document.documentElement.scrollLeft)||(document.body&&document.body.scrollLeft);}