////////////////////////////////////////////////////////
//////////////////////////// SELECTOR SCRIPT
//////////////////////////// created on 09/Jun/2005
///////////////////////////////////////////////////////





var paImgRoot = "images/pabout/";
var the_plt_img = new Array('plt-ce14', 'plt-cf15');


//Company Profile
function ps01_00_fn( the_id1, the_id2, the_id3 ){
	var theImage = new Array( paImgRoot+the_plt_img[0]+'00'+'.png', paImgRoot+the_plt_img[1]+'00'+'.png' );
	var d_titletreeID = the_id1;
	var d_visualID = the_id2;
	var d_contentID = the_id3;

	document.getElementById( d_titletreeID ).innerHTML = "<img src=\""   +theImage[0]+   "\" width=540 height=77>";
	document.getElementById( d_visualID ).innerHTML = "<img src=\""   +theImage[1]+   "\" width=540 height=226>";
	document.getElementById( d_contentID ).innerHTML = contentHtm[0];
}

//Concept
function ps01_01_fn( the_id1, the_id2, the_id3 ){
	var d_titletreeID = the_id1.id;
	var d_visualID = the_id2.id;
	var d_contentID = the_id3.id;
	var theImage = new Array( paImgRoot+the_plt_img[0]+'01'+'.png', paImgRoot+the_plt_img[1]+'01'+'.png' );

	document.getElementById( d_titletreeID ).innerHTML = "<img src=\""   +theImage[0]+   "\" width=540 height=77>";
	document.getElementById( d_visualID ).innerHTML = "<img src=\""   +theImage[1]+   "\" width=540 height=226>";
	document.getElementById( d_contentID ).innerHTML =contentHtm[1];
	
}
//
//Mission
function ps01_02_fn( the_id1, the_id2, the_id3 ){
	var d_titletreeID = the_id1.id;
	var d_visualID = the_id2.id;
	var d_contentID = the_id3.id;
	var theImage = new Array( paImgRoot+the_plt_img[0]+'02'+'.png', paImgRoot+the_plt_img[1]+'02'+'.png' );

	document.getElementById( d_titletreeID ).innerHTML = "<img src=\""   +theImage[0]+   "\" width=540 height=77>";
	document.getElementById( d_visualID ).innerHTML = "<img src=\""   +theImage[1]+   "\" width=540 height=226>";
	document.getElementById( d_contentID ).innerHTML =contentHtm[2];
	
}
//
//History
function ps01_03_fn( the_id1, the_id2, the_id3 ){
	var d_titletreeID = the_id1.id;
	var d_visualID = the_id2.id;
	var d_contentID = the_id3.id;
	var theImage = new Array( paImgRoot+the_plt_img[0]+'03'+'.png', paImgRoot+the_plt_img[1]+'03'+'.jpg' );

	document.getElementById( d_titletreeID ).innerHTML = "<img src=\""   +theImage[0]+   "\" width=540 height=77>";
	document.getElementById( d_visualID ).innerHTML = "<img src=\""   +theImage[1]+   "\" width=540 height=226>";
	document.getElementById( d_contentID ).innerHTML =contentHtm[3];

}
//
//Vision
function ps01_04_fn( the_id1, the_id2, the_id3 ){
	var d_titletreeID = the_id1.id;
	var d_visualID = the_id2.id;
	var d_contentID = the_id3.id;
	var theImage = new Array( paImgRoot+the_plt_img[0]+'04'+'.png', paImgRoot+the_plt_img[1]+'04'+'.png' );

	document.getElementById( d_titletreeID ).innerHTML = "<img src=\""   +theImage[0]+   "\" width=540 height=77>";
	document.getElementById( d_visualID ).innerHTML = "<img src=\""   +theImage[1]+   "\" width=540 height=226>";
	document.getElementById( d_contentID ).innerHTML =contentHtm[4];

}
//
//R&D
function ps01_05_fn( the_id1, the_id2, the_id3 ){
	var d_titletreeID = the_id1.id;
	var d_visualID = the_id2.id;
	var d_contentID = the_id3.id;
	var theImage = new Array( paImgRoot+the_plt_img[0]+'05'+'.png', paImgRoot+the_plt_img[1]+'05'+'.jpg' );

	document.getElementById( d_titletreeID ).innerHTML = "<img src=\""   +theImage[0]+   "\" width=540 height=77>";
	document.getElementById( d_visualID ).innerHTML = "<img src=\""   +theImage[1]+   "\" width=540 height=226>";
	document.getElementById( d_contentID ).innerHTML = contentHtm[5];

}
//
//Vacancy
function ps01_06_fn( the_id1, the_id2, the_id3 ){
	var d_titletreeID = the_id1.id;
	var d_visualID = the_id2.id;
	var d_contentID = the_id3.id;
	var theImage = new Array( paImgRoot+the_plt_img[0]+'06'+'.png', paImgRoot+the_plt_img[1]+'06'+'.jpg' );

	document.getElementById( d_titletreeID ).innerHTML = "<img src=\""   +theImage[0]+   "\" width=540 height=77>";
	document.getElementById( d_visualID ).innerHTML = "<img src=\""   +theImage[1]+   "\" width=540 height=226>";
	document.getElementById( d_contentID ).innerHTML = pVacancyHtm();
	
}
//

