function ResizeableWindow(URL,w,h) {
	if( w == null ) w = 380;
	if( h == null ) h = 240;
	window.open(URL,'WIN','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width='+w+',height='+h);
}

function emailCheck(emailStr)
{
	var emailPat		= /^(.+)@(.+)$/
	var specialChars	= "\\(\\)<>@,;:\\\\\\\"\\.\\[\\]";
	var validChars		= "\[^\\s" + specialChars + "\]";
	var quotedUser		= "(\"[^\"]*\")";
	var ipDomainPat		= /^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
	var atom			= validChars + '+';
	var word			= "(" + atom + "|" + quotedUser + ")";
	var userPat			= new RegExp("^" + word + "(\\." + word + ")*$");
	var domainPat		= new RegExp("^" + atom + "(\\." + atom +")*$");
	var matchArray		= emailStr.match(emailPat);
	
	if( matchArray == null )
	{
		alert( "Please enter a valid e-mail address (i.e., name@company.com) before submitting." );
		return false;
	}
	var user	= matchArray[1];
	var domain	= matchArray[2];
	
	if( user.match( userPat ) == null )
	{
	    alert( "Please enter a valid e-mail address (i.e., name@company.com) before submitting." );
	    return false;
	}
	
	var IPArray	= domain.match( ipDomainPat );
	if( IPArray != null )
	{
		for( var i = 1 ;i <= 4 ; ++i )
		{
		    if ( IPArray[i] > 255 )
		    {
		        alert("Destination IP address is invalid!");
				return false;
		    }
	    }
	    return true;
	}
	
	var domainArray	= domain.match( domainPat );
	if( domainArray == null )
	{
		alert( "Please enter a valid e-mail address (i.e., name@company.com) before submitting." );
	    return false;
	}
	
	var atomPat	= new RegExp( atom , "g" );
	var domArr	= domain.match( atomPat );
	var len		= domArr.length;
	if( domArr[domArr.length-1].length < 2 || domArr[domArr.length-1].length > 3 )
	{
		alert("Please enter a valid e-mail address (i.e., name@company.com) before submitting.");
		return false;
	}
	
	if( len < 2 )
	{
		alert( "Please enter a valid e-mail address (i.e., name@company.com) before submitting." );
		return false;
	}
	
	return true;
}


function home_displayMainTable(){
	var table = document.getElementById("homemaintable");
	if ( table != null ) table.style.visibility = "visible";
	//document.getElementById("nav_bg_home").style.display = "block";
}

var ourexpertise_timer = null;
function ourexpertise_displayMainTable(){
	var table = document.getElementById("ourexpertisemaintable");
	window.clearTimeout(ourexpertise_timer);
	if ( table != null ) table.style.visibility = "visible";
	//document.getElementById("nav_bg_ourexpertise").style.display = "block";
	//document.getElementById("nav_bg_home").style.display = "none"; 
	var table = document.getElementById("homemaintable");
	if ( table != null ) table.style.visibility = "hidden"; 
}
function ourexpertise_hideMainTable( hide ){
	var table = document.getElementById("ourexpertisemaintable");
	if ( table != null )	{
		if ( hide == true )		{
			window.clearTimeout(ourexpertise_timer);
			table.style.visibility = "hidden";
			//document.getElementById("nav_bg_ourexpertise").style.display = "none";
		}else{ ourexpertise_timer = window.setTimeout('ourexpertise_hideMainTable(true)', 350);
		}
	}
}
function selectourexpertiseOption( row ) { if ( row != null ) row.className = "ourexpertisemenuon"; }
function deselectourexpertiseOption( row ) { if ( row != null ) row.className = "ourexpertisemenuoff"; }


var whyprecast_timer = null;
function whyprecast_displayMainTable(){
	var table = document.getElementById("whyprecastmaintable");
	window.clearTimeout(whyprecast_timer);
	if ( table != null ) table.style.visibility = "visible";
	//document.getElementById("nav_bg_whyprecast").style.display = "block";
	//document.getElementById("nav_bg_home").style.display = "none";
	var table = document.getElementById("homemaintable");
	if ( table != null ) table.style.visibility = "hidden";
}
function whyprecast_hideMainTable( hide ){
	var table = document.getElementById("whyprecastmaintable");
	if ( table != null )	{
		if ( hide == true )		{
			window.clearTimeout(whyprecast_timer);
			table.style.visibility = "hidden";
			//document.getElementById("nav_bg_whyprecast").style.display = "none";
		}else{ whyprecast_timer = window.setTimeout('whyprecast_hideMainTable(true)', 350);
		}
	}
}
function selectwhyprecastOption( row ) { if ( row != null ) row.className = "whyprecastmenuon"; }
function deselectwhyprecastOption( row ) { if ( row != null ) row.className = "whyprecastmenuoff"; }


var ourcompany_timer = null;
function ourcompany_displayMainTable(){
	var table = document.getElementById("ourcompanymaintable");
	window.clearTimeout(ourcompany_timer);
	if ( table != null ) table.style.visibility = "visible";
	//document.getElementById("nav_bg_ourcompany").style.display = "block";
	//document.getElementById("nav_bg_home").style.display = "none";
	var table = document.getElementById("homemaintable");
	if ( table != null ) table.style.visibility = "hidden";
}
function ourcompany_hideMainTable( hide ){
	var table = document.getElementById("ourcompanymaintable");
	if ( table != null )	{
		if ( hide == true )		{
			window.clearTimeout(ourcompany_timer);
			table.style.visibility = "hidden";
			//document.getElementById("nav_bg_ourcompany").style.display = "none";
		}else{ ourcompany_timer = window.setTimeout('ourcompany_hideMainTable(true)', 350);
		}
	}
}
function selectourcompanyOption( row ) { if ( row != null ) row.className = "ourcompanymenuon"; }
function deselectourcompanyOption( row ) { if ( row != null ) row.className = "ourcompanymenuoff"; }


var techlib_timer = null;
function techlib_displayMainTable(){
	var table = document.getElementById("techlibmaintable");
	window.clearTimeout(techlib_timer);
	if ( table != null ) table.style.visibility = "visible";
	//document.getElementById("nav_bg_techlib").style.display = "block";
	//document.getElementById("nav_bg_home").style.display = "none";
	var table = document.getElementById("homemaintable");
	if ( table != null ) table.style.visibility = "hidden";
}
function techlib_hideMainTable( hide ){
	var table = document.getElementById("techlibmaintable");
	if ( table != null )	{
		if ( hide == true )		{
			window.clearTimeout(techlib_timer);
			table.style.visibility = "hidden";
			//document.getElementById("nav_bg_techlib").style.display = "none";
			//document.getElementById("nav_bg_home").style.display = "none";
		}else{ techlib_timer = window.setTimeout('techlib_hideMainTable(true)', 350);
		}
	}
}
function selecttechlibOption( row ) { if ( row != null ) row.className = "techlibmenuon"; }
function deselecttechlibOption( row ) { if ( row != null ) row.className = "techlibmenuoff"; }

function Open_Popup(url, width, height)
					{
						window.open(url, '', 'menubar=1,location=0,width=' + width + ',height=' + height + ',resizable=0,scrollbars=0');
					}
			function Open_Popup2(url, width, height)
					{
						window.open(url, '', 'menubar=1,location=0,width=' + width + ',height=' + height + ',resizable=0,scrollbars=1');
					}