
// /_scripts/global.js
var w3c = (document.getElementById) ? 1:0
n = (document.layers) ? 1:0
ie = (document.all) ? 1:0
ie6 = (document.getElementById) ? 1:0
var pc	= (navigator.platform.indexOf('Win') == 0) ? 1:0;
var mac	= (navigator.platform.indexOf('Mac') == 0) ? 1:0;

var start_div = 1;

function show(id){
	// Netscape
	if (n)
	{
		document.layers[id].visibility = "show";
	}
	// W3C - Explorer 5+ and Netscape 6+
	else if (ie6) 
	{
		document.getElementById(id).style.visibility = "visible";
	}
	else if (ie)
	{
		document.all[id].style.visibility = "visible";			
	}
}


function hide(id){
	// Netscape
	if (n)
	{
		document.layers[id].visibility = "hide";
	}
	// W3C - Explorer 5+ and Netscape 6+
	else if (ie6) 
	{
		document.getElementById(id).style.visibility = "hidden";
	}
	else if (ie)
	{
		document.all[id].style.visibility = "hidden";			
	}
}



window.onerror = onError;

n = (document.layers) ? 1:0
ie = (document.all) ? 1:0
ie6 = (document.getElementById) ? 1:0

function onError(sMessage, sURL, sLine) 
{ 
        var sPrompt; 
        sPrompt = "________________________________________________________\n\n" 
        sPrompt += "A client-side javascript error has occured.\n" 
        sPrompt += "________________________________________________________\n\n" 
        sPrompt += "Line:\t" + sLine + "\n" 
        sPrompt += "Reason:\t" + sMessage + "\n" 
        sPrompt += "URL:\t" + sURL + "\n" 
                
        //test to see if this is the development site 
      	if (location.href.indexOf('byteinteractive.com') > 0) 
                window.alert(sPrompt); 
                
        return true; 
 } 

function onLoad()
{ 
	cacheImages();	//function to cache all rollover images
	//window.status = 'Welcome To ';
	return true;
}

function onResize()
{ 
	if (w3c)
		location.reload();
	return;
}

function cacheImages()
{
	var i;
	
	var oImages = new Array(document.images.length);			//array of image objects
	//reset all rollover images to their "off" state
	for (i=0; i<document.images.length; i++)
	{
		if ( document.images[i].src.search(/\_off\.(gif|jpg)/) > 0 )
		{	
			oImages[i] = new Image();
			oImages[i].src = document.images[i].src.replace("_off.", "_on.");
		}
	}
	return;
}

function setImage(oImage)
{

	var i;

	//first reset all rollover images to their "off" state
	for (i=0; i<document.images.length; i++)
	{
		if ( document.images[i].src.search(/\_on\.(gif|jpg)/) )
			document.images[i].src.replace("_on.", "_off.");
	}
	
	//now set the image to be in the "on" state		
	eval(oImage).src = eval(oImage).src.replace("_off.", "_on.");
				
	return;
}

function clearImages()
{
	var i;
	
	//reset all rollover images to their "off" state
	for (i=0; i<document.images.length; i++)
	{
		if ( document.images[i].src.search(/\_on\.(gif|jpg)/) > 0 )
			document.images[i].src = document.images[i].src.replace("_on.", "_off.");
	}
	return;
}

function openWindow(url, name, width, height, resize, scroll, center)
{
	var sParams = '';
	name = (name == null) ? '' : name;

	sParams += 'width=' + width;
	sParams += ',height=' + height;
	sParams += (resize || resize == 'true') ? ',resizable=yes' : ',resizable=no';
	sParams += (scroll || scroll == 'true') ? ',scrollbars=yes' : ',scrollbars=no';
	sParams += (center || center == 'true') ? ',left=' + ((screen.width - width) / 2) : '';
	sParams += (center || center == 'true') ? ',top=' + ((screen.height - height) / 2) : '';

	window.name = 'opener';
	var popupWin = window.open(url, name, sParams);
	popupWin.focus();
	return;
}

function getDHTMLObj(objName)
{
	if (document.getElementById)
		return document.getElementById(objName);
	else if (document.all)
		return document.all[objName];
	else if (document.layers)
		return document.layers[objName];
	else
		return null;
} 


function openPrivacy()
{
	window.open('/privacy.aspx','privacy','scrollbars=yes,status=no,width=600,height=600')
}

function openLegal()
{
	window.open('/Legal.aspx','legal','scrollbars=yes,status=no,width=600,height=600')
}

function openContact()
{
	window.open('/contact.asp','contact','scrollbars=yes,status=no,width=495,height=650')
}

function homeFlash()
{

document.write ('');
      
}
