<!--
/**********************************************
              FF DHTML API 1.2
   Originaly Created by Jan Bovin - 7/30/99
Netscape 6 inproved by Anders Wallin - 11/14/00
          Copyright Framfab 2000
**********************************************/

var is = new Object()
is.ie = (document.all) ? 1:0
is.ns4 = (document.layers) ? 1:0
is.w3c = (document.getElementById && !is.ie) ? 1:0
is.win = (navigator.userAgent.toLowerCase().indexOf("win") > 0) ? 1:0
is.mac = (navigator.userAgent.toLowerCase().indexOf("mac") > 0) ? 1:0


function getLeft(strName){
	return ff_getX(strName)
}
function getTop(strName){
	return ff_getY(strName)
}
function getWidth(strName){
	return ff_getW(strName)
}
function getHeight(strName){
	return ff_getH(strName)
}
function showLayer(strName){
	ff_show(strName)
}
function hideLayer(strName){
	ff_hide(strName)
}
function moveToY(strName,pos){
	ff_moveTo(strName,null,pos)
}
function moveToX(strName,pos){
	ff_moveTo(strName,pos,null)
}   
function moveTo(strName,xPos,yPos){
	ff_moveTo(strName,xPos,yPos)
}  
function klippLager(strName,top,right,bottom,left){
	ff_clip(strName,top,right,bottom,left)
}

// New functions to handle NS6 //
function ff_getObj(strLayer, objLayerOwner) {
	if (is.ie) return document.all[ strLayer ];
	else if (is.ns4){
		if (!objLayerOwner) objLayerOwner = document.layers;
		var i = 0;
		var layer = objLayerOwner[ strLayer ];
		while ( !layer && ( i < objLayerOwner.length ) )
			layer = ff_getObj( strLayer, objLayerOwner[i++].document.layers );
		return layer;
	}
	else if (is.w3c) return document.getElementById( strLayer );
}
function ff_clip(strLayer,t,r,b,l) {
	var objLayer=ff_getObj(strLayer)
	if(objLayer){
		if (is.ie||is.w3c) objLayer.style.clip = "rect("+t+"px "+r+"px "+b+"px "+l+"px)";
		else if (is.ns4) {
			objLayer.clip.top = t;
			objLayer.clip.right = r;
			objLayer.clip.bottom = b;
			objLayer.clip.left = l;
		}
	}
}
function ff_moveTo(strLayer, x, y) {
	var objLayer=ff_getObj(strLayer)
	if(objLayer){
		if (is.ie) {
			if (x || x==0) objLayer.style.pixelLeft = x
			if (y || y==0) objLayer.style.pixelTop = y
		} 
		else if (is.ns4) {
			if (x || x==0) objLayer.left = x
			if (y || y==0) objLayer.top = y
		} 
		else if (is.w3c) {
			if (x || x==0) objLayer.style.left = x + "px";
			if (y || y==0) objLayer.style.top = y + "px";
		}		
	}
}
function ff_show(strLayer) {
	var objLayer=ff_getObj(strLayer)
	if(objLayer){
		if (is.ie||is.w3c) objLayer.style.visibility = "visible";
		else if (is.ns4) objLayer.visibility = "show";
	}
}
function ff_hide(strLayer) {
	var objLayer=ff_getObj(strLayer)
	if(objLayer){
		if (is.ie||is.w3c) objLayer.style.visibility = "hidden";
		else if (is.ns4) objLayer.visibility = "hide";
	}
}
function ff_getX(strLayer) {
	var objLayer=ff_getObj(strLayer)
	if(objLayer){
		if(is.ie||is.w3c) return objLayer.offsetLeft;
				
		else if (is.ns4) return objLayer.left;
	}
}



