/**
*
* @file			LaunchSite.js
*
* @copyright 	(C) slp3D, Inc.  2006, 2008
* 
* @author		Neil Patterson
* @author		Terry Doll
* @date			01/30/2006
* @description	this is the global javascript file
*
* @revised		01/30/2006
* @notes		notes here
*
**/

/**
*******************************************************************************
* this function is used to switch show/hide elements on index.cfm and elsewhere
*******************************************************************************
**/
function switchID(tempElementID, off) {
var tempElement = document.getElementById(tempElementID).style;
if (off) {
	tempElement.visibility = 'hidden';
	tempElement.display = 'none';
} else {
	tempElement.visibility = 'visible';
	tempElement.display = 'inline';
}
}

/**
*******************************************************************************
* this function is used to maximize the browser window on clients screen
*******************************************************************************
**/
function maximizeWin() {
  if (window.screen) {
    var aw = screen.availWidth;
    var ah = screen.availHeight;
    window.moveTo(0, 0);
    window.resizeTo(aw, ah);
  }
}


/**
*******************************************************************************
* this function is used for the contact form pop-ups
*******************************************************************************
**/
var popUpWin=0;
function popUpWindowScroll(id)
{

if(popUpWin)
	{
		if(!popUpWin.closed) popUpWin.close();
	}

	//Parse the url to enable ssl
	getUrl = window.location.href;
	getUrl = getUrl.replace("http:","https:");
	getUrl = getUrl.replace("//or-live.com","//www.or-live.com");
	getUrl = getUrl.replace(/\/[^\/]*\.cfm.*$/,"/");
	getUrl = getUrl.replace(/\/[^\/]*\#.*$/,"/");

	windowURL = getUrl+"contact.cfm?id="+id;

	//windowURL = "contact.cfm?id="+id;
	
	if(id == 4) {
	windowWidth = 480;
	windowHeight = 300;
	windowLeft = 40;
	windowTop = 40;
	}
	
	else if (id == 5) {
	windowWidth = 480;
	windowHeight = 515;
	windowLeft = 40;
	windowTop = 40;
	}
	
	else {
	windowWidth = 480;
	windowHeight = 740;
	windowLeft = 40;
	windowTop = 40;
	}
	
	popUpWin = open(windowURL, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+windowWidth+',height='+windowHeight+',left='+windowLeft+', top='+windowTop+',screenX='+windowLeft+',screenY='+windowTop+'');
}

/**
*******************************************************************************
* this function is used for the contact2 form pop-ups
*******************************************************************************
**/
var popUpWin=0;
function popUpWindowScroll2(id)
	{

	if(popUpWin)
		{
			if(!popUpWin.closed) popUpWin.close();
		}

		windowURL = "contact2.cfm?id="+id;
		if(id == 4) {
		windowWidth = 480;
		windowHeight = 300;
		windowLeft = 40;
		windowTop = 40;
		}

		else if (id == 5) {
		windowWidth = 480;
		windowHeight = 515;
		windowLeft = 40;
		windowTop = 40;
		}

		else {
		windowWidth = 480;
		windowHeight = 740;
		windowLeft = 40;
		windowTop = 40;
		}

		popUpWin = open(windowURL, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+windowWidth+',height='+windowHeight+',left='+windowLeft+', top='+windowTop+',screenX='+windowLeft+',screenY='+windowTop+'');
	}

/**
*******************************************************************************
* this function is used for the alternate pop-ups
*******************************************************************************
**/
var popUpWin=0;
function popUpWindowScroll_alt(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

/**
*******************************************************************************
* this function is used for creating dynamic flash objects
*******************************************************************************
**/
function dynaObj(divID, clsID, objectID, width, height, movie, flashVar1) {
	var d = document.getElementById(divID);
	d.innerHTML = '<object classid='+clsID+' id='+objectID+' width='+width+' height='+height+'>'+'<param name= movie value='+movie+'>'+'<param name=quality value=high />'+'<param name=FlashVars value='+flashVar1+' />'+'<param name="allowScriptAccess" value="sameDomain" />'+'<param name="wmode" value="transparent">'+'</object>';
}

function detectIE() {
	//Detect IE5.5+
	var version=0
	if (navigator.appVersion.indexOf("MSIE")!=-1){
	temp=navigator.appVersion.split("MSIE")
	version=parseFloat(temp[1])
	}
	return version
}

/**
*******************************************************************************
* this function is used for creating dynamic redirect Links
* used to track outgoing links from the launchsites
*******************************************************************************
**/
function redirectURL(divID, redirectURL, redirectText, referringPage) {
	document.write('<div id="'+divID+'"></div>');
	var d = document.getElementById(divID);
	d.innerHTML = '<a href="'+redirectURL+'" target="_blank">'+redirectText+'</a>';
}
/* Backup
function redirectURL(divID, redirectURL, redirectText, referringPage) {
	document.write('<div id="'+divID+'"></div>');
	var d = document.getElementById(divID);
	d.innerHTML = '<a href="'+referringPage+'&redirect='+redirectURL+'&linkTitle='+redirectURL+'">'+redirectText+'</a>';
}
*/
