////////////////////////////////////////////////////////
//////////////////////////// JOB VACANCY CLASS + LIST of JOB
//////////////////////////// created on 09/Jun/2005
///////////////////////////////////////////////////////





JobClass = function ( jtitle, jdivision, jresponsibilities, jrequirements,
				 jlocation, javailability, jexpire, jkeyword){
	
	this.position = jtitle; //1 

	if ( jdivision=='--' || jdivision=='' ){
		this.division = 'n/s';
	}else this.division = jdivision; //2 

//--this.role =--= Job responsibilities 
	var jobRole = DataExtract( jresponsibilities, '?', '?', 'theJobRole' ); 

	var jobRoleArry = new Array();
	jobRoleArry[0] = theJobRole; //default value contant all 
	
	for ( jb = 1; jb < jobRole; jb++ ){
		jobRoleArry[jb] = theJobRole[jb];
	}

	this.role = eval( jobRoleArry ); //3
//--this.role 

//--this.require =--= Job requirements
	var jobReq = DataExtract( jrequirements, '?', '?', 'theJobReq' ); 

	var jobReqArry = new Array();
	jobReqArry[0] = theJobReq; //default value contant all 
	
	for ( jb = 1; jb < jobReq; jb++ ){
		jobReqArry[jb] = theJobReq[jb];
	}
	
	this.require = eval( jobReqArry );	//4 [10]
//--this.require

	this.location = jlocation; //5
	
	var contactHR = new contactHrClass( this.location );
	this.contact = contactHR;
	
	var available = new yesNoBoolClass( javailability.toLowerCase() );
	this.deadline = jexpire; //6
	this.status = available; //7
	
	this.keyword = jkeyword; //8

};

contactHrClass = function ( location ){
	var branchLocate = new Array();
	branchLocate[0] = "penang";
	branchLocate[1] = "ipoh";
	branchLocate[2] = "petaling jaya";
	
	var branchContactEmail = new Array();
	branchContactEmail[0] = "hr@pensonic.com";
	branchContactEmail[1] = "hr@pensonic.com";
	branchContactEmail[2] = "hr@pensonic.com";
	
	var branchContactPerson = new Array();
	branchContactPerson[0] = "Irene";
	branchContactPerson[1] = "Irene";
	branchContactPerson[2] = "Irene";
	
	brnLocLen = branchLocate.length;
	for ( br=0; br<brnLocLen; br++ ){
		if ( location.toLowerCase()==branchLocate[br] ){
			this.email = branchContactEmail[br];
			this.person = branchContactPerson[br];
		}
	}
}

yesNoBoolClass = function ( param1 ) {
	if ( param1 == '' ) { alert("Please input the job status."); }
	if ( param1 == 'y' ) { 
		this.yn = "Yes"; 
		this.bool = true;
	}
	if ( param1 == 'n' ) {
		this.yn = "No"; 
		this.bool = false;
	}
}


var jRecruit_list = "^";

jRecruit_list += "Marketing Trainee^Marketing dept.^ " +
	"?--?^" + 
	"?Degree / Diploma holder in Marketing?Business Administration or equivalent?Good Communication skills?1-2 years of marketing experience, Those with exposure in marketing and sales of home appliances are strongly encouraged to apply?Self driven and ability to work independently?Fresh graduate are encourgae to apply?^" + 
	"PJ^Y^--^?--?^@^";
	
jRecruit_list += "General Clerk^--^ " +
	"?--?^" + 
	"?SPM or equivalent?Computer literate?Able to communicate in Mandarin, English and Bahasa Malaysia?Those with experience will have an advantage?^" + 
	"PJ^Y^--^?--?^@^";

jRecruit_list += "Promoters^--^ " +
	"?--?^" +
	"?SPM and above?Ability to speak English, Bahasa and Chinese dialects?To promote Pensonic products at shopping mall / assigned locations?Able to travel?Fresh school leavers are encouraged to apply?^" + 
	"Penang / PJ / KL^Y^--^?--?^@^";
	
jRecruit_list += "Graphic Designer/DTP Artist^Marketing dept.^ " +
	"?--?^" +
	"?Diploma / Degree or equivalent to graphic designing?Willing to travel and posses own transport?Computer literate & familiar with Illustrator, Photoshop, Macromedia Freehand?Initiative, independent and able to work under minimum supervision?Able to communicate in English, Bahasa and Mandarin?Creative, self motivated, enthusiastic and posses an outgoing personality?Good communicate and interpesonal skills?Minimum of 1 year experience will be an added advantage?Fresh graduates are encouraged to apply?^" + 
	"PJ^Y^--^?--?^@^";