function pVacancyHtm(){

	theCareers = eval( theJobClass );
	theCareersLength = theCareers.length;

	var theHtm = new Array();
	theHtm[0] = "<table width=540 border=0 cellpadding=0 cellspacing=0>";
	
	theHtm[1] = '';
	theHtm[1] += "<tr>";
	theHtm[1] += "<td width=150 height=20 bgcolor=\"#bb0000\"><span class=\"white-normal-11\" style=\"margin:8px; font-weight:bold; \">Careers</span></td>";
	theHtm[1] += "<td width=2 height=20 bgcolor=\"#ffffff\"></td>";
	theHtm[1] += "<td width=120 bgcolor=\"#bb0000\"><span class=\"white-normal-11\" style=\"margin:0px 8px 0px 8px; font-weight:bold; \">Division</span></td>";
	theHtm[1] += "<td width=2 height=20 bgcolor=\"#ffffff\"></td>";
	theHtm[1] += "<td width=80 bgcolor=\"#bb0000\"><span class=\"white-normal-11\" style=\"margin:0px 8px 0px 8px; font-weight:bold; \">Location</span></td>";
	theHtm[1] += "<td width=2 height=20 bgcolor=\"#ffffff\"></td>";
	theHtm[1] += "<td width=50 bgcolor=\"#bb0000\"><span class=\"white-normal-11\" style=\"margin:0px 8px 0px 8px; font-weight:bold; \">Status</span></td>";
	theHtm[1] += "<td width=2 height=20 bgcolor=\"#ffffff\"></td>";
	theHtm[1] += "<td width=132 bgcolor=\"#bb0000\"><span class=\"white-normal-11\" style=\"margin:0px 8px 0px 8px; font-weight:bold; \">Contact Person</span></td>";
	theHtm[1] += "</tr>";
	
	for ( jo=1; jo<theCareersLength; jo++ ){
		if ( theCareers[jo].status.bool ){
			if ( !theHtm[2] ) theHtm[2] = '';
			theHtm[2] += "<tr onMouseOver=\"this.style.background='#ffeeee';\" onMouseOut=\"this.style.background='';\" onClick=\"displayJobDetails(theCareers["+jo+"]);\" style=\"cursor:pointer; \">";
			theHtm[2] += "<td width=150 height=20><p class=\"redc00-normal-11\" style=\"margin:5px 8px 5px 8px; \"><b>" + theCareers[jo].position.toUpperCase() + "</b></p></td>";
			theHtm[2] += "<td width=2></td>";
			theHtm[2] += "<td width=120><p class=\"redc00-normal-11\" style=\"margin:5px 8px 5px 8px; \">"+ theCareers[jo].division +"</p></td>";
			theHtm[2] += "<td width=2></td>";
			theHtm[2] += "<td width=80><p class=\"redc00-normal-11\" style=\"margin:5px 8px 5px 8px; \">"+ theCareers[jo].location +"</p></td>";
			theHtm[2] += "<td width=2></td>";
			theHtm[2] += "<td width=50><p class=\"redc00-normal-11\" style=\"margin:5px 8px 5px 8px; \">"+ theCareers[jo].status.yn +"</p></td>";
			theHtm[2] += "<td width=2></td>";
			theHtm[2] += "<td width=132><p class=\"redc00-normal-11\" style=\"margin:5px 8px 5px 8px; \">"+ theCareers[jo].contact.person +"</p></td>";
			theHtm[2] += "</tr>";
			
			theHtm[2] += "<tr><td colspan=9 height=1 bgcolor=#cc9999></td></tr>";
			//alert(theHtm[2]);
		}
	}
	
	theHtm[3] = "<tr><td colspan=9 height=60>";
	theHtm[3] += "<p class=\"grey666-normal-10\" style=\"margin:5px 0px 0px; 0px;\">";
	theHtm[3] += "<ul class=\"grey666-normal-10\" style=\"list-style-image: url(images/pabout/symbol-cross.png)\">";
	theHtm[3] += "<li>For all position, please write in or email with detailed resume together with a recent passport- size photo (n.r) stating current & expected salary.</li>";
	theHtm[3] += "<li>* n/s = not stated</li>";
	theHtm[3] += "</ul></p>";
	theHtm[3] += "</td></tr>";
	
	theHtm[4] = "</table>"
	
	theReturnHtm = theHtm[0]+theHtm[1]+theHtm[2]+theHtm[3]+theHtm[4];

	
	return theReturnHtm;
}

