function first_timer_630(){
showpic = window.open('first_timer_630/default.asp','first','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0,leftmargin="0" topmargin="0" marginwidth="0" marginheight="0",width=640,height=450');
showpic.moveTo(1,0)
//showpic.focus( )
  }

function marketing(){
showpic = window.open('/english/marketing/shanghai_plan/detail.asp','marketing','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,copyhistory=0,leftmargin="0" topmargin="0" marginwidth="0" marginheight="0",width=520,height=450');
showpic.moveTo(1,0)
//showpic.focus( )
  }

function ecoupon(){
showpic = window.open('/english/online_game_e-coupon_3/detail.html','xmas','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0,leftmargin="0" topmargin="0" marginwidth="0" marginheight="0",width=728,height=280');
showpic.moveTo(1,0)
//showpic.focus( )
  }

function lateNewsPaper(){
showpic = window.open('/english/notice.html','marketing','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0,width=355,height=275,top=260,left=350');
showpic.moveTo(350,260)
showpic.focus( )
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
  }


function MM_openDelayWindow(theURL,winName,features) { //v2.0
	showpic =  window.open(theURL,winName,features);
	showpic.moveTo(1,0)
	//showpic.focus( )
  }

function openNewWindow(URLtoOpen, windowName, windowFeatures) {
newWindow=window.open(URLtoOpen, windowName, windowFeatures); }

function OpenWin(name,wwidth,wheight) {
	win=window.open(name,"message","scrollbars=no,location=no,memubar=no,directories=no,toolbar=no,width="+wwidth+",height="+wheight+"");
	if (win==null) win.creator=self;
		win.focus();
	}

function OpenWin01(name,wwidth,wheight) {
	win=window.open(name,"message","scrollbars=yes,location=no,memubar=no,directories=no,toolbar=no,width="+wwidth+",height="+wheight+"");
	if (win==null) win.creator=self;
		win.focus();
	}
	
function flip_to(choice)
{
	var box_array = new Array("function","industry");
	
	for(var i=0;i<box_array.length;i++)
	{
		if(box_array[i] == choice)
			document.getElementById("c_box_" + box_array[i]).style.display = "block";
		else
			document.getElementById("c_box_" + box_array[i]).style.display = "none";
	}
	
}

function show_more(choice)
{

	if(document.getElementById("c_box_function_more_value").innerHTML.replace(/<.+?>/gim,'') == "more")
	{
		document.getElementById("c_box_" + choice + "_more").style.display = "block";
		document.getElementById("c_box_" + choice + "_more_value").innerHTML = "less";
	}
	else
	{
		document.getElementById("c_box_" + choice + "_more").style.display = "none";
		document.getElementById("c_box_" + choice + "_more_value").innerHTML = "more";
	}
}

function search_keyword_labels(job_tag)
{	
		
	document.getElementById("job_tag").value = job_tag;	
	//alert (document.getElementById("keyword_labels").value);
	document.keyword_labels_form.submit();
	return true;
	
}



function submitForm_SearchBlock()
{

	var notspace=0;
	var input=document.searchForm_Block.keyword.value;
	if (input.length>0){
		for (i=0;i<input.length;i++){
			if (input.substr(i,1)!=" "){
				notspace++;
			}
		}
	}
	
	
	if(document.searchForm_Block.keyword.value.length == 0 && document.searchForm_Block.job_area.value == 0 &&document.searchForm_Block.industry.value == 0)
	{
		alert("Please enter keyword / Select a function / Select an industry");	
	}
	else if (document.searchForm_Block.job_area.value == 0 && document.searchForm_Block.industry.value == 0 && (notspace<2)){
		alert ("Please enter at least two characters.")
	}
	else{
		document.searchForm_Block.submit();
	}
	
}


function box_disappear(checkbox,showbox,cookie_name)
{
	var ckdoc = document.getElementById(checkbox);

	if(ckdoc.checked == true)
	{
		createCookie(cookie_name,'T', 10 * 365);
	}
		
	document.getElementById(showbox + '_chi').style.display = "none";
	document.getElementById(showbox + '_eng').style.display = "none";
}


function promobox01_changeTo(lang)
{
	if(lang=="Eng")
	{
		document.getElementById('ct_promobox01_showbox_chi').style.display = "none";
		document.getElementById('ct_promobox01_showbox_eng').style.display = "block";
	}
	else if(lang == "Chi")
	{
		document.getElementById('ct_promobox01_showbox_chi').style.display = "block";
		document.getElementById('ct_promobox01_showbox_eng').style.display = "none";
	}
}


function getxmlhttp(){
	var xmlHttp = false;
	if (window.XMLHttpRequest){
	// If IE7, Mozilla, Safari, etc: Use native object
	var xmlHttp = new XMLHttpRequest();
	}else{
	if (window.ActiveXObject){
	// ...otherwise, use the ActiveX control for IE5.x and IE6
	var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	}
	
	return xmlHttp;
}

//function to process an XMLHttpRequest
function process_ajax(phpPage, divID, getOrPost){
	xmlhttp = getxmlhttp();
	var obj = document.getElementById(divID);
	if(getOrPost == "get"){
	xmlhttp.open("GET",phpPage);
	xmlhttp.onreadystatechange = function(){
	if(xmlhttp.readyState == 4 && xmlhttp.status == 200){
	obj.innerHTML = xmlhttp.responseText;
	}
	}
	xmlhttp.send(null);
	}
}
