
function printCopyright(){

document.write("<DIV class=bottomLogoDiv><img src=\"images/bottomlogo.gif\" alt=\"VECTA ACS - Your Access to a Safe Future\" width=\"800\" height=\"69\" border=\"0\"></DIV>");
}




function newWindow(URL, windowName, menuFlag, 
				pHeight, pWidth, centerWindow) {
	if (parseInt(navigator.appVersion) >= 4) {
		isDyn = true;
	}
	else {
		isDyn = false;
	}

	if (pHeight != null && pWidth != null) {
		wWidth = pWidth;
		wHeight = pHeight;
	}
	else {
		// set absolute defaults in case not a 4.0 or greater
		wWidth = 450;
		wHeight = 500;
	
		// ok...figure out the screen size
	
		if (isDyn) {
			wWidth = parseInt(screen.width * .75);
			wHeight = parseInt(screen.height * .75);
		}
	}
	
	if (windowName == null)
		windowName = "popupWindow";
	
	if (menuFlag) menuFlag = 'yes'; else menuFlag = 'no';
	
	var windowFeatures = "height=" + wHeight + ",width=" + wWidth;
	windowFeatures += ",resizable=yes,toolbar=no,scrollbars=yes,menubar=";
	windowFeatures += menuFlag;

	var windowHandle = window.open(URL, windowName, windowFeatures);
	
	if (centerWindow) {
		windowHandle.focus();
	
		if (isDyn) {
			var sWidth = screen.width;
			var sHeight = screen.height;
			
			windowHandle.moveTo(sWidth / 2 - wWidth / 2, 
								sHeight / 2 - wHeight / 2 - 35);
		}
	}

	return false;
}

function getVerticalScrollPos(){
var ScrollTop = document.body.scrollTop;
	if (ScrollTop == 0){
		if (window.pageYOffset){
			ScrollTop = window.pageYOffset;
		}else{
			ScrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
		}
	}
	//alert("Scroll Top is: "+ScrollTop);
	return ScrollTop;
}

/*function findPos() is on ajax.js */
function showIdentityPartnerInfo(content,obj){
	position = findPos(obj);
	//var rowYPos = position[1]+0+"px";
	var rowYPos = getVerticalScrollPos()+50+"px";
	//var rowXPos = position[0]-25+"px";
	var rowXPos = "165px";
	var el = document.getElementById("identityTestimonialDiv");
	el.style.visibility="visible";
	el.style.width="450px";
	el.style.margin="0px";
	el.style.padding="0px";
	el.style.top = rowYPos;
	el.style.left = rowXPos;
	el.innerHTML = content;
}

function hideIdentityPartnerInfo(){
	var el = document.getElementById("identityTestimonialDiv");
	el.innerHTML = "";
	el.style.visibility="hidden";
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}

//confirmLang1 and confirmLang2 are global vars that are written by php
function confirmLanguageChange(selectBox){
	var doSwitch = false;
	var selectedIndex = selectBox.selectedIndex;
	var lang = selectBox.options[selectedIndex].value;
	var secondSlash = lang.indexOf('/', 1);
	if(secondSlash > -1){
	lang = lang.substr(0,secondSlash);
	}
	//alert ('lang is '+lang);
	var langLabel = 'English';
	switch(lang){
		case '/francais':
		langLabel = 'Fran\u00E7ais';
		doSwitch = false;
		break;
		case '/deutsch':
		langLabel = 'Deutsch';
		doSwitch = false;
		break;
		case '/espanol':
		langLabel = 'Espa\u00F1ol';
		doSwitch = true;
		break;
		case '/portugues':
		langLabel = 'Portugu\u00EAs';
		doSwitch = true;
		break;
		case '/italiano':
		langLabel = 'Italiano';
		doSwitch = false;
		break;
		case '/japanese':
		langLabel = '\u65E5\u672C\u8A9E';
		doSwitch = false;
		break;
		case '/chinese':
		langLabel = '\u4E2D\u6587';
		doSwitch = false;
		break;
		case '/korean':
		langLabel = '\uD55C\uAD6D\uC5B4';
		doSwitch = false;
		break;
		case '/russian':
		langLabel = '\u043F\u043E-\u0440\u0443\u0441\u0441\u043A\u0438';
		doSwitch = false;
		break;
		case '/index.php':
		doSwitch = true;
		lang = "";
		//alert ('lang = '+lang);
		default:
		langLabel = 'English';
	}
	if(doSwitch){
		var answer = confirm(confirmLang1+' '+langLabel+' '+confirmLang2)
		if (answer){
			//alert('The selected language is '+lang);
			createCookie('langPref',lang,360);
			createCookie('declineLang','false',0);
		}
		else{
			createCookie('declineLang','true',0);
			//eval("parent.location='"+selectBox.options[selectBox.selectedIndex].value+"'");
		}
		return true;
	}else{
		return true;
	}
}