<!--//hidden

////////////////////////////////////////////////////////
// Coded by Jesse Knowles | http://www.jesseknowles.com
// description: Common functions used in most websites
// Author: jesse@jesseknowles.com
// Last Modified: 07-09-03
////////////////////////////////////////////////////////

//////////////////////
// Status Bar Message
//////////////////////

window.defaultStatus="PROGRESSIVE COMMUNICATIONS : Customized Solutions, Uncommon Results";

////////////////////////////////////
// Popup window in center of screen
////////////////////////////////////

var popupDir = null; // this is to tell the popup that we are in the root dir

function popupWin(thisLink,popWidth,popHeight){
	var winleft = (screen.width - popWidth) / 2;
	var winUp = (screen.height - popHeight) / 2;
	window.open(thisLink, 'popup','toolbar=no, scrollbars=no,width='+popWidth+',height='+popHeight+',left='+winleft+',top='+winUp);
}


////////////////////////////////////
// Image Rollover
////////////////////////////////////

var thisDir = "sub"; // default dir
var imageDir = "images/";

function imageOver(option, image){
	if(thisDir == "sub"){ theURL = "../" + imageDir; }
	else{ theURL = imageDir; }
	thisOption = eval("document." + option);
	document.outImage = thisOption.src;
	document.thisOption = thisOption;
	thisOption.src = theURL + image;
}

function imageOut(){
	document.thisOption.src = document.outImage;
}


//////////////////
// show or hide id
//////////////////

function showHide(ctrl){
	if(document.getElementById(ctrl).style.display == "none"){ document.getElementById(ctrl).style.display = ""; }
	else{ document.getElementById(ctrl).style.display = "none"; }
}

///////////////////////////
// random flash header file
///////////////////////////

function headerFile(){
	headerFiles = 4;
	lastHeaderCheck = ReadCookie("rand_" + (headerFiles - 1));
	numArr = new Array(); // The array that will be formed
	if(lastHeaderCheck == null || lastHeaderCheck == ""){
		randomNumArr = randomNum(headerFiles); // get random array
		for(x=0; x<randomNumArr.length; x++){
			SetCookie("rand_" + x, randomNumArr[x], 5);
			numArr[x] = Math.floor(randomNumArr[x]);
		}
		thisNum = 1;
	}else{
		for(x=0; x<headerFiles; x++){ // pull cookies in and put them into array
			numArr[x] = Math.floor(ReadCookie("rand_" + x));
		}
		// set new array point
		thisNum = Math.floor(ReadCookie("thisNum")) + 1;
		if(thisNum >= headerFiles){ thisNum = 0; }
	}
	headerFile = "header_" + numArr[thisNum] + ".swf";
	if(window.thisCS){ 
		thisNum = thisCS; 
		headerFile = "header_" + thisCS + ".swf?cs=true";
	}
	SetCookie("thisNum", thisNum, 5);
	flashScript = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="760" height="200"><param name="movie" value="/flash/'+headerFile+'"><param name="quality" value="high"><embed src="/flash/'+headerFile+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="760" height="200"></embed></object>';
	document.getElementById("header").innerHTML = flashScript;
}

function randomNum(imageCount){
	randomNumArr = new Array(); // The array that will be formed
  	while(randomNumArr.length != imageCount){
		isSame = false;
 		currentNum = Math.floor(Math.random(imageCount) * imageCount) + 1; // try this random number
		for(x=0; x<randomNumArr.length || isSame == true; x++){
   			if(randomNumArr[x] == currentNum){
				isSame = true;
				break;
			}
		}
		// its all good so add it to array
		if(!isSame){
			randomNumArr[randomNumArr.length] = currentNum;
		}
	}
	return randomNumArr;
}

function SetCookie(cookieName,cookieValue,nDays) {
 	var today = new Date();
 	var expire = new Date();
 	if (nDays==null || nDays==0) nDays=1;
 	expire.setTime(today.getTime() + 3600000*24*nDays);
 	document.cookie = cookieName+"="+escape(cookieValue)
                 	+ ";expires="+expire.toGMTString()+";path=/";
}

function ReadCookie(cookieName) {
 	var theCookie=""+document.cookie;
 	var ind=theCookie.indexOf(cookieName);
 	if (ind==-1 || cookieName=="") return ""; 
 	var ind1=theCookie.indexOf(';',ind);
 	if (ind1==-1) ind1=theCookie.length; 
 	return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}

// -->