var pw=null;
function pWin(ppg,w,h,scr,res){if(w==0){w=screen.width-64;var winl=32;}else{var winl=(screen.width-w)/2;}if(h==0){h=screen.height-128;var wint=32;}else{var wint=(screen.height-h)/2;}var set='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scr+',resizable='+res;pw=window.open(ppg,'pnWin',set);if(parseInt(navigator.appVersion)>=4){pw.window.focus();}}
function getLurl(u){location.href=u;}
function nvSideLnk(tr){getLurl(document.getElementById(tr).href);}
function expaCollni(){var C;for(var i=0;i<expaCollni.arguments.length;i++){var S=1; var Arg=expaCollni.arguments[i];var element=document.getElementById(Arg);C=element.style.display=(element.style.display == "none") ? "block" : "none";}}
function expaColl(){var C;for(var i=0;i<expaColl.arguments.length;i++){var S=1; var Arg=expaColl.arguments[i];var element=document.getElementById(Arg);C=element.style.display=(element.style.display == "none") ? "block" : "none";if(i<1){if(C=="block"){S=0;}document.images['ic'+Arg].src='img/aclo'+S+'.gif';}}}
function zwabDap(s,m,c){var dsp="none";m++;var S=3; var D=4; var E=5;for(var i=s;i<m;i++){S=3;D=4;E=5;dsp="none";if(i==c){dsp="block";S=0;D=1;E=2;}document.getElementById('txf'+i).style.display=dsp;document.images['bis'+i].src='img/sct'+S+'.gif';document.images['bie'+i].src='img/sct'+E+'.gif';document.getElementById('tbt'+i).style.backgroundImage='url(\'img/sct' + D + '.gif\')';}}
function sendVars(V){setTxCont(V);setTimeout("window.frames.ssiVar.location.href='inc/ivars.php?"+V+"';",130);}
function add2cart(i,t,z){SunglassPopupShow('pu/if/add2cart.php?artId='+i,'<b class=fBig>'+btA2C+'</b>',480,320);}
function setTxCont(t){window.frames.ssiVar.document.getElementById('varStat').innerHTML='<marquee scrollamount="7" scrolldelay="80">... '+t+' ...</marquee>';}
function number_format(number, decimals, dec_point, thousands_sep){ var n=number, c=isNaN(decimals = Math.abs(decimals)) ? 2 : decimals; var d=dec_point == undefined ? "." : dec_point; var t=thousands_sep == undefined ? "," : thousands_sep, s = n < 0 ? "-" : ""; var i=parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0; return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "");}
function MM_swapImgRestore(){ var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; }
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function GetWindowCLT(iObjW,iObjH){
  var iBodyWidth  = f_clientWidth();
  var iBodyHeight = f_clientHeight();
  var iScrollLeft = f_scrollLeft();
  var iScrollTop  = f_scrollTop();
  var aWC = new Array(2);
  aWC[0] = (iBodyWidth  / 2) + iScrollLeft.valueOf();
  aWC[1] = (iBodyHeight / 2) + iScrollTop.valueOf();
  var aResult = new Array(2);
  aResult[0] = Math.floor(aWC[0].valueOf() - iObjW.valueOf() / 2);
  aResult[1] = Math.floor(aWC[1].valueOf() - iObjH.valueOf() / 2);
  var iScrollLeft = f_scrollLeft();
  var iScrollTop  = f_scrollTop();
  if (iScrollLeft > aResult[0]){ aResult[0] = iScrollLeft; }
  if (iScrollTop > aResult[1]){ aResult[1] = iScrollTop; }
  var isWW  = window.innerWidth; // offsetWidth ?
  var isWH = window.innerHeight; // offsetHeight ?
  if (isWW < iBodyWidth){isWW=iBodyWidth;}
  if (isWH < iBodyHeight){isWH=iBodyHeight;}
  if ((isWW- iObjW) < aResult[0]){aResult[0] = (isWW- iObjW);}
  if ((isWH- iObjH) < aResult[1]){aResult[1] = (isWH- iObjH);}
  aResult[2] = iBodyWidth + iScrollLeft.valueOf();
  aResult[3] = iBodyHeight + iScrollTop.valueOf();
  return aResult;
}
function f_clientWidth(){
  return f_filterResults (
    window.innerWidth ? window.innerWidth : 0,
    document.documentElement ? document.documentElement.clientWidth : 0,
    document.body ? document.body.clientWidth : 0
  );
}
function f_clientHeight(){
  return f_filterResults (
    window.innerHeight ? window.innerHeight : 0,
    document.documentElement ? document.documentElement.clientHeight : 0,
    document.body ? document.body.clientHeight : 0
  );
}
function f_scrollLeft(){
  return f_filterResults (
    window.pageXOffset ? window.pageXOffset : 0,
    document.documentElement ? document.documentElement.scrollLeft : 0,
    document.body ? document.body.scrollLeft : 0
  );
}
function f_scrollTop(){
  return f_filterResults (
    window.pageYOffset ? window.pageYOffset : 0,
    document.documentElement ? document.documentElement.scrollTop : 0,
    document.body ? document.body.scrollTop : 0
  );
}
function f_scrollHeight(){
  return (
    window.scrollHeight ? window.scrollHeight : 0,
    document.documentElement ? document.documentElement.scrollHeight : 0,
    document.body ? document.body.scrollHeight : 0
  );
}
function f_filterResults(n_win, n_docel, n_body){
  var n_result = n_win ? n_win : 0;
  if (n_docel && (!n_result || (n_result > n_docel))){
    n_result = n_docel;
  }
  return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}
