//-------------------------------------------------
//		JavaScript source for jobnet.cc
//
//		date : 2006/10/19
//		update : 2006/10/19
//		created by Bitworks Inc.
//
//--------------------------------------------------		

//------------------------------------
//   change of menu image 
//
//		mgp :  specified number of relativePath array
//		rootp : 
//		cnum : number of menu items
//		ptype : specified number of imagePath array
//------------------------------------

var currentPos=0;
var relativePath = new Array(5);
relativePath[0]="";
relativePath[1]="../";
relativePath[2]="../../";
relativePath[3]="../../../";
relativePath[4]="../../../../";

var imagePath = new Array(4);
imagePath[0] = ptype;
imagePath[1] = "images/top_menu/";
imagePath[2] = "images/menu/";
imagePath[3] = "business/images/menu/";
imagePath[4] = "images/menu/";
 
var img_pos = relativePath[imgp] + imagePath[ptype];
var gopage_pos = relativePath[imgp];
var root_pos =  relativePath[rootp];

function set_currentPos(n)
{
	currentPos=n;
}

//Menu Buttom Selection release (All)
function clear_btn_select()
{
	for(i=1;i<cnum+1;i++)
	{
		inum = new String(i);
		menu_name = "mbox" + inum;
		image_name = img_pos + "menu" + inum + "Out.gif";
		onImg = new Image();
		onImg.src=image_name;
		document.images[menu_name].src = onImg.src;
	}
}

function onMouse(n)
{
	num = new String(n);
	
	clear_btn_select();	
	
	menu_name = "mbox" + num;
		
	image_name = img_pos + "menu" + num + "On.gif";

	onImg = new Image();
	onImg.src=image_name;
	document.images[menu_name].src = onImg.src;
}

function outMouse()
{
	clear_btn_select();
	
	if(currentPos>0){
		menu_name = "mbox" + currentPos;
		image_name = img_pos + "menu" + currentPos + "On.gif";
		onImg = new Image();
		onImg.src=image_name;
		document.images[menu_name].src = onImg.src;
	}
}

function on_click(lPos)
{

	switch(lPos){
	
// 1-  for toppage
	case 1:
		pName = "deskwork/deskwork.html";
		break;
	case 2:
		pName = "full-timeJob/full-time.html";
		break;	
	case 3:
		pName = "part-timeJob/part-time.html";
		break;
	case 4:
		pName = "telemarketing/telemarketing.html";
		break;
	case 5:
		pName = "service/service.html";
		break;	
	case 6:
		pName = "sales/sales.html";
		break;

// 11-  for staff page		
	case 11:
		pName = "entry/entry.html";
		break;	
	case 12:
		pName = "benefits/benefits.html";
		break;
	case 13:
		pName = "QA/QA.html";
		break;	
	case 14:
		pName = "notes/notes.html";
		break;
	case 15:
		pName = "staff.html";
		break;

// 21-  for business page		
	case 21:
		pName = "edge_over/edgeover.html";
		break;	
	case 22:
		pName = "feature/feature.html";
		break;
	case 23:
		pName = "online_order/onlineorder.html";
		break;	
	case 24:
		pName = "QA/QA.html";
		break;
	case 25:
		pName = "business.html";
		break;	

// 31-  for profile page		
	case 31:
		pName = "philosophy/philosophy.html";
		break;	
	case 32:
		pName = "overview/overview.html";
		break;
	case 33:
		pName = "map/map.html";
		break;	
	case 34:
		pName = "profile.html";
		break;
										
	default:
		pName = "index.html";
		break;
	}
		
	//path_name = goTop_pos + pName;
	//alert(pName);

	if(ptype == 3 || ptype == 4){
		//path_name = gopage_pos + "business/" + pName;
		path_name = "http://jobnet.cc/business/" + pName;
	}
	else{
		path_name = gopage_pos + pName;
	}

	if(lPos == 23)
	{
		path_name = "https://jobnet.cc/business/online_order/onlineorder.html";
	}

	location.href = path_name;

}

//------------------------------------
//   topics summary's page window open
//------------------------------------
function newWindow(openURL){
	window.open(openURL,"_blank" , "width=620,height=600,scrollbars=yes,resizable=yes");
}


//------------------------------------
//   manual page open
//------------------------------------
function manual_onClick(pnum)
{

	var hName ="";
	var url_name="";
	var root_pos = relativePath[imgp];
	
	path_name = root_pos + "manual/";
	
	switch(pnum){
	case 1:
		hName = "kiyaku.html";
		break;

	case 2:
		hName = "hyouki.html";
		break;
			
	default:
		hName = "manual.html";
		break;
	}		
	
	url_name = path_name + hName;
	window.open(url_name,"_blank" , "width=620,height=600,scrollbars=yes,resizable=yes");
}

//------------------------------------
//   manual page onMouse
//------------------------------------
function manual_onMouse(pnum)
{

	id_name = "txt" + pnum;
	document.getElementById(id_name).style.color = "#655DB6";
	//document.all(id_name).style.color = "#655DB6";
}

//------------------------------------
//   manual page outMouse
//------------------------------------
function manual_outMouse(pnum)
{

	id_name = "txt" + pnum;
	document.getElementById(id_name).style.color = "#303030";
	//document.all(id_name).style.color = "#655DB6";
}

//------------------------------
//  back button
//----------------------------------
function pageBack(n){
	if(n == 0)
		history.back();
	else if(n ==1)
		location.href = "http://www.jobnet.cc";
}

//------------------------------
//  pdf button
//----------------------------------
function pdfOnMouse(n)
{
	num = new String(n);	
	
	menu_name = "pdfbox" + num;
		
	image_name = "images/pdf" + num + "On.gif";

	onImg = new Image();
	onImg.src=image_name;
	document.images[menu_name].src = onImg.src;
}

function pdfOutMouse(n)
{

	num = new String(n);
	menu_name = "pdfbox" + num;
		
	image_name = "images/pdf" + num + "Out.gif";

	outImg = new Image();
	outImg.src=image_name;
	document.images[menu_name].src = outImg.src;
}

function pdfOn_click(lPos)
{
	switch(lPos){
	case 1:
		pName = "xxx.pdf";
		break;

	case 2:
		pName = "xxx.pdf";
		break;
		

	default:
		pName = "";
		break;
	}
		
	window.open(pName);


}