function ff_getY(strLayer) {
	var objLayer=ff_getObj(strLayer)
	if(objLayer){
		if(is.ie||is.w3c) return objLayer.offsetTop;
		else if (is.ns4) return objLayer.top;
	}
}
function ff_getW(strLayer) {
	var objLayer=ff_getObj(strLayer)
	if(objLayer){
		if(is.ie) return objLayer.clientWidth
		else if(is.ns4) return objLayer.clip.width
		else if(is.w3c){
			var style=getComputedStyle(objLayer,null);
			return parseInt(style.getPropertyValue('width'));
		}
	}
}
function ff_getH(strLayer) {
	var h
	var objLayer=ff_getObj(strLayer)
	if(objLayer){
		if (is.ie) h = objLayer.clientHeight
		else if(is.ns4) h = objLayer.clip.height
		else if(is.w3c){
			var style=getComputedStyle(objLayer,null);
			return parseInt(style.getPropertyValue('height'));
		}
	}
	return h
}


function getBottom(strName){
	return getTop(strName) + getHeight(strName);
}

function getRight(strName){
	return getLeft(strName) + getWidth(strName);
}


function specialinit(){
	var ns = (navigator.appName == "Netscape");
	if (ns) document.captureEvents( Event.MOUSEMOVE );
	document.onmousemove = mMove;
}





//************************************************** Macromedia Scripts

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];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}










 function NewPopUp(PageStr)
   {

	// Old New Window Popup
   	//window.open(PageStr, 'NewPop', 'resizable=yes,scrollbars=yes,toolbar=yes,width=750,height=500')


   	event.returnValue = false;
	//window.oCommentWindow = window.open( oAnchor.href , "CommentWindow" , "height=480,status=yes,toolbar=no,menubar=yes,location=no,scrollbars=yes,resizable,width=640" );
	NewWindow(PageStr,'test','750','500','yes','center');
	return false;

   }

 /****************************************************
        Author: Eric King
        Url: http://redrival.com/eak/index.shtml
        This script is free to use as long as this info is left in
        Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
   ****************************************************/
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos)
{

// normal useage would be a normal href with this event     -----    onclick="NewWindow(this.href,'test','640','480','yes','center');return false"
if(pos=="random")
	{
		LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
		TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
	}
if(pos=="center")
	{
		LeftPosition=(screen.width)?(screen.width-w)/2:100;
		TopPosition=(screen.height)?(screen.height-h)/2:100;
	}
else if((pos!="center" && pos!="random") || pos==null)
	{
		LeftPosition=0;
		TopPosition=20;
	}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=yes,menubar=no,toolbar=yes,resizable=yes';
win=window.open(mypage,myname,settings);
}


function NewWindow2(mypage,myname,w,h,scroll,pos)
{

// normal useage would be a normal href with this event     -----    onclick="NewWindow(this.href,'test','640','480','yes','center');return false"
if(pos=="random")
	{
		LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
		TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
	}
if(pos=="center")
	{
		LeftPosition=(screen.width)?(screen.width-w)/2:100;
		TopPosition=(screen.height)?(screen.height-h)/2:100;
	}
else if((pos!="center" && pos!="random") || pos==null)
	{
		LeftPosition=0;
		TopPosition=20;
	}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);
}



//******************************* My Funcs


function element_top(el)
{
	if(el)
	{
		var et = 0
		while (el)
		{
			et += el.offsetTop
			el = el.offsetParent
		}
		return et
	}
}



function element_left(el)
{
	if (el)
	{
		var et = 0
		while (el)
		{
			et += el.offsetLeft
			el = el.offsetParent
		}
		return et
	}
}



function element_right(el)
{
	if (el)
	{
		var et = 0
		var w = el.offsetWidth
		while (el)
		{
			et += el.offsetLeft
			el = el.offsetParent
		}
		et += w
		return et
	}
	else
	{
		return 0
	}
}



function PrintReport(text)
{
	text = '<div id = "pLogoBar"><div id = "pLogoBar1">' + mLogo.innerHTML + '</div><div id = "pLogoBar2">' + SubHeaderPhone.innerHTML + '</div></div><hr width = 99% size = 1 />' + '<h2 style = "margin-bottom : 1px;">' + SubHeaderTitle.innerHTML + '</h2><hr width = 99% size = 1 />' + text;
	if (window.print) {
	  winId = document.frames('ActionFrame')
	  with (winId.document) {
		write('<link href="/CSS/globalobjects.css" rel="stylesheet" type="text/css" /><style> #CarDetailToolBar { display : none;} #FrmDisplay { display : none; } #SchedTab { display : none; } #QuestTab { display : none; } </style><body onLoad="window.focus();window.print()">'+text+'<\/body>');
		close();
	  }
	}
}