function SunglassPopupShow(pUrl,tt,iW,iH){
 var glaSS=document.getElementById('SunglassDiv');
 var popSS=document.getElementById('popIFrameDiv');
 var popIF=document.getElementById('popupIFrame');
 var centerXY = GetWindowCLT(iW,iH);
 var tvs=f_scrollHeight();
 if(tvs>centerXY[3]){centerXY[3]=tvs;}
 glaSS.style.position = 'absolute';
 glaSS.style.left = '0px';
 glaSS.style.top = '0px';
 glaSS.style.width = centerXY[2]+'px';
 glaSS.style.height = centerXY[3]+'px';
 glaSS.style.zIndex = '1500';
 glaSS.style.backgroundColor = '#000000';
 glaSS.style.visibility = 'visible';
 glaSS.style.display = 'block';
 glaSS.style.opacity = '0.70';
 glaSS.style.filter = 'Alpha(Opacity=70)';
 popSS.style.position = 'absolute';
 popSS.style.width = (2+iW) + 'px';
 popSS.style.height = (20+iH) + 'px';
 popSS.style.left = centerXY[0]+'px';
 popSS.style.top = (centerXY[1]-28)+'px';
 popSS.style.zIndex = '1605';
 popSS.style.visibility = 'visible';
 popSS.style.display = 'block';
 popIF.style.border = '#999999 1px solid';
 popIF.width = iW + 'px';
 popIF.height = iH + 'px';
 popIF.src = pUrl;
 if(tt!=''){document.getElementById('popTT').innerHTML=tt;}
 window.onresize = function (){ SunglassPopupShow(pUrl,tt,iW,iH); };
}
function SunglassPopupHide(){
 var glaSS=document.getElementById('SunglassDiv');
 var popSS=document.getElementById('popIFrameDiv');
 var popIF=document.getElementById('popupIFrame');
 glaSS.style.left = popSS.style.left = '0px';
 glaSS.style.top = popSS.style.top = '0px';
 glaSS.style.width = popSS.style.width = popIF.width = '1px';
 glaSS.style.height = popSS.style.height = popIF.height = '1px';
 glaSS.style.backgroundColor='';
 glaSS.style.visibility = popSS.style.visibility = 'hidden';
 glaSS.style.display = popSS.style.display = popIF.style.border = 'none';
 popIF.src = 'img/spc.gif';
 // popIF.scrolling='no';
 document.getElementById('popTT').innerHTML='';
 window.onresize = function (){ return false; };
}
function getFlashMovieObject(movieName){ if(window.document[movieName]){return window.document[movieName];} if(navigator.appName.indexOf("Microsoft Internet")==-1){if(document.embeds && document.embeds[movieName]){return document.embeds[movieName];}} return document.getElementById(movieName);}
function smlSrc(){var flashMovie=getFlashMovieObject("Ssearch");flashMovie.Play();return true;}
function submitQS(){if(smlSrc()){document.forms.qsForm.submit();}}
