


	 var cwin = null;
	 function openWin(theUrl, name, width, height, tools) {
	   cwin = window.open('', name,
	  tools+'width=' + width + ',height='+height);
	  if (cwin != null) {
	   if (cwin.opener == null)
	    cwin.opener = self;
	   cwin.location.href= theUrl;
	
	    cwin.focus();
	  }
	 }
	 function closeWin(theWin) {
	  theWin.close();
	 }
function show(object) 
  {
  if(navigator.vendor && navigator.vendor.indexOf("Apple") >=0){
  document.getElementById(object).style.display = 'inline-block';
  }else{
  document.getElementById(object).style.display = 'block';
  }
   
   document.getElementById(object).style.visibility = 'visible';
 
  }
           
 function hide(object) 
  {
  
   document.getElementById(object).style.display = 'none';
   document.getElementById(object).style.visibility = 'hidden';

  }
  function isEMailAddress(str)
{
		return isValidText(str,"^([\\w\\._-]+)@([\\w_-]+\\.)+([\\w_]+)$");
}







function isValidText(str,regex)
{
	if (window.RegExp){
		if (typeof(regex)=='string')
			regex=new RegExp(regex);
		return regex.test(str);
	}else{
		window.alert("RegExp not available!");
		return true;
	}
}

function SetActive(butt_num,butt_name){
	main_nav_button_up[butt_num]=new Image();
	main_nav_button_up[butt_num].src = 'media/nav/' + main_nav_buttons_name[butt_num] + '_dn.gif';
	document.images[butt_name].src='media/nav/' + main_nav_buttons_name[butt_num] + '_dn.gif';
}

function ShowSub(menuid,status){
	if(document.getElementById(menuid)){
		nav_list = new Array('about','booking');
		
		//hides all navs then shows the current one
		for(x=0;x < nav_list.length ;x++){
		
			if(document.getElementById(nav_list[x]+'nav')){
				subnav = document.getElementById(nav_list[x]+'nav');
				subnav.style.display='none';
			
			}
		}
		
				if(document.getElementById)
				{
					menu=document.getElementById(menuid);
					menu.style.display=(status)?'block':'none';
					menu.style.visibility=(status)?'visible':'hidden';
				}
		
		
	}
}


function ServiceItemChange(id,num,bgcolor,color){
if(document.getElementById(id)){
	//alert(document.getElementById(id+'a'));
	if(num){
	//document.getElementById(id+'_img').src='media/buttons/dropdowns/'+bgcolor+'_dn.gif';
	document.getElementById(id).style.backgroundColor ='#666666';
		//alert(document.getElementById(id+'_img').src);
		//document.getElementById(id).style.cursor = 'hand';
		//if(document.getElementById(id+"a")){
		//	document.getElementById(id+"a").style.backgroundColor=bgcolor;
		// }
	
	}else{
	//document.getElementById(id+'_img').src='media/buttons/dropdowns/'+bgcolor+'_up.gif';
		//document.getElementById(id).style.backgroundColor=color;
		document.getElementById(id).style.backgroundColor ='#CCCCCC';
			// document.getElementById(id).style.cursor = 'auto';
		//if(document.getElementById(id+"a")){
		//	document.getElementById(id+"a").style.backgroundColor=color;
		//}
	
	}
	
}
}

function CalcPos(ishome){
nav_list = new Array('why','catalog','how','faq');


	for(x=0;x < nav_list.length ;x++){
	
		//calculate the position of the subnavs
		subnav = document.getElementById(nav_list[x]+'nav');
		thespan = document.getElementById(nav_list[x]+'span');
	
	
	if(nav_list[x] == 'community' || nav_list[x] == 'chamber'){
		subnav.style.left=thespan.offsetLeft - 147;
		subnav.style.top=thespan.offsetTop;
		//objectdump(positioner);
	}else{
		subnav.style.left=thespan.offsetLeft-6;
		if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
	   && (navigator.appVersion.indexOf("Win") != -1) ){
			subnav.style.top=thespan.offsetTop+10;
		}else if(navigator.vendor.indexOf("Apple") >=0){
			subnav.style.top=thespan.offsetTop+10;
		}else{
			subnav.style.top=thespan.offsetTop;
		}
		//subnav.style.top=thespan.offsetTop+26;
	
	
	
	}
	
	if(ishome){
		if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
	   && (navigator.appVersion.indexOf("Win") != -1) ){
			subnav.style.top=thespan.offsetTop+11;
		}else if(navigator.vendor.indexOf("Apple") >=0){
			subnav.style.top=thespan.offsetTop+10;
		}else{
			subnav.style.top=thespan.offsetTop;
		}
	}