jRecruit_list += "Web Designer^Marketing dept.^ " +
	"?--?^" +
	"?Proficiency in web graphic design /Photoshop, Dreamweaver, Flash, Advantages - Pagemaker, Illustrator, Director, Flash and any 3D Software /  A good eye for layout, design and user-interface / i Familiar with HTML, Javascript, CSS will be added advantages / Multimedia (Macromedia Director, Flash, streaming audio and video)?Able to produce highly impressive creative web design in a timely manner?Customer oriented with excellent communication skills in English and Bahasa Malaysia. Knowledge in Mandarin would be added advantage?Preferably junior executives specializing in IT / Computer - software or equivalent?^" + 
	"Penang^Y^--^?--?^@^";

jRecruit_list += "Copywriter^--^ " +
	"?--?^" +
	"?Degree / Post Graduate Diploma in English language / Mass Communication / Advertising or equivalent?Minimum 2 years relevant experience in an advertising or publishing environment?Computer literate with flair in handling desktop publishing software and able to work independently?Ability to conceptualize ideas and turn them into creative copy?Excellent writing skill in English is a MUST. Strong command in Mandarin and Bahasa Malaysia will be an added advantage?^" +
	"Penang^Y^--^?--?^@^";
	
jRecruit_list += "Engineering Technician^--^ " +
	"?--?^" +
	"?Diploma holder in Mechanical Engineering or any related field?With or without experience?Computer literate?Posses excellent communication, interpersonal and strong analytical skills?Posses leadership quality and able to work independently?Preferably with good knowledge in home appliances manufacturing?^" +
	"Penang^Y^--^?--?^@^";	

//Extraction of string variable to a total BIG array
var theJobList = jRecruit_list;
var jobDataEk = DataExtract( theJobList,'^','^', "theJobDbArray" ); //get the total number of array
var theStep = 9;

//Division process
var theJobClass = new Array();
var theJobArray = new Array();
var nexArr = 0;

//storing the whole list into memory
for ( ii=1; ii<jobDataEk; ii+=theStep ){
	if ( ii%theStep ){ nexArr++ }
	theJobClass[nexArr] = new JobClass( theJobDbArray[ii], theJobDbArray[ii+1], theJobDbArray[ii+2], theJobDbArray[ii+3], theJobDbArray[ii+4],
	theJobDbArray[ii+5], theJobDbArray[ii+6], theJobDbArray[ii+7], theJobDbArray[ii+8]
	);
	
	theJobArray[nexArr] = new Array( theJobDbArray[ii], theJobDbArray[ii+1], theJobDbArray[ii+2], theJobDbArray[ii+3], theJobDbArray[ii+4],
	theJobDbArray[ii+5], theJobDbArray[ii+6], theJobDbArray[ii+7], theJobDbArray[ii+8]
	);
}


//-------------------------------------------------------------------------------------------------------------------
//List all for checking
//-------------------------------------------------------------------------------------------------------------------
/*
var theDesTitle = new Array ();
for(i=0;i<theStep;i++){
	theDesTitle[i] = i+1;
}

theDocumentWrt="";
theDocumentWrt += "<table border=1 cellpadding=0 cellspacing=0 class=grey999-normal-10>";

//list out title
for (g=0;g<theJobArray[1].length;g++){
	if (g==0) { theDocumentWrt+="<tr>" };
	if (theDesTitle[g]== null){ theDesTitle[g]=' . '; }
	theDocumentWrt += "<td>" + theDesTitle[g] + "</td>";
	if (g==theJobArray[1].length-1) { theDocumentWrt+="</tr>" };
}

//list out the all 
for (j=1;j<theJobArray.length;j++){
	theDocumentWrt += "<tr>";
	for (k=0;k<theJobArray[j].length;k++){
		theDocumentWrt += "<td>" + theJobArray[j][k] + "</td>";
	}
	theDocumentWrt += "</tr>";
} 

theDocumentWrt += "</table>";

document.write('<br><br><br><br><br><br>');
document.write(theDocumentWrt);
*/