function popupWindow(url) {
  var w=540;
  var h=440;
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=600,height=400,screenX='+(screen.width-w)/2+',screenY='+(screen.height-h)/2+',left='+(screen.width-w)/2+',top='+(screen.height-h)/2)
}
function popupWindowContact(url) {
  var w=480;
  var h=400;
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width='+w+',height='+h+',screenX='+(screen.width-w)/2+',screenY='+(screen.height-h)/2+',left='+(screen.width-w)/2+',top='+(screen.height-h)/2)
}

function addBookmark(url,title) {  
if (window.sidebar) {   
window.sidebar.addPanel(title, url,"");   
} else if( document.all ) {  
window.external.AddFavorite( url, title);  
} else if( window.opera && window.print ) {  
return true;  
}  
}
//////////////display the tabs///////////////////////////////
var CurrentPage;
function getobj(id)
{
	return (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]:NULL;
}

function chkShow(obj,page)
{
	if(!CurrentPage)
		CurrentPage	=getobj("page_1");
	
	if(CurrentPage)
	{
		CurrentPage.className	= 'tabunLink';
		CurrentPage	= obj;
		CurrentPage.className	= 'tabLink';
/*
		for(i=0;i<2;i++){
			tabs	= getobj('tabpage'+i);
			//alert('tabpage'+i);
			if(i==page){
				tabs.style.display='block';
			}else{
				tabs.style.display='none';
			}	
		}*/
	}	
}

function GS_PopWin(url,name,options){
  var ContextWindow = window.open(url,name,options);
  ContextWindow.focus();
  return false;
}

function Event()
{
	func = Event.caller;
	while(func!=null)
	{
		var arg0=func.arguments[0];
		if(arg0)
		{
		//alert(arg0.constructor);
		if(arg0.constructor=="[MouseEvent]")
			return arg0;
		}
		func = func.caller;
	}
}
function ietruebody(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

var cur_lyr;
function swapLayers(id) {
if(!cur_lyr) cur_lyr = "lyr1";
if (cur_lyr) hideLayer(cur_lyr);
showLayer(id);
cur_lyr = id;
}
function showLayer(id) {
var lyr = getElemRefs(id);
if (lyr && lyr.css) lyr.css.display = "block";
}
function hideLayer(id) {
var lyr = getElemRefs(id);
if (lyr && lyr.css) lyr.css.display = "none";
}

function getElemRefs(id) {
var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
if (el) el.css = (el.style)? el.style: el;
return el;
}

var offsetxpoint=10 		//Customize x offset of tooltip
var offsetypoint=-40 		//Customize y offset of tooltip
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=true;

function ddrivetip(obj){
	positiontip(obj);
	if (ns6||ie){
		//		if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
		//		if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
		//		contobj.innerHTML=thetext;
		enabletip=true
	}
}
function positiontip(obj){
	var e = new Event();
	if (enabletip){
		var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
		var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
		obj.style.left=curX-30+"px"
		obj.style.top=curY-30+"px"
		obj.style.display="block"
	}
}
/*
document.ondblclick	= function (){
if(tipobj.style.display!='none'){
tipobj.style.display="none";
}
}//*/
var i;
function show_describ(objid){
	i=1;
	obj	= getobj(objid);
	ddrivetip(obj);
}
function wait(objid,timer){
	if(i>0)
	{
		i--;
		idt=setTimeout('wait(\''+objid+'\');',timer);
	}
	else
	{
		obj	= getobj(objid);
		obj.style.display='none';
	}
}
function stopidt()
{
	clearTimeout(idt);
	i=1;
}
function check_email(){
   var f=document.notify_instock;
   var email=f.email.value;
   var message="";
   var pattern = /^\w+([-+._]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/; 
   flag = pattern.test(email);  
       if(!flag)
       {  
    	   message ="It must be a valid email address !";
        alert(message);
        return false;
        }
}