//subnav.style.top=thespan.style.top;

}



}
function showextra(thediv){
	document.getElementById(thediv).style.zIndex='3';
	document.getElementById(thediv).style.display='block';
	document.getElementById(thediv).style.visibility='visible';
}

function hideextra(thediv){
	document.getElementById(thediv).style.zIndex='-2';
	document.getElementById(thediv).style.display='none';
	document.getElementById(thediv).style.visibility='hidden';
}
function hideall(){
	document.getElementById('subabout').style.zIndex='-2';
	document.getElementById('subabout').style.display='none';
	document.getElementById('subabout').style.visibility='hidden';
	document.getElementById('subres').style.zIndex='-2';
	document.getElementById('subres').style.display='none';
	document.getElementById('subres').style.visibility='hidden';
}


function getPosition(e) {
    e = e || window.event;
    var cursor = {x:0, y:0};
    if (e.pageX || e.pageY) {
        cursor.x = e.pageX;
        cursor.y = e.pageY;
    } 
    else {
        var de = document.documentElement;
        var b = document.body;
        cursor.x = e.clientX + 
            (de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0);
        cursor.y = e.clientY + 
            (de.scrollTop || b.scrollTop) - (de.clientTop || 0);
    }
    //return cursor;
	document.cursorX=cursor.x;
	document.cursorY=cursor.y;
}
document.onmousemove=getPosition;

function trim(s)
{
	if (typeof(s)=='string'){
		var i,len=s.length;
		for (i=len-1;i>=0 && s.charAt(i)<=' ';--i){}
		len=i+1;
		for (i=0;i<len && s.charAt(i)<=' ';++i){}
		if (i<len) s=s.substring(i,len);
		else s="";
	}
	return s;
}


function isNumber(str,allowFP)
{
	if (typeof(allowFP)=='undefined') allowFP=false;

	if (typeof(str)=='number'){
		if (allow_fp) return true;
		else return str==Math.floor(str);
	}

	if (typeof(str)!='string') return false;

 	str=trim(str);
	if (str.length==0) return false;

	var result=true;
	if (window.RegExp){
		var regstr="^[+-]?[0-9]*";
		if (allowFP) regstr+="\\.?[0-9]*([eE][+-]?[0-9]+)?";
		regstr+="$";
		var reg = new RegExp(regstr);
		result=reg.test(str);
	}else{
		result=false;
	}
	return result;
}

function isDate(str)
{
	var milliseconds=Date.parse(str);
	return !(isNaN(milliseconds));
}

function isZIPCode(str)
{
	return isValidText(str,"^\\d{5}(-\\d{4})?$");
}


function isExpirationDate(str)
{
	if (isValidText(str,"^\\d{1,2}/\\d{2}$"))
	{
		var month=parseInt(str.substring(0,2));
		var year=parseInt(str.substring(3));
		if (month>=1 && month<=12 && year>=0 && year<=99) return true;
		else return false;
	}else return false;
}

function isCreditCardNumber(str)
{
	return isValidText(str,"^\\d{12}(\\d{4})?$");
}


function isEMailAddress(str)
{
	return isValidText(str,"^([\\w\\._-]+)@([\\w_-]+\\.)+([\\w_]+)$");
}


function isPhoneNumber(str)
{
	return isValidText(str,"^\\(?\\d{3}\\)?[-\\. ]?\\d{3}[-\\. ]?\\d{4}$");
}


function isAlpha(str)
{
	return isValidText(str.toUpperCase(),"^[ABCDEFGHIJKLMNOPQRSTUVWXYZ]+$");
}



function isAlphaNumeric(str)
{
	return isValidText(str.toUpperCase(),"^[ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890]+$");
}


function isValidText(str,regex)
{
	if (window.RegExp){
		if (typeof(regex)=='string')
			regex=new RegExp(regex);
		return regex.test(str);
	}else{
		window.alert("RegExp not available!");
		return true;
	}
}


function isDefined(obj)
{
    if (obj==null || (""+eval("obj"))=="undefined"){
		return false;
	}else{
		return true;
	}
}

function isPresent(obj)
{
	if (trim(obj) == "") {
		return false;
		}
	else {
		return true;
		}
}




