/**
*
* @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();
	}

	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 contact form for kas_1434, 1435 and 1436
*******************************************************************************
**/
function popUpWindowScroll2(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 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+'');
}


/**
*******************************************************************************
* MM functions for tv icons
*******************************************************************************
**/
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

/**
*******************************************************************************
* ACTIVE X CODE
*******************************************************************************
**/

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
}