//page = ((navigator.platform.indexOf('Win') > -1) ? "pc" : "mac");
//document.write("<LINK REL=STYLESHEET HREF='/include/english_style_" + page + "_job.css' TYPE='text/css'>")

// Preload Image
ota_on = new Image();
ota_off = new Image();
apn_on = new Image();
apn_off = new Image();
ajs_on = new Image();
ajs_off = new Image();
ota1_on = new Image();
ota1_off = new Image();
apn1_on = new Image();
apn1_off = new Image();
ajs1_on = new Image();
ajs1_off = new Image();
wcl_on = new Image();
wcl_off = new Image();
wocl_on = new Image();
wocl_off = new Image();
apply_now_on = new Image();
apply_now_off = new Image();
	
ota_on.src = '../images/myct/btn_ota_on.gif';
ota_off.src = '../images/myct/btn_ota_off.gif';
apn_on.src = '../images/myct/btn_apn_on.gif';
apn_off.src = '../images/myct/btn_apn_off.gif';
ajs_on.src = '../images/myct/btn_ajs_on.gif';
ajs_off.src = '../images/myct/btn_ajs_off.gif';
ota1_on.src = '../images/myct/btn_ota_on.gif';
ota1_off.src = '../images/myct/btn_ota_off.gif';
apn1_on.src = '../images/myct/btn_apn_on.gif';
apn1_off.src = '../images/myct/btn_apn_off.gif';
ajs1_on.src = '../images/myct/btn_ajs_on.gif';
ajs1_off.src = '../images/myct/btn_ajs_off.gif';
wcl_on.src = '../images/myct/btn_wcl_on.gif';
wcl_off.src = '../images/myct/btn_wcl_off.gif';
wocl_on.src = '../images/myct/btn_wocl_on.gif';
wocl_off.src = '../images/myct/btn_wocl_off.gif';
apply_now_on.src = '../images/myct/btn_apply_now_on.gif';
apply_now_off.src = '../images/myct/btn_apply_now_off.gif';

function OpenApplyNow(job_id)
{
	url = "../seekers/seek_letter.asp?m_jobid=" + job_id

	var openApplyNowWindow = window.open(url,"applyWin","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=Yes,resizable=Yes,width=800,height=585,left=20,top=20");
	openApplyNowWindow.focus();
	return;
}

function OpenNonMemberApplyNow(job_id)
{
	url = "../seekers/non_member_apply.asp?m_jobid=" + job_id

	var openApplyNowWindow = window.open(url,"applyWin","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=Yes,resizable=Yes,width=800,height=585,left=20,top=20");
	//var openApplyNowWindow = window.open(url,"applyWin","toolbar=Yes,location=Yes,directories=Yes,status=Yes,menubar=Yes,scrollbars=Yes,resizable=Yes,width=730,height=520,left=20,top=20");
	openApplyNowWindow.focus();
	return;


}

function OpenPrintJob(job_id)
{
	url = "../search/print.asp?m_jobid=" + job_id + "&m_status=print"
	var openPrintJobWindow = window.open(url,"printjobWin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=Yes,resizable=Yes,width=680,height=520,left=20,top=20");
	openPrintJobWindow.focus();
	return;
}

function OpenRefFriend(job_id)
{
	url = "../search/mailform.asp?m_jobid=" + job_id 
	
	var openRefFriendWindow = 	window.open(url,"printjobWin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=Yes,resizable=No,width=600,height=555,left=20,top=20");
	openRefFriendWindow.focus();
	return;
}

function OpenJobSaved(job_para)
{
	url = "../search/clipsummary.asp?" + job_para 
	var openJobSavedWindow = 	window.open(url,"JobSavedWin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=Yes,width=670,height=520,left=20,top=20");
	openJobSavedWindow.focus();
	return;
}

function OpenCompSub(job_id)
{
	url = "../my_careertimes/comp_sub.asp?m_jobid=" + job_id 
	var openCompSubWindow = 	window.open(url,"CompSubWin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=560,height=350,left=20,top=20");
	openCompSubWindow.focus();
	return;
}

function OpenOtherOpeningsummary(url_link)
{
	url = url_link

	url = url.replace('-','%2D');
	url = url.replace('#','%23');
	var mywin=window.open(url,'mywindow',' toolbar=yes, location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes, resizable=yes');
	mywin.focus();
}

function OpenOtherOpening(url_link)
{
	url = url_link
	url = url.replace('-','%2D');
	url = url.replace('#','%23');
	
	if (window.opener==null){
		var openotherWindow =window.open(url,"openotherWin");
		openotherWindow.focus();
		return;
	}
	else{
		if (window.opener.open && window.opener.open && !window.opener.closed)
		{
			window.opener.location.href=url;
			window.opener.focus();
		}
		else
		{
			opener = window.open(url);
		}
	}
}

