<!--//

//var strCfgAjaxLoaderImage	=	"/images/icon/ajax-loader.gif";
var strCfgAjaxLoaderImage	=	"/images/share/ajax-loader.gif";

function convertQuotes(string){
return string.replace(/"/g,"'");
}

function PopUpWindow(URL, N, W, H, S) { // name, width, height, scrollbars
	var winleft	=	(screen.width - W) / 2;
	var winup	=	(screen.height - H) / 2;
	winProp		=	'width='+W+',height='+H+',left='+winleft+',top='+winup+',scrollbars='+S+',resizable' + ',status=yes'
	Win			=	window.open(URL, N, winProp)
	if (parseInt(navigator.appVersion) >= 4) { Win.window.focus(); }
}


function confirmBox(strUrl) {
	PopUpWindow(strUrl,'SHConfirmBox',500,150,'no');
}



function confirmAlert(strText,strUrl) {
	var answer = confirm (strText);
	if (answer) {
		window.location = strUrl;
	}
}

function PreviewBox(strUrl) {
	PopUpWindow(strUrl,'SHConfirmBox',700,450,'yes');
}


/* Career App form */

function popCareerInstitution(param1,param2) {
	strUrl="career_popup/pop_career_institution.php?input1="+param1+"&input2="+param2;
	PopUpWindow(strUrl,'SH1',550,350,'yes');
}

function popCareerDegree(param1,param2) {
	strUrl="career_popup/pop_career_degree.php?input1="+param1+"&input2="+param2;
	PopUpWindow(strUrl,'SH1',550,350,'yes');
}

function popCareerFaculty(param1,param2) {
	strUrl="career_popup/pop_career_faculty.php?input1="+param1+"&input2="+param2;
	PopUpWindow(strUrl,'SH1',550,350,'yes');
}

function popCareerBackground(param1,param2) {
	strUrl="career_popup/pop_career_background.php?input1="+param1+"&input2="+param2;
	PopUpWindow(strUrl,'SH1',550,350,'yes');
}

function popCareerMajor(param1,param2) {
	strUrl="career_popup/pop_career_major.php?input1="+param1+"&input2="+param2;
	PopUpWindow(strUrl,'SH1',550,350,'yes');
}

/* / Career App form */



function replaceString (strString,strFind,strReplace) {
	while (strString.indexOf(strFind)>-1) {
		intPosition= strString.indexOf(strFind);
		strString = "" + (strString.substring(0, intPosition) + strReplace + 
		strString.substring((intPosition + strFind.length), strString.length));
	}
	return strString;
}


function showPressMagazine (strUrl) {
	PopUpWindow(strUrl,'SH01',640,800,'yes');
}




function setFormValue(objName,strValue){
	var arrObj = document.getElementsByName(objName);
	for(i=0;i<arrObj.length;i++){
		arrObjCheck = arrObj[i];
		if(arrObjCheck.type == "text" || arrObjCheck.type == "textarea" || arrObjCheck.type == "hidden") arrObjCheck.value = strValue;
		if(arrObjCheck.type == "select-one") for(j=0;j<arrObjCheck.length;j++) if(arrObjCheck.options[j].value == strValue) arrObjCheck.options[j].selected = true;
		if(arrObjCheck.type == "select-multiple") for(j=0;j<arrObjCheck.length;j++) if(strValue.indexOf("|"+arrObjCheck.options[j].value+"|")  > -1) arrObjCheck.options[j].selected = true;
		if(arrObjCheck.type == "radio") if(arrObjCheck.value == strValue) arrObjCheck.checked = true;
		if(arrObjCheck.type == "checkbox") if(arrObjCheck.value == strValue) arrObjCheck.checked = true;
	}
}



function jumpMenu(targ,selObj,restore){   
	if (selObj.options[selObj.selectedIndex].value != "") {
		eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
		if (restore) selObj.selectedIndex=0;
	}
}





var httpRequest = false;
function makeRequest(url) {
	httpRequest = false;

	if (window.XMLHttpRequest) { // Mozilla, Firefox, Opera, etc. 
		httpRequest = new XMLHttpRequest();
		if (httpRequest.overrideMimeType) {
			httpRequest.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) { // IE
		try {
			httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
			httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}

	if (!httpRequest) {
		alert('Cannot create an XMLHTTP instance');
		return false;
	}
	httpRequest.onreadystatechange = getContents;
	httpRequest.open('GET', url, true);
	httpRequest.send(null);
}


function kPopup(theURL,winName,posx,posy,width,height,features) {
	if (!winName.closed && winName.location) {
		winName.location.href = theURL;
	} else {
		var left,top = 0;
		if(posx=="right"){
			left = screen.width - width;
		} else if(posx=="center") {
			left = (screen.width - width)/2;
		} else {
			left = 0;
		}

		if(posy=="bottom") {
			top = screen.height - height;
		} else if(posy=="middle") {
			top = (screen.height - height)/2;
		} else {
			top = 0;
		}
		winName=window.open(theURL,winName,"width="+width+",height="+height+",left="+left+",top="+top+","+features);
		if (!winName.opener) {
			winName.opener = self;
		}
	}
	if (window.focus) {
		winName.focus();
	}
	return false;
}


function setDiv (strDivName,strDivData) {
	document.getElementById(strDivName).innerHTML = strDivData;
}

function getDiv (strDivName) {
	return document.getElementById(strDivName).innerHTML;
}

function clearDiv (strDivName) {
	document.getElementById(strDivName).innerHTML = '';
}

function hideDiv (strDivName) {
	document.getElementById(strDivName).style.display = 'none';
}

function showDiv (strDivName) {
	document.getElementById(strDivName).style.display = '';
}

function showAjaxLoader (strDivName) {
	return '<img src="'+ strCfgAjaxLoaderImage +'" align="absmiddle" border="0"> Loading...';
}

function getDivDisplay (strDivName) {
	return document.getElementById(strDivName).style.display;
}

function preloadImages() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=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];}}
}

preloadImages(strCfgAjaxLoaderImage);



//-->