function showImage(imgnm) {
	ipath = "images/"+imgnm;
	document.write("<table border='0' cellspacing='0' cellpadding='0'>");
	document.write("<tr>");
	document.write("<td>");
	document.write("<img src='"+ipath+"'>");
	document.write("</td>");
	document.write("<td background='images/shadows/shadowSide.gif' valign='top'><img src='images/shadows/shadowTop.gif' width='8' height='8'></td>");
	document.write("</tr>");
	document.write("<tr>");
	document.write("<td background='images/shadows/shadowBottom.gif' align='left'><img src='images/shadows/shadowLeft.gif' width='8' height='8'></td>");
	document.write("<td><img src='images/shadows/shadowCorner.gif' width='8' height='8'></td>");
	document.write("</tr>");
	document.write("</table>");
}
function showCopyright() 
{
    //alert(overwriteCopyright);
    if (overwriteCopyright == undefined)
    {
        var overwriteCopyright = "Apangea";
    }
    
    if(overwriteCopyright=="GatewayToCollege") {
	     document.write("<div class='copyright'><img src='images/uiv5/GatewayFooter.png' /></div>"); 
	}else if(overwriteCopyright =="Apangea") {
      document.write("<div class='copyright'>&copy; Copyright 2008 <a href='mailto:info@apangea.com'>Apangea Learning, Inc.</a> All rights reserved.</div>");
    } else if(overwriteCopyright =="Healthcare") {
      document.write("<div class='copyright'>A Pittsburgh Regional Health Initiative &copy;2009</div>");
    }	
}
function makeFormControl(controlType,controlName,controlValue) {
	// controlType parameter accepts "text", "password", "submit", "reset"
	var tempString = "";
	
	tempString = '<input id="' + controlName + '" type="' + controlType + '"'
	tempString = tempString + ' value="' + controlValue + '" name="' + controlName + '"'
	
	if ((controlType == "text") || (controlType == "password")) {
		tempString = tempString + ' class="inputField" onFocus="className=\'inputField_On\';" onBlur="className=\'inputField\';">'
	} else if ((controlType == "submit") || (controlType == "reset")) {
		tempString = tempString + ' class="formButtons_off" onmouseover="className=\'formButtons_on\';" onMouseOut="className=\'formButtons_off\';">'
	} else {
		tempString = "<span class='warning'>error creating form control</span>";
	}
	document.write(tempString);
}

function getUrlVars() {

    var vars = [], hash;

    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');

    for(var i = 0; i < hashes.length; i++) {

        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];

    }

    return vars;

}

function getCookieValue(cookieName,valueName) {
	if(document.cookie) {
		var tempCookieInfo = ""
		var cookieInfo = document.cookie;
		cookieInfo = cookieInfo.split(";")
		var cookieCount = cookieInfo.length;
		for(var i = 0; i < cookieCount+1; i++) {
			//alert("getCookieValue + i ");
			tempCookieInfo = cookieInfo[i].split("=");	
			if(unescape(tempCookieInfo[0].replace(/^\s*|\s*$/g,'')) == cookieName) {
 			//alert("getCookieValue + if");       			
				for (var j = 1; j<tempCookieInfo.length-1;j+=2) {	
 					//alert("getCookieValue +  j");  						
		    			if (unescape(tempCookieInfo[j].replace(/^\s*|\s*$/g,'')) == valueName){
 					//alert(tempCookieInfo[j+1]);  								
						return tempCookieInfo[j+1];
					}
				}

			}
		} 
	} else { 
		return null;
	}
	return null;
}
function retrieveCookie( cookieName ) {
	/* retrieved in the format
	cookieName4=value; cookieName3=value; cookieName2=value; cookieName1=value
	only cookies for this domain and path will be retrieved */
	var cookieJar = document.cookie.split( "; " );
	for( var x = 0; x < cookieJar.length; x++ ) {
		var oneCookie = cookieJar[x].split( "=" );
		if( oneCookie[0] == escape( cookieName ) ) { return oneCookie[1] ? unescape( oneCookie[1] ) : ''; }
	}
	return null;
}
function launchWindow(url,name)  {
	popWidth = 514;
	popHeight = 522;
	
	popUrl = url
	popName = "";

	scrCenter_x = screen.width/2;
	scrCenter_y = screen.height/2;
	pop_left = scrCenter_x - popWidth/2;
	pop_top = scrCenter_y - popHeight/2;
  
	features = "directories=no,height="+popHeight+",width="+popWidth+",top="+pop_top+",left="+pop_left+",status=no,location=no,menubar=no,resizable=yes,scrollbars=no,toolbar=no"
	popupWin = window.open(popUrl, popName, features);
}