function OpenLink(url_link)
{
	url = url_link
	url = url.replace('-','%2D');
	url = url.replace('#','%23');

	if (window.opener && window.opener.open && !window.opener.closed)
	{
		window.opener.location.href=url;
		window.opener.focus()
	}
		
	else
	{
		opener = window.open(url);
	}
	
}

function send()
{
	document.applyform.action="ot_apply.asp";
	document.applyform.target = "_self"; 

	if (confirm("Send your resume to the recruiter now?"))
		document.applyform.submit(); 
	else
		return;
}

//Description: Show the image
function rollOver(F_NAME, I_NAME){
	imagesON = eval(F_NAME + "_on.src");
	document.images[I_NAME].src = imagesON;
}

//Description: Hide the image
function rollOut(F_NAME, I_NAME){
	imageOFF = eval(F_NAME + "_off.src");
	document.images[I_NAME].src = imageOFF;
}

//start:omouse hint functions
function YY_Mousetrace(evnt) {
 if (yyns4) { //ns
	if (document.getElementById('cursor').style.visibility=='visible'){
		if(evnt){yy_ml = evnt.pageX;yy_mt = evnt.pageY;}
	}
	else{
		if(evnt){yy_ml =0;yy_mt = -100;}
	}
 }
 else{	//ie

	if (document.getElementById('cursor').style.visibility=='visible'){
		yy_ml=(event.clientX + document.body.scrollLeft); 
		yy_mt=(event.clientY + document.body.scrollTop); 
	}
	else{
		yy_ml =0;
		yy_mt = -100;
	}		
 }
 if (yy_tracescript)eval(yy_tracescript) 
}

function m() 
{ 
	var width=document.getElementById('cursor_table').offsetWidth;
	document.getElementById('cursor').style.left=yy_ml-width-10;
	document.getElementById('cursor').style.top=yy_mt+15;
} 
function setvisible(value){
	document.getElementById('cursor').style.visibility='visible';
	document.getElementById('cursorvalue').innerHTML=value;
}
function setinvisible(){
	document.getElementById('cursor').style.visibility='hidden';
}

var yyns4=window.Event?true:false; 
var yy_mt = 0; 
var yy_ml = 0; 

if (yyns4) {
	document.captureEvents(Event.MOUSEMOVE); 
	document.onmousemove = YY_Mousetrace; 
	yy_tracescript = 'm()'; 
}
else{
	document.onmousemove = YY_Mousetrace; 
	yy_tracescript = 'm()'; 
}
//end:omouse hint functions


// javascript function for
// '################################ Task 1184 ################################
function OpenJobContentApplyNow(job_id, email)
{	

	//url = "../seekers/non_member_apply.asp?m_jobid=" + job_id + "&m_email=" + URLEncode(email);
	url = "../seekers/non_member_apply_from_jobdetails.asp?m_jobid=" + job_id + "&m_email=" + URLEncode(email);

	var OpenJobContentApplyNowWindow = window.open(url,"applyWin","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=Yes,resizable=Yes,width=800,height=585,left=20,top=20");

	OpenJobContentApplyNowWindow.focus();
	return;
}

function URLEncode(encode)
{
	// The Javascript escape and unescape functions do not correspond
	// with what browsers actually do...
	var SAFECHARS = "0123456789" +					// Numeric
					"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +	// Alphabetic
					"abcdefghijklmnopqrstuvwxyz" +
					"-_.!~*'()";					// RFC2396 Mark characters
	var HEX = "0123456789ABCDEF";

	var plaintext = encode;
	var encoded = "";

	//encoded = encode;

	for (var i = 0; i < plaintext.length; i++ ) {
		var ch = plaintext.charAt(i);
	    if (ch == " ") {
		    encoded += "+";				// x-www-urlencoded, rather than %20
		} else if (SAFECHARS.indexOf(ch) != -1) {
		    encoded += ch;
		} else {
		    var charCode = ch.charCodeAt(0);
			if (charCode > 255) {
			    alert( "Unicode Character '" 
                        + ch 
                        + "' cannot be encoded using standard URL encoding.\n" +
				          "(URL encoding only supports 8-bit characters.)\n" +
						  "A space (+) will be substituted." );
				encoded += "+";
			} else {
				encoded += "%";
				encoded += HEX.charAt((charCode >> 4) & 0xF);
				encoded += HEX.charAt(charCode & 0xF);
			}
		}
	} // for
	
	//alert(encoded);
	return (encoded);
}
// end javascript function for
// '################################ Task 1184 ################################