var MsiaTimeSeed;

var MsiaTimeString;



// Display Malaysia Time

function displayMsiaTime()

{

	var _suNow = new Date();  //Server's Locale Time

	var _su_timeDiff = -(_suNow.getTimezoneOffset()* 60 * 60);  //Server's GMT

	var _msia_timeDiff = 8 * 60 * 60 * 60;  //Malaysia's GMT

	var _timeDiff = _su_timeDiff - _msia_timeDiff;

	var _msiaTimeSeed = Date.parse(_suNow) + _timeDiff;

	var _msiaNow = new Date(_msiaTimeSeed);	//Malaysia's Locale Time

	

	var _ampm = "am.";

	var monthName = new Array ('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October' ,'November' ,'December');

	var _hour = _msiaNow.getHours();

		if (_hour > 11) {_ampm = 'pm.'; _hour -= 12;}

		if (_hour == 0) {_hour = 12;} 

	if (_msiaNow.getMinutes() < 10) {_pad = ':0';} else {_pad = ':';} 



	var _date = _msiaNow.getDate() + " " + monthName[_msiaNow.getMonth()] + " " + _msiaNow.getFullYear() + ", " + _hour + _pad + _msiaNow.getMinutes() + _ampm;

	var greeting = "<font size=1 color=#999999>" + _date + " (Malaysia Time)</font><br/>";

	document.write(greeting);

	

	MsiaTimeSeed = _msiaTimeSeed;

	MsiaTimeString = _date;

}



//Return Time Seed, (Javascript time seed = php time seed * 1000)

function getMsiaTimeSeed()

{

	return MsiaTimeSeed;

}



//Return String Displayed at displayMsiaTime()

function getMsiaTimeString()

{

	return MsiaTimeString;

}



//Generate jumpList according to currentDirectory and directoryLevel (Root = 0)

function jumpList(_curDir, _dirLevel)

{

	var _rootDir = "";

	

	// In case some pages are in child directory

	/*var _skpDir = "skp/";

	var i;



	if(_curDir != _rootDir)

		for(i=0; i < _dirLevel; i++)

			_rootDir += "../";

			

	if(_curDir == _skpDir)

		_skpDir = "";

	else

		for(i=0; i < _dirLevel; i++)

			_skpDir += "../";*/



	var _list = "<form name=jumpForm method=post class=myform>";

	_list += "<select name=jumpMenu onChange=jumpTo(null)><option value=null>Jump to ..</option>";

	_list += "<option value=" + _rootDir + "index.htm>[Welcome]</option>";

	_list += "<option value=" + _rootDir + "root_product.htm>[Our Products]</option>";

	_list += "<option value=" + _rootDir + "skp_index.htm>[SKP Online]</option>";

	_list += "<option value=" + _rootDir + "skp_background.htm>- [Background]</option>";

	_list += "<option value=" + _rootDir + "skp_factory.htm>- [Factory]</option>";

	_list += "<option value=" + _rootDir + "skp_commitment.htm>- [Commitment]</option>";

	_list += "<option value=" + _rootDir + "skp_investment.htm>- [Investment]</option>";

	_list += "<option value=" + _rootDir + "skp_business_flow.htm>- [Business Flow]</option>";

	_list += "<option value=" + _rootDir + "skp_client.htm>- [Clients]</option>";

	_list += "<option value=" + _rootDir + "profile_skprb.htm>[SKPRB Profiles]</option>";

	_list += "<option value=" + _rootDir + "profile_skprb.htm>- [SKPRB]</option>";

	_list += "<option value=" + _rootDir + "profile_skp.htm>- [SKP]</option>";

	_list += "<option value=" + _rootDir + "profile_skp.htm>- - [Profile]</option>";

	_list += "<option value=" + _rootDir + "profile_skp_award.htm>- - [Awards]</option>";

	_list += "<option value=" + _rootDir + "profile_skp_iso9002.htm>- - [MS ISO 9002]</option>";

	_list += "<option value=" + _rootDir + "profile_skp_product.htm>- - [Products]</option>";

	_list += "<option value=" + _rootDir + "profile_skp_production.htm>- - [24 Hrs Production]</option>";

	_list += "<option value=" + _rootDir + "profile_skp_quality.htm>- - [Quantity Control]</option>";

	_list += "<option value=" + _rootDir + "profile_ghi.htm>- [GHI]</option>";

	_list += "<option value=" + _rootDir + "profile_ghl.htm>- [GHL]</option>";

	_list += "<option value=" + _rootDir + "profile_ght.htm>- [GHT]</option>";

	_list += "<option value=" + _rootDir + "profile_skprb_dir.htm>- [Directors]</option>";

	_list += "<option value=" + _rootDir + "root_contact.htm>[Contact]</option>";

	_list += "<option value=" + _rootDir + "customer_request.htm>[Customer Request]</option></select>";

	_list += "</form>";

	document.write(_list);

}



function jumpTo(page)

{

	if(page == null)

	{

		jumpIndex = document.jumpForm.jumpMenu.selectedIndex;

		jumpPage = document.jumpForm.jumpMenu.options[jumpIndex].value;

		if(jumpPage == 'null')

			return;

		window.location = jumpPage;

	}

	else

		window.location = page;

}

function view_printscreen(_image,_width,_height,_title,_msg)

{

	var msg = "<html><head><title>" + _title + "</title><link rel='stylesheet' href='skinstyle/default/stylesheet.css' type='text/css'></head><body>";

	var msg = msg + "<table width=" + (_width + 30) + " border=1 bordercolor=#eeeeee cellspacing=0 cellpadding=2>";

	//var msg = msg + "<tr><td><p><font class=PAGEHEADERSTYLE>" + _title +"</font><br/></td></tr>";

	var msg = msg + "<tr><td><img src='" + _image + "' width=" + _width + " height=" + _height + "><br/>"

	var msg = msg + "<p><font color=#999999>" + _msg + "</font></p></td></tr></table>";
	
	var msg = msg + "<div align=center><font color=#999999 size=1>" +
				"&copy;Copyright 2004. All right Reserved<br/>SKP Resources Bhd (524297-T)</font></div>";

	var msg = msg + "</body></html>";

	var specification = 'width=' + (_width + 50) + ',height=' + (_height + 80);

	msgWindow = window.open('','',specification);

	msgWindow.document.write(msg);

}