function LaunchUsability()
{
	var PageStr = "/Usability.asp";
	NewWindow2(PageStr,'usability','400','135','no','center');
}

function LaunchUsability2()
{
	PageStr = '/Survey/default.asp?SurveyID=46';
	NewWindow(PageStr,'usabilitystudy','760','400','yes','center');
	self.close();
}

function LaunchFullJobApp()
{
	var PageStr = "/careers/application/";
	NewWindow(PageStr,'JobApp','800','550','yes','center');
}

function validateShortForm(Frm)
	{

	var phoneLength = 0;

	if ("" == Frm.Name.value)
		{
		window.alert("Please Enter Your Name.    ");
		Frm.Name.focus();
		//document.getElementById('Name').style.background = '#6699cc';
		return false;
		}
		
	if (3 >  Frm.Name.value.length)
		{
		window.alert("Please Enter Your Full Name.    ");
		Frm.Name.focus();
		//document.getElementById('Name').style.background = '#6699cc';
		return false;
		}

	if ("" == Frm.Email.value)
		{
		window.alert("Please Enter an Email address.    ");
		//document.getElementById('Email').style.background = '#6699cc';
		Frm.Email.focus();
		return false;
		}
		
		if (3 >  Frm.Email.value.length)
			{
			window.alert("Please Enter Your Full Email Address.    ");
			Frm.Email.focus();
			//document.getElementById('Name').style.background = '#6699cc';
			return false;
		}

	emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[a-zA-Z]$"
	var regex = new RegExp(emailReg);
	if (regex.test(Frm.Email.value))
	{
		return true;
	}
	else
	{
		window.alert("Please Enter a valid Email address.    ");
		Frm.Email.focus();
		//document.getElementById('Email').style.background = '#6699cc';
		return false;
	}


	return true;
}

function validateShortForm_w_Company(Frm)
	{

	var phoneLength = 0;

	if ("" == Frm.Name.value)
		{
		window.alert("Please Enter Your Name.    ");
		Frm.Name.focus();
		//document.getElementById('Name').style.background = '#6699cc';
		return false;
		}
		
	if (3 >  Frm.Name.value.length)
		{
		window.alert("Please Enter Your Full Name.    ");
		Frm.Name.focus();
		//document.getElementById('Name').style.background = '#6699cc';
		return false;
		}
		
	if ("" == Frm.Company.value)
		{
		window.alert("Please Enter Your Company.    ");
		Frm.Company.focus();
		//document.getElementById('Name').style.background = '#6699cc';
		return false;
		}
		
	if (3 >  Frm.Company.value.length)
		{
		window.alert("Please Enter Your Complete Company Name.    ");
		Frm.Company.focus();
		//document.getElementById('Name').style.background = '#6699cc';
		return false;
		}

	if ("" == Frm.Email.value)
		{
		window.alert("Please Enter an Email address.    ");
		//document.getElementById('Email').style.background = '#6699cc';
		Frm.Email.focus();
		return false;
		}
		
	if (3 >  Frm.Email.value.length)
		{
		window.alert("Please Enter Your Complete Email Address.    ");
		Frm.Email.focus();
		//document.getElementById('Name').style.background = '#6699cc';
		return false;
		}

	emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[a-zA-Z]$"
	var regex = new RegExp(emailReg);
	if (regex.test(Frm.Email.value))
	{
		return true;
	}
	else
	{
		window.alert("Please Enter a valid Email address.    ");
		Frm.Email.focus();
		//document.getElementById('Email').style.background = '#6699cc';
		return false;
	}


	return true;
}