function displayJobDetails ( oJobClass ) {
	
	var htmlCode = '';
	var title = oJobClass.position;
	var w = 400;
	var h = 500;

	htmlCode += "<html><head><title>" + title;
	htmlCode += "</title><link rel=stylesheet href=\'http://www.pensonic.com/style.css\'></link></head>";
	htmlCode += "<script language=javascript>function winClose(){ if ( window.navigator.appName=='Microsoft Internet Explorer' ){ window.focus(); }else { window.close(); } }<\/script>";
	htmlCode += "<body leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0 bgcolor=\'#ffffff\' ";
	htmlCode += " onBlur=\"winClose();\" >";
	htmlCode += "<table cellpading=0 cellspacing=0 border=0 align=center width=350 height=450 >";
	
	htmlCode += "<tr><td height=40><span class=\"redc33-bo-20\" ></span></td></tr>";
	htmlCode += "<tr><td height=40><span class=\"redc33-bo-20\" >"+ oJobClass.position +"</span></td></tr>";
	htmlCode += "<tr><td height=1 bgcolor=\"#cc6666\"></td></tr>";
	htmlCode += "<tr><td height=369 valign=top>";
	
	htmlCode += "<p class=\"redc00-normal-11\" style=\"margin:10px 0px 0px 0px\">";
	htmlCode += "Contact Person : <b>"+ oJobClass.contact.person ;
	htmlCode += ", [ <a href='mailto:"+oJobClass.contact.email+"'>" + oJobClass.contact.email + "</a> ] </b>";
	htmlCode += "</p>";

	htmlCode += "<p class=\"redc00-normal-11\">";
	htmlCode += "Location : <b>"+ oJobClass.location + "</b>";
	htmlCode += "</p>";
	
	htmlCode += "<p class=\"redc00-normal-11\">What you need to have : ";
	//jobReqLen
	htmlCode += "<br><ul class=\"grey333-normal-11\">";
		var jobReqLen = oJobClass.require.length;
		//alert(jobReqLen);
	for ( oj=1; oj<jobReqLen; oj++ ){
		htmlCode += "<li>";
		htmlCode += oJobClass.require[oj];
		htmlCode += "</li>";
	}
	htmlCode += "</ul>";
	htmlCode += "</p>";
//
//jobRolLen
	htmlCode += "<p class=\"redc00-normal-11\">What you do : ";
	htmlCode += "<br><ul class=\"grey333-normal-11\">";
	var jobRolLen = oJobClass.role.length;
//alert(jobRolLen);
	for ( ol=1; ol<jobRolLen; ol++ ){
		htmlCode += "<li>";
		htmlCode += oJobClass.role[ol];
		htmlCode += "</li>";
	}
	htmlCode += "</ul>";
	htmlCode += "</p>";
//
	htmlCode += "</td></tr>";
//- For all position, please write in or email with detailed resume together with a recent passport- size photo (n.r)
//stating current & expected salary.
//- Recruitment list updated on 21st of March, year 2005 (last update 9/Mac/2005)
//- * n/s = not stated
	htmlCode += "<tr><td><a class=\"redc33-normal-11-hu\" href=\"javascript://\" onClick=\"window.close();\" style=\"text-decoration:none;\"><b>[x]</b> close window</a></td></tr>";
	htmlCode += "<tr><td height=1 bgcolor=#cc6666></td></tr>";
	htmlCode += "<tr><td height=20></td></tr>";
	htmlCode += "</table></body></html>";

	createWindow( 'width='+w+',height='+h+',scrollbars=1', htmlCode );
};