var ns4 = (document.layers)? 1 : 0 ;
var ie = (document.all)? 1 : 0 ;
var usr = navigator.userAgent
var objns6 = (usr.indexOf('Netscape6')!=-1)? 1 : 0 ;
var ns = (document.getElementById)? 1 : 0 ;
var isMac = (navigator.userAgent.indexOf('Mac')!=-1) ;
var brsr = (navigator.appName.indexOf("Netscape")!=-1) ;

var tsarMenu = new Array(3);
var tsarMenua = new Array(3);
for (i=0;(i<3);i++) {
 tsarMenu[i] = new Image(35,10); 
 tsarMenu[i].src = 'images/tsmenu_'+Number(i)+'.jpg'; 
 tsarMenua[i] = new Image(35,10); 
 tsarMenua[i].src = 'images/tsmenu_'+Number(i)+'d.jpg'; 
}

var arMenu = new Array(10);
var arMenua = new Array(10);
for (i=0;(i<10);i++) {
 arMenu[i] = new Image(106,48); 
 arMenu[i].src = 'images/menu_'+Number(i)+'.jpg'; 
 arMenua[i] = new Image(106,48); 
 arMenua[i].src = 'images/menu_'+Number(i)+'d.jpg'; 
}

//2007-12-17
var larMenu = new Array(10);
var larMenua = new Array(10);
for (i=0;(i<10);i++) {
 larMenu[i] = new Image(115,12); 
 larMenu[i].src = 'images/lmenu_'+Number(i)+'.jpg'; 
 larMenua[i] = new Image(115,12); 
 larMenua[i].src = 'images/lmenu_'+Number(i)+'d.jpg'; 
}

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_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_swapImgRestore() 
{ //v3.0
  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_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 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 details1(prodid) {
 win=window.open('shop.php?pid='+prodid+'&prevsize='+getSelectValue('prodsize'+prodid),"shop","width=580,height=520,left=17,top=17,statusbar=no,toolbar=no,scrollbars=no,navbar=no");
 win.focus();
} 

function details(prodid) {
 win=window.open('shop.php?pid='+prodid,"shop","width=500,height=380,left=17,top=17,statusbar=no,toolbar=no,scrollbars=no,navbar=no");
 win.focus();
} 

function getSelectValue(id)
{
  if (ie)
	return document.all[id].value;
  else if (ns)
	return document.getElementById(id).value;
}

function fMap1()
{
var adresa="locator_map_img.htm";
var w=430 , h=450;
var l=(screen.availWidth-w)/2 , t=(screen.availHeight-h)/2;
winMP=window.open(adresa,"winMP","width="+w+",height="+h+",left="+l+",top="+t+",statusbar=no,toolbar=no,scrollbars=no,navbar=no");
winMP.focus();
}
function fMap2()
{
var adresa="locator_map_img2.htm";
var w=430 , h=450;
var l=(screen.availWidth-w)/2 , t=(screen.availHeight-h)/2;
winMP=window.open(adresa,"winMP","width="+w+",height="+h+",left="+l+",top="+t+",statusbar=no,toolbar=no,scrollbars=no,navbar=no");
winMP.focus();
}
function fMap3()
{
var adresa="locator_map_img3.htm";
var w=430 , h=450;
var l=(screen.availWidth-w)/2 , t=(screen.availHeight-h)/2;
winMP=window.open(adresa,"winMP","width="+w+",height="+h+",left="+l+",top="+t+",statusbar=no,toolbar=no,scrollbars=no,navbar=no");
winMP.focus();
}
function fMap4()
{
var adresa="locator_map_img4.htm";
var w=650 , h=550;
var l=(screen.availWidth-w)/2 , t=(screen.availHeight-h)/2;
winMP=window.open(adresa,"winMP","width="+w+",height="+h+",left="+l+",top="+t+",statusbar=no,toolbar=no,scrollbars=no,navbar=no");
winMP.focus();
}
function fMap5()
{
var adresa="locator_map_img5.htm";
var w=430 , h=450;
var l=(screen.availWidth-w)/2 , t=(screen.availHeight-h)/2;
winMP=window.open(adresa,"winMP","width="+w+",height="+h+",left="+l+",top="+t+",statusbar=no,toolbar=no,scrollbars=no,navbar=no");
winMP.focus();
}
function fMap6()
{
var adresa="locator_map_img6.htm";
var w=650 , h=550;
var l=(screen.availWidth-w)/2 , t=(screen.availHeight-h)/2;
winMP=window.open(adresa,"winMP","width="+w+",height="+h+",left="+l+",top="+t+",statusbar=no,toolbar=no,scrollbars=no,navbar=no");
winMP.focus();
}

function fMap7()
{
var adresa="locator_map_img7.htm";
var w=650 , h=550;
var l=(screen.availWidth-w)/2 , t=(screen.availHeight-h)/2;
winMP=window.open(adresa,"winMP","width="+w+",height="+h+",left="+l+",top="+t+",statusbar=no,toolbar=no,scrollbars=no,navbar=no");
winMP.focus();
}

function loadfocus()
{
  if ((navigator.appName== "Netscape" && parseInt(navigator.appVersion) >= 4)|| (navigator.appName.indexOf("Microsoft") != -1 && parseInt(navigator.appVersion) > 3))
    browserVer = '1';
  else
    browserVer = '2';
  if (browserVer == 1)
	window.focus();
  return true;
}

function showImageLarger(imgname, w, h) {
   var w=75 + w , h=120+h;
   var l=(screen.availWidth-w)/2 , t=(screen.availHeight-h)/2;
   win=window.open('big_image1.htm?img='+imgname,"_blank","width="+w+",height="+h+",left="+l+",top="+t+",statusbar=no,toolbar=no,scrollbars=no,navbar=no");
   win.focus();
}

function popup(adresa){
  var w=550 , h=400;
  var l=(screen.availWidth-w)/2 , t=(screen.availHeight-h)/2;
  win=window.open(adresa,"_blank","width="+w+",height="+h+",left="+l+",top="+t+",statusbar=no,toolbar=no,scrollbars=yes,navbar=no");
  win.focus();
}

function popupn(adresa){
  var w=450 , h=400;
  var l=(screen.availWidth-w)/2 , t=(screen.availHeight-h)/2;
  win=window.open(adresa,"_blank","width="+w+",height="+h+",left="+l+",top="+t+",statusbar=no,toolbar=no,scrollbars=no,navbar=no");
  win.focus();
}

function popup1(adresa, w, h){
  var l=(screen.availWidth-w)/2 , t=(screen.availHeight-h)/2;
  win=window.open(adresa,"_blank","width="+w+",height="+h+",left="+l+",top="+t+",statusbar=no,toolbar=no,scrollbars=yes,navbar=no");
  win.focus();
}


function showImage(id, src) {
  if (ie)
   	document.all[id].src = src;
  else if (ns)
	   document.getElementById(id).src = src;
}

function showBig(imageName, width, height, textStr) {
  popAddr = "big.htm?path="+imageName+"&width="+width+"&height="+height;
  if (typeof(textStr)!='undefined') 
   popAddr = popAddr + "&textStr="+textStr;
  win = window.open(popAddr,"_blank","width="+Number(width+70)+",height="+Number(height+100)+",left=17,top=17,statusbar=no,toolbar=no,scrollbars= never,navbar=no");
  win.focus();
}

function loc_blow() {
 showBig('images/loc_blow2.jpg',270,440);
}


function loc_melrose() {
 showBig('images/loc_melrose1.jpg',490,400);
}

function loc_vault() {
 showBig('images/loc_vault.jpg',490,440);
}

function loc_premier() {
 showBig('images/loc_premier2.jpg', 250,440);
}

function loc_vaultwoman() {
 showBig('images/loc_vaultwoman.jpg',490,480,'<strong>The Vault Women and Girls</strong><br>361 Forest Ave  Ste 101, Laguna Beach, CA  92651<br> (949) 376 - 5000');
}

function loc_vaultcalabasas() {
 showBig('images/vaultcalabasas.jpg',490,480,'<strong>The Vault Women - Calabasas</strong>');
}

function loc_kids() {
 showBig('images/loc_kids.jpg',480,480,'<strong>Premier Kids Beverly Center</strong><br>8500 Beverly Blvd. Ste 601 A, Los Angeles, CA 90048<br>(310) 854-0060');
}

function showElement(id) {
  if(ie)
   	document.all[id].style.visibility = "visible";
  else if (ns)
   	document.getElementById(id).style.visibility = "visible";
}

function hideElement(id) {
  if(ie)
   	document.all[id].style.visibility = "hidden";
  else if (ns)
   	document.getElementById(id).style.visibility = "hidden";
}

function showMessage(id, text) {
  if(ie)
   	document.all[id].innerHTML = text;
  else if (ns)
   	document.getElementById(id).innerHTML = text;
  showElement(id);
}

function showImagePopup(scriptName,section,ind,width,height) {
  width = (width>750)?750:width;
  height = (height>500)?500:height;
  width+=50;
  height+=170;
  width = (width<333)?340:width;
  height = (height<200)?200:height;
  win = window.open('big_image1.htm?script='+scriptName+'&section='+section
	+'&ind='+ind,'_blank','width='+width+',height='
	+height+',left=17,top=17,statusbar=no,toolbar=no,scrollbars= never,navbar=no');
  win.focus();
}

function getParameter(str, name) {
  var res = "";
  if (str.indexOf("?")!=-1) {
    str = str.substring(str.indexOf("?")+1, str.length);
    if (str.indexOf(name)!=-1) {
      if (str.indexOf("&"+name, str.indexOf(name)+name.length)!=-1)
        res = str.substring(str.indexOf("&"+name)+name.length+1, str.indexOf("&"+name))
   	  else
        res = str.substring(str.indexOf(name)+name.length+1, str.length);
      if (res.indexOf("&")!=-1)
        res = res.substring(0,res.indexOf("&"));
   	}
  }
  return res;
}
function showhideElement(id) {
  if (ie) {
    if (document.all[id].style.visibility == "hidden")
      document.all[id].style.visibility = "visible";
    else
      document.all[id].style.visibility = "hidden";
  }
  else if (ns) {
    if (document.getElementById(id).style.visibility == "hidden")
  	   document.getElementById(id).style.visibility = "visible";
    else
  	   document.getElementById(id).style.visibility = "hidden";
  }
}

 var message = 
':. For the Company Contact Information,' + String.fromCharCode(13,10)+
'   please click on the <Contact Us> site link.' + String.fromCharCode(13,10)+
':. For Website and Technical Support,' + String.fromCharCode(13,10)+
'   visit us at: www.clearimaging.com' + String.fromCharCode(13,10)+
':. Website Source Code Copyrighted by' + String.fromCharCode(13,10)+
'    Clear Imaging '+(new Date()).getFullYear();
  
function clickIE4(){
  if (event.button==2){
    alert(message);
    return false;
  }
}

function clickNS4(e){
  if (document.layers||document.getElementById&&!document.all){
    if (e.which==2||e.which==3){
      alert(message);
      return false;
    }
  }
}

if (document.layers){
  document.captureEvents(Event.MOUSEDOWN);
  document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
  document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false");