function validateDownload(Frm)
	{

	var phoneLength = 0;
	var currIndex = 0;
	var looplength = 0;
	var repeatfound = 0; 
	

	if (3 >  Frm.fName.value.length)
		{
		window.alert("Please Enter Your First Name.    ");
		Frm.fName.focus();
		return false;
		}
		
		
	if (3 > Frm.lName.value.length)
		{
		window.alert("Please Enter Your Last Name.    ");
		Frm.lName.focus();
		return false;
		}
		
		
	if ("" == Frm.Company.value)
		{
		window.alert("Please Enter Your Company.    ");
		Frm.Company.focus();
		return false;
		}
		
	if (3 > Frm.JobTitle.value.length)
		{
		window.alert("Please Enter Your Job Title.    ");
		Frm.JobTitle.focus();
		return false;
		}

	if ("" == Frm.Email.value)
		{
		window.alert("Please Enter an Email address.    ");
		Frm.Email.focus();
		return false;
		}
		
	if (3 > Frm.Email.value.length)
		{
		window.alert("Please Enter Your Full Email Address.    ");
		Frm.Email.focus();
		return false;
		}
		
		
			
	if (Frm.fName.value == Frm.Company.value)
		{
		window.alert("Your first name and company cannot be the same value.  Please enter the complete name of your business.  ");
		Frm.Company.focus();
		return false;
		}
	
	if (Frm.Company.value == Frm.JobTitle.value)
		{
		window.alert("Your company and job title cannot be the same value.  Please enter a more accurate job title.  ");
		Frm.Company.focus();
		return false;
		}
		
	emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[a-zA-Z]$"
	var regex = new RegExp(emailReg);
	if (regex.test(Frm.Email.value))
	{
		if (Frm.Download.value.indexOf("Trial")!=-1)
		{
		
		
			if (Frm.Email.value.indexOf("hotmail")!=-1)
			{
				window.alert("Public email addresses such as hotmail are no longer accepted.  Please enter your business email address to continue.   ");
				Frm.Email.focus();
				return false;
			}
		
			if (Frm.Email.value.indexOf("Hotmail")!=-1)
			{
				window.alert("Public email addresses such as hotmail are no longer accepted.  Please enter your business email address to continue.   ");
				Frm.Email.focus();
				return false;
			}
		
			if (Frm.Email.value.indexOf("gmail")!=-1)
			{
				window.alert("Public email addresses such as Gmail are no longer accepted.  Please enter your business email address to continue.   ");
				Frm.Email.focus();
				return false;
			}
		
			if (Frm.Email.value.indexOf("Gmail")!=-1)
			{
				window.alert("Public email addresses such as Gmail are no longer accepted.  Please enter your business email address to continue.   ");
				Frm.Email.focus();
				return false;
			}
		
			if (Frm.Email.value.indexOf("yahoo")!=-1)
			{
				window.alert("Public email addresses such as Yahoo are no longer accepted.  Please enter your business email address to continue.   ");
				Frm.Email.focus();
				return false;
			}
		
		
			if (Frm.Email.value.indexOf("Yahoo")!=-1)
			{
				window.alert("Public email addresses such as Yahoo are no longer accepted.  Please enter your business email address to continue.   ");
				Frm.Email.focus();
				return false;
			}
			
			if (Frm.Email.value.indexOf("aol.")!=-1)
			{
				window.alert("Home email addresses such as AOL are no longer accepted.  Please enter your business email address to continue.   ");
				Frm.Email.focus();
				return false;
			}
			
			if (Frm.Email.value.indexOf("AOL.")!=-1)
			{
				window.alert("Home email addresses such as AOL are no longer accepted.  Please enter your business email address to continue.   ");
				Frm.Email.focus();
				return false;
			}
			
				if (Frm.Email.value.indexOf("Aol.")!=-1)
			{
				window.alert("Home email addresses such as AOL are no longer accepted.  Please enter your business email address to continue.   ");
				Frm.Email.focus();
				return false;
			}
		
		
			if (Frm.Email.value.indexOf("msn")!=-1)
			{
				window.alert("Public email addresses such as MSN are no longer accepted.  Please enter your business email address to continue.   ");
				Frm.Email.focus();
				return false;
			}
		}
		//return true;
	}
	else
	{
		window.alert("Please Enter a valid Email address.    ");
		Frm.Email.focus();
		return false;
	}
	return true;
}


