var timer;

function showPopup(){


		  if(document.getElementById){
		      obj = document.getElementById('popup');
			  if(obj)obj.style.visibility="hidden";
		  }else{
		    if((obj=findObj('popup'))!=null){
			 	if(obj.style)obj=obj.style;
				obj.visibility="hidden";
			 }
		  }


        for(i=0; i<arguments.length; i++) { 
		
		  if(document.getElementById){
		    obj = document.getElementById(arguments[i]);
			if(obj)obj.style.visibility="visible";
		  }else{
			 if((obj=findObj(arguments[i]))!=null){
			 if(obj.style)obj=obj.style;
			 obj.visibility="visible";
			 }	
		  }
		}
		
		if(timer) clearTimeout(timer);
		
}
function hidePopup(){ timer = setTimeout("showPopup()", 500) }	

function movePopup(){
var url = new String(window.location);

	if(url.indexOf('home.htm') != -1){ //movePopup for Home only
		if(document.getElementById){
		    obj = document.getElementById('popup');
	  		if(is.ns){
				if((leftPos=window.innerWidth*0.833-90)<557)leftPos = 557;
				if((topPos =window.innerHeight/2+266)<529)topPos = 529;
				if(obj)obj.style.left = leftPos; obj.style.top = topPos;
	  		}else if (is.ie){
			    if((leftPos=document.body.clientWidth*0.833-90)<557)leftPos = 557;
				if((topPos =document.body.clientHeight/2+266)<529)topPos = 529;
				obj = document.all['popup'].style;
			 	obj.pixelLeft = leftPos; obj.pixelTop =topPos;
			}
	
		  }else{
			 if((obj=findObj('popup'))!=null){
			 	if(obj.style)obj=obj.style;
				if((leftPos=window.innerWidth/2+166)<554)leftPos = 554;
				if((topPos =window.innerHeight/2+257)<533)topPos = 533;
				if(obj)obj.left = leftPos; obj.top = topPos;
				//if(obj)obj.left = window.innerWidth/2+203; obj.top = window.innerHeight/2+240;
			 }	
		  }
		
	}else if(url.indexOf('showroom.htm') != -1){// movePopup for showroom 
		if(document.getElementById){
		    obj = document.getElementById('popup');
	  		if(is.ns){
				if((leftPos=window.innerWidth*0.833-90)<557)leftPos = 557;

  				if(window.innerHeight>701){topPos = window.innerHeight/2+355;}
				else{topPos = 708}  
				if(obj)obj.style.left = leftPos; obj.style.top = topPos;

				
	  		}else if (is.ie){
				if((leftPos=document.body.clientWidth*0.833-90)<557)leftPos = 557;

  				if(window.innerHeight>701){topPos = window.innerHeight/2+355;}
				else{topPos = 708} 
				obj = document.all['popup'].style;
			 	obj.pixelLeft = leftPos; obj.pixelTop =topPos;
			}
	
		  }else{
			 if((obj=findObj('popup'))!=null){
			 	if(obj.style)obj=obj.style;
				if((leftPos=window.innerWidth*0.833-90)<557)leftPos = 557;
				//if((topPos =window.innerHeight/2+246)<493)topPos = 493;
				if(obj)obj.left = leftPos; obj.top = 708;
				//if(obj)obj.left = window.innerWidth/2+203; obj.top = window.innerHeight/2+240;
			 }	
	}
	
	}else{ // movePopup for all other pages
		if(document.getElementById){
		    obj = document.getElementById('popup');
	  		if(is.ns){
				if((leftPos=window.innerWidth*0.833-90)<557)leftPos = 557;
				//if((topPos =window.innerHeight/2+180)<493)topPos = 493;
					topPos = 597;
				if(obj)obj.style.left = leftPos; obj.style.top = topPos;
	  		}else if (is.ie){
				if((leftPos=document.body.clientWidth*0.833-81)<566)leftPos = 566;
				//if((topPos =document.body.clientHeight/2+246)<493)topPos = 493;
					topPos = 606;
				obj = document.all['popup'].style;
			 	obj.pixelLeft = leftPos; obj.pixelTop =topPos;
			}
	
		  }else{
			 if((obj=findObj('popup'))!=null){
			 	if(obj.style)obj=obj.style;
				if((leftPos=window.innerWidth*0.833-90)<557)leftPos = 557;
				//if((topPos =window.innerHeight/2+246)<493)topPos = 493;
					topPos = 515;
				if(obj)obj.left = leftPos; obj.top = topPos;
				//if(obj)obj.left = window.innerWidth/2+203; obj.top = window.innerHeight/2+240;
			 }	
		  }
	}	
}

function findObj(n, d) {
  var p,i,x;  
  	if(!d) d=document; 
	//window.alert(n.indexOf("?"));
	p=n.indexOf("?");
	if(p>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=findObj(n,d.layers[i].document);
  return x;
}
function BrowserCheck() {
	var b = navigator.appName
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b
	this.version = navigator.appVersion
	this.v = parseInt(this.version)
	this.ns = (this.b=="ns" && this.v>=4)
	this.ns4 = (this.b=="ns" && this.v==4)
	this.ns5 = (this.b=="ns" && this.v==5)
	this.ie = (this.b=="ie" && this.v>=4)
	this.ie4 = (this.version.indexOf('MSIE 4')>0)
	this.ie5 = (this.version.indexOf('MSIE 5')>0)
	this.min = (this.ns||this.ie)
}
is = new BrowserCheck()