// JavaScript Document\
<!--
	
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

MM_reloadPage(true);

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function writeflash(file, width, height){
	document.write   ("<object classid=\'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\' codebase=\'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\' width=\'" + width + "\' height=\'" + height +  "\' align=\'top\'>")
	document.write ("<param name=\'movie\' value=\'" + file +"\'>")
	document.write ("<param name=\'quality\' value=\'high\'>")
	document.write     ("<param name=\'menu\' value=\'false\'>")
	document.write ("<param name=\'scale\' value=\'noscale\'>")
	document.write ("<param name=\'wmode\' value=\'transparent\'>")
	document.write  ("<embed src=\'" + file  + "\' quality=\'high\' pluginspage=\'http://www.macromedia.com/go/getflashplayer\' wmode=\'transparent\' type=\'application/x-shockwave-flash\' width=\'" + width +"\' height=\'" + height + "\'></embed>")
	document.write  ("</object>")
}

function writemenu(file){
	document.write ("<div id=\'Layer1\' style=\'position:absolute; z-index:1; visibility: visible;\'>")
	document.write ("<object classid=\'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\' codebase=\'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\' width=\'198\' height=\'295\' align=\'middle\' name=\'movie\' id=\'movie\' >")
	document.write ("<param name=\'allowScriptAccess\' value=\'sameDomain\' />")
	document.write ("<param name=\'movie\' value=\'" + file +"\' />")
	document.write ("<param name=\'menu\' value=\'false\' />")
	document.write ("<param name=\'quality\' value=\'high\' />")
	document.write ("<param name=\'scale\' value=\'noscale\' />")
	document.write ("<param name=\'salign\' value=\'lt\' />")
	document.write ("<param name=\'wmode\' value=\'transparent\' />")
	document.write ("<param name=\'bgcolor\' value=\'#ffffff\' />")
	document.write ("<embed src=\'" + file + "\' quality=\'high\' scale=\'noscale\' salign=\'lt\' wmode=\'transparent\' bgcolor=\'#ffffff\' width=\'198\' height=\'295\' align=\'middle\' allowscriptaccess=\'sameDomain\' type=\'application/x-shockwave-flash\' pluginspage=\'http://www.macromedia.com/go/getflashplayer\' name=\'movie\' />")                  
	document.write ("</object>")
	document.write ("</div>")
}

function openmenu(){
movie.width = 600
movie.height = 900
}

function closemenu(){
movie.width = 198
movie.height = 295
}

function getinput()
{
		if (parent.location.href.indexOf("_html") < 0 && parent.location.href.indexOf("_text") < 0)
		{
			document.search.Keyword.focus()
		}
		else
		{
			document.search.Keyword.focus()
		}
}

function printdoc(){
//link to text version and print
//
		len = parent.location.href.length -1
		temp = parent.location.href.substring(parent.location.href.lastIndexOf("/")+1)
		docname =temp.substring(0, temp.length)
		dir = parent.location.href.substring(0, parent.location.href.lastIndexOf("_html")+1)
		gopage = dir + "text/" + docname
		popwin = window.open(gopage, "popwin")
		popwin.print()
}

function printdoc(dir){
//link to text version and print
//
		if (parent.location.href.indexOf("_html") < 0 && parent.location.href.indexOf("_text") < 0)
		{
			printdoc1()
		}
		else
		{
			len = parent.location.href.length -1
			temp = parent.location.href.substring(parent.location.href.lastIndexOf("/")+1)
			docname =temp.substring(0, temp.length)
			dir = parent.location.href.substring(0, parent.location.href.lastIndexOf("/")- 4)
			gopage = dir + "text/" + docname
			popwin = window.open(gopage, "popwin")
			popwin.print()
		}
}

function printdoc1()
{
//link to text version and print
//
		gopage = changetext("text")
		popwin = window.open(gopage, "popwin")
		popwin.print()
}

function printonly()
{
//link to text version and print
//
		window.print();
}

function changelang(lang, folder)
{
	if (parent.location.href.indexOf("_html") == -1 && parent.location.href.indexOf("_text") == -1)
	{
		changelang1(lang, folder)
	}
	else
	{
		var strParameter = getParameter(lang, folder); 

		lang = lang + "_"
		if (folder == "html"){
		folder = lang + "html"
		}
		if (folder == "text"){
		folder = lang + "text"
		}
		if (parent.location.href.lastIndexOf("#")+1 == parent.location.href.length ){
			len = parent.location.href.length -1
			temp = parent.location.href.substring(parent.location.href.lastIndexOf("/")+1)
			docname =temp.substring(0, temp.length -1)
		}else{
			docname = parent.location.href.substring(parent.location.href.lastIndexOf("/")+1)
		}
		var aryURL = docname.split("?");
		//alert(aryURL.length + "=" + aryURL[0]);
		//if(aryURL.length > 0)
        docname = aryURL[0];

		dir = parent.location.href.substring(0, parent.location.href.lastIndexOf("/")+1)
		newloc =  dir +  "../" + folder + "/"+lang + docname.substring(docname.indexOf("_")+1)
		if(strParameter!="")
			newloc = newloc + "?" + strParameter;

		document.location.href = newloc
	}
}

function getParameter(strLang, folder)
{
  var aryURL = self.location.href.split("?");
  var strResult = "";

  if(aryURL.length > 1)
  {
	  var aryPath = aryURL[1].split("&");

	  for (var i=0; i<aryPath.length; i++)
	  {
		if(aryPath[i].indexOf("lan=")!=-1)
		{
		  strResult = strResult + "lan=" + strLang + "&";
		}
		else if(aryPath[i].indexOf("mode=")!=-1)
		{
		  //strResult = strResult + "mode=" + folder + "&";
		}
		else
		{
		  strResult = strResult + aryPath[i] + "&";
		}
	  }
  }
  if(strResult != "")
    strResult = strResult + "mode=" + folder + "&";

  if(strResult != "")
	strResult = strResult.substring(0, strResult.length -1);

  return strResult;
}

function changelang1(strLang, strFolder)
{
		var strDirectory = ""
		var strFile = ""
		var strLocation = parent.location.href
		var nLangPos = parent.location.href.lastIndexOf("lan=")
		var nLangPos1 = 0
		if (nLangPos > 0)
		{
			nLangPos1 = parent.location.href.indexOf("&", nLangPos)
			strDirectory = parent.location.href.substring(0, nLangPos)
			if (nLangPos1 > 0)
			{
					strFile = parent.location.href.substring(nLangPos1)
					strLocation = strDirectory + "lan=" + strLang + strFile
			}
			else
			{
					strLocation = strDirectory + "lan=" + strLang
			}
		}
		else
		{
				if (parent.location.href.indexOf("?") > 0)
				{
					strLocation = parent.location.href + "&lan=" + strLang
				}
				else
				{
					strLocation = parent.location.href + "?lan=" + strLang
				}
		}

		nLangPos = strLocation.indexOf("mode=" + strFolder)

		if (nLangPos == -1)
		{
			nLangPos = strLocation.indexOf("mode=")
			if (nLangPos == -1)
			{
				strLocation = strLocation + "&mode=" + strFolder;
			}
			else
			{
				if (strFolder == "text")
				{
					strLocation = strLocation.substring(0, nLangPos) + "mode=text" + strLocation.substring(nLangPos + 9);
				}
				else
				{
					strLocation = strLocation.substring(0, nLangPos) + "mode=html" + strLocation.substring(nLangPos + 9);
				}
			}
		}

		document.location.href = strLocation
}

function changetext(strFolder)
{
		var strLocation = parent.location.href
		var nLangPos = parent.location.href.lastIndexOf("mode=" + strFolder)
		var nLangPos1 = 0

		if (nLangPos == -1)
		{
			nLangPos = strLocation.indexOf("mode=")
			if(strLocation.indexOf("?") == -1)
			{
				strLocation = strLocation + "?";
			}

			if (nLangPos == -1)
			{
				strLocation = strLocation + "&mode=" + strFolder;
			}
			else
			{
				if (strFolder == "text")
				{
					strLocation = strLocation.substring(0, nLangPos) + "mode=text" + strLocation.substring(nLangPos + 9);
				}
				else
				{
					strLocation = strLocation.substring(0, nLangPos) + "mode=html" + strLocation.substring(nLangPos + 9);
				}
			}
		}

		return strLocation;
}

function checkEnquiryen(objForm){
  var i=0, strMessage="", strDate="", strError="";
  var interestValid=false, visitValid=false, bookingValid=false, businessValid=false;
  var aryDate=""

  for(i=0; i<objForm.length; i++){
    if(objForm[i].type == 'checkbox'  && objForm[i].name.indexOf("interest_")!=-1){
	  if(objForm[i].checked)
		interestValid = true;
	}else if(objForm[i].type == 'checkbox'  && objForm[i].name.indexOf("visit_")!=-1){
	  if(objForm[i].checked)
		visitValid = true;	
	}else if(objForm[i].type == 'checkbox'  && objForm[i].name.indexOf("booking_")!=-1){
	  if(objForm[i].checked)
		bookingValid = true;	
	}else if(objForm[i].type == 'checkbox'  && objForm[i].name.indexOf("business_")!=-1){
	  if(objForm[i].checked)
		businessValid = true;	
	}
  }

  if(objForm.title.value=="")
	strMessage = strMessage + "Please select your title!\n";
  if(objForm.name.value=="")
	strMessage = strMessage + "Please input your name!\n";
  if(objForm.jobTitle.value=="")
	strMessage = strMessage + "Please input your job title!\n";
  if(objForm.companyName.value=="")
	strMessage = strMessage + "Please input your company name!\n";
  if(objForm.source.value=="")
	strMessage = strMessage + "Please input from what source did you learn about HKSTP!\n";
//  if(objForm.mobile.value=="")
//	strMessage = strMessage + "Please input your mobile!\n";
  if(objForm.telephone.value=="")
	strMessage = strMessage + "Please input your telephone!\n";
  if(objForm.email.value=="")
	strMessage = strMessage + "Please input your email!\n";
  //if(objForm.fax.value=="")
//	strMessage = strMessage + "Please input your fax!\n";

  if(interestValid == false)
	strMessage = strMessage + "Please select interested information!\n";
  //if(visitValid == false)
//	strMessage = strMessage + "Please select Visit location!\n";
  //if(bookingValid == false)
//	strMessage = strMessage + "Please select Venue !\n";
  if(businessValid == false)
	strMessage = strMessage + "Please select Nature of Business!\n";
	
  if(strMessage==""){
	return true;
  }
  else{
    alert(strMessage);
	return false;
  }	

}

function checkEnquiryb5(objForm){
  var i=0, strMessage="", strDate="", strError="";
  var interestValid=false, visitValid=false, bookingValid=false, businessValid=false;
  var aryDate=""

  for(i=0; i<objForm.length; i++){
    if(objForm[i].type == 'checkbox'  && objForm[i].name.indexOf("interest_")!=-1){
	  if(objForm[i].checked)
		interestValid = true;
	}else if(objForm[i].type == 'checkbox'  && objForm[i].name.indexOf("visit_")!=-1){
	  if(objForm[i].checked)
		visitValid = true;	
	}else if(objForm[i].type == 'checkbox'  && objForm[i].name.indexOf("booking_")!=-1){
	  if(objForm[i].checked)
		bookingValid = true;	
	}else if(objForm[i].type == 'checkbox'  && objForm[i].name.indexOf("business_")!=-1){
	  if(objForm[i].checked)
		businessValid = true;	
	}
  }

  if(objForm.title.value=="")
	strMessage = strMessage + "請選擇你的稱呼!\n";
  if(objForm.name.value=="")
	strMessage = strMessage + "請輸入您的姓名!\n";
  if(objForm.jobTitle.value=="")
	strMessage = strMessage + "請輸入您的職稱!\n";
  if(objForm.companyName.value=="")
	strMessage = strMessage + "請輸入您的公司名稱!\n";
  if(objForm.source.value=="")
	strMessage = strMessage + "請輸入您從何認識香港科技園!\n";
//  if(objForm.mobile.value=="")
//	strMessage = strMessage + "請輸入您的mobile!\n";
  if(objForm.telephone.value=="")
	strMessage = strMessage + "請輸入您的辦公室電話!\n";
  if(objForm.email.value=="")
	strMessage = strMessage + "請輸入您的電郵!\n";
  //if(objForm.fax.value=="")
//	strMessage = strMessage + "請輸入您的傳真!\n";

  if(interestValid == false)
	strMessage = strMessage + "請選擇您想多了解的服務!\n";
  //if(visitValid == false)
//	strMessage = strMessage + "請選擇Visit location!\n";
  //if(bookingValid == false)
//	strMessage = strMessage + "請選擇Venue !\n";
  if(businessValid == false)
	strMessage = strMessage + "請選擇您所屬行業!\n";
	
  if(strMessage==""){
	return true;
  }
  else{
    alert(strMessage);
	return false;
  }	

}

function checkEnquirygb(objForm){
  var i=0, strMessage="", strDate="", strError="";
  var interestValid=false, visitValid=false, bookingValid=false, businessValid=false;
  var aryDate=""

  for(i=0; i<objForm.length; i++){
    if(objForm[i].type == 'checkbox'  && objForm[i].name.indexOf("interest_")!=-1){
	  if(objForm[i].checked)
		interestValid = true;
	}else if(objForm[i].type == 'checkbox'  && objForm[i].name.indexOf("visit_")!=-1){
	  if(objForm[i].checked)
		visitValid = true;	
	}else if(objForm[i].type == 'checkbox'  && objForm[i].name.indexOf("booking_")!=-1){
	  if(objForm[i].checked)
		bookingValid = true;	
	}else if(objForm[i].type == 'checkbox'  && objForm[i].name.indexOf("business_")!=-1){
	  if(objForm[i].checked)
		businessValid = true;	
	}
  }

  if(objForm.title.value=="")
	strMessage = strMessage + "请选择你的称呼!\n";
  if(objForm.name.value=="")
	strMessage = strMessage + "请输入您的姓名!\n";
  if(objForm.jobTitle.value=="")
	strMessage = strMessage + "请输入您的职称!\n";
  if(objForm.companyName.value=="")
	strMessage = strMessage + "请输入您的公司名称!\n";
  if(objForm.source.value=="")
	strMessage = strMessage + "请输入您从何认识香港科技园!\n";
//  if(objForm.mobile.value=="")
//	strMessage = strMessage + "请输入您的mobile!\n";
  if(objForm.telephone.value=="")
	strMessage = strMessage + "请输入您的办公室电话!\n";
  if(objForm.email.value=="")
	strMessage = strMessage + "请输入您的电邮!\n";
  //if(objForm.fax.value=="")
//	strMessage = strMessage + "请输入您的传真!\n";

  if(interestValid == false)
	strMessage = strMessage + "请选择您想多了解的服务!\n";
  //if(visitValid == false)
//	strMessage = strMessage + "请选择Visit location!\n";
  //if(bookingValid == false)
//	strMessage = strMessage + "请选择Venue !\n";
  if(businessValid == false)
	strMessage = strMessage + "请选择您所属行业!\n";
	
  if(strMessage==""){
	return true;
  }
  else{
    alert(strMessage);
	return false;
  }	

}

function checkEnquiryjp(objForm){
  var i=0, strMessage="", strDate="", strError="";
  var interestValid=false, visitValid=false, bookingValid=false, businessValid=false;
  var aryDate=""

  for(i=0; i<objForm.length; i++){
    if(objForm[i].type == 'checkbox'  && objForm[i].name.indexOf("interest_")!=-1){
	  if(objForm[i].checked)
		interestValid = true;
	}else if(objForm[i].type == 'checkbox'  && objForm[i].name.indexOf("visit_")!=-1){
	  if(objForm[i].checked)
		visitValid = true;	
	}else if(objForm[i].type == 'checkbox'  && objForm[i].name.indexOf("booking_")!=-1){
	  if(objForm[i].checked)
		bookingValid = true;	
	}else if(objForm[i].type == 'checkbox'  && objForm[i].name.indexOf("business_")!=-1){
	  if(objForm[i].checked)
		businessValid = true;	
	}
  }

  if(objForm.title.value=="")
	strMessage = strMessage + "あなたのタイトルを選びなさい!\n";
  if(objForm.name.value=="")
	strMessage = strMessage + "あなたの名前を入れなさい!\n";
  if(objForm.jobTitle.value=="")
	strMessage = strMessage + "あなたの職名を入れなさい!\n";
  if(objForm.companyName.value=="")
	strMessage = strMessage + "あなたの会社名を入れなさい!\n";
  if(objForm.source.value=="")
	strMessage = strMessage + "どんな源がHKSTPについて学んだかからの入力!\n";
//  if(objForm.mobile.value=="")
//	strMessage = strMessage + "Please input your mobile!\n";
  if(objForm.telephone.value=="")
	strMessage = strMessage + "あなたの電話を入れなさい!\n";
  if(objForm.email.value=="")
	strMessage = strMessage + "あなたの電子メールを入れなさい!\n";
  //if(objForm.fax.value=="")
//	strMessage = strMessage + "Please input your fax!\n";

  if(interestValid == false)
	strMessage = strMessage + "興味がある情報を選びなさい!\n";
  //if(visitValid == false)
//	strMessage = strMessage + "Please select Visit location!\n";
  //if(bookingValid == false)
//	strMessage = strMessage + "Please select Venue !\n";
  if(businessValid == false)
	strMessage = strMessage + "事業の種類を選びなさい!\n";
	
  if(strMessage==""){
	return true;
  }
  else{
    alert(strMessage);
	return false;
  }	

}


function checkFullEnquiryen(objForm){
  var i=0, strMessage="", strDate="", strError="";
  var interestValid=false, visitValid=false, bookingValid=false, businessValid=false;
  var aryDate=""

  for(i=0; i<objForm.length; i++){
	if(objForm[i].type == 'radio'  && objForm[i].name.indexOf("business")!=-1){
	  if(objForm[i].checked)
		businessValid = true;	
	}
  }

  if(objForm.interest.value=="")
	strMessage = strMessage + "Please input your interest!\n";
  if(objForm.companyName.value=="")
	strMessage = strMessage + "Please input Organization/Company name!\n";
  if(objForm.country.value=="")
	strMessage = strMessage + "Please input Country!\n";
  if(objForm.website.value=="")
	strMessage = strMessage + "Please input Website!\n";
  if(businessValid == false)
	strMessage = strMessage + "Please select Nature of Business!\n";
  if(objForm.contact.value=="")
	strMessage = strMessage + "Please input Contact person!\n";
  if(objForm.jobTitle.value=="")
	strMessage = strMessage + "Please input Job Title!\n";
  if(objForm.telephone.value=="")
	strMessage = strMessage + "Please input Telephone!\n";
  if(objForm.email.value=="")
	strMessage = strMessage + "Please input Email!\n";
	
  if(strMessage==""){
	return true;
  }
  else{
    alert(strMessage);
	return false;
  }	

}

function checkFullEnquiryb5(objForm){
  var i=0, strMessage="", strDate="", strError="";
  var interestValid=false, visitValid=false, bookingValid=false, businessValid=false;
  var aryDate=""

  for(i=0; i<objForm.length; i++){
	if(objForm[i].type == 'radio'  && objForm[i].name.indexOf("business")!=-1){
	  if(objForm[i].checked)
		businessValid = true;	
	}
  }

  if(objForm.interest.value=="")
	strMessage = strMessage + "請輸入閣下感興趣／希望合作的項目!\n";
  if(objForm.companyName.value=="")
	strMessage = strMessage + "請輸入機構／公司名稱!\n";
  if(objForm.country.value=="")
	strMessage = strMessage + "請輸入國家!\n";
  if(objForm.website.value=="")
	strMessage = strMessage + "請輸入網址!\n";
  if(businessValid == false)
	strMessage = strMessage + "請選擇業務性質!\n";
  if(objForm.contact.value=="")
	strMessage = strMessage + "請輸入聯絡人!\n";
  if(objForm.jobTitle.value=="")
	strMessage = strMessage + "請輸入職位!\n";
  if(objForm.telephone.value=="")
	strMessage = strMessage + "請輸入電話!\n";
  if(objForm.email.value=="")
	strMessage = strMessage + "請輸入電郵!\n";
	
  if(strMessage==""){
	return true;
  }
  else{
    alert(strMessage);
	return false;
  }	

}

function checkFullEnquirygb(objForm){
  var i=0, strMessage="", strDate="", strError="";
  var interestValid=false, visitValid=false, bookingValid=false, businessValid=false;
  var aryDate=""

  for(i=0; i<objForm.length; i++){
	if(objForm[i].type == 'radio'  && objForm[i].name.indexOf("business")!=-1){
	  if(objForm[i].checked)
		businessValid = true;	
	}
  }

  if(objForm.interest.value=="")
	strMessage = strMessage + "请输入阁下感兴趣／希望合作的项目!\n";
  if(objForm.companyName.value=="")
	strMessage = strMessage + "请输入机构／公司名称!\n";
  if(objForm.country.value=="")
	strMessage = strMessage + "请输入国家!\n";
  if(objForm.website.value=="")
	strMessage = strMessage + "请输入网址!\n";
  if(businessValid == false)
	strMessage = strMessage + "请选择业务性质!\n";
  if(objForm.contact.value=="")
	strMessage = strMessage + "请输入联络人!\n";
  if(objForm.jobTitle.value=="")
	strMessage = strMessage + "请输入职位!\n";
  if(objForm.telephone.value=="")
	strMessage = strMessage + "请输入电话!\n";
  if(objForm.email.value=="")
	strMessage = strMessage + "请输入电邮!\n";

	
  if(strMessage==""){
	return true;
  }
  else{
    alert(strMessage);
	return false;
  }	

}

function checkFullEnquiryjp(objForm){
  var i=0, strMessage="", strDate="", strError="";
  var interestValid=false, visitValid=false, bookingValid=false, businessValid=false;
  var aryDate=""

  for(i=0; i<objForm.length; i++){
	if(objForm[i].type == 'radio'  && objForm[i].name.indexOf("business")!=-1){
	  if(objForm[i].checked)
		businessValid = true;	
	}
  }

  if(objForm.interest.value=="")
	strMessage = strMessage + "入力お求めのご関心/連携を記入してください!\n";
  if(objForm.companyName.value=="")
	strMessage = strMessage + "入力組織・会社名!\n";
  if(objForm.country.value=="")
	strMessage = strMessage + "入力国!\n";
  if(objForm.website.value=="")
	strMessage = strMessage + "入力ウェブサイト!\n";
  if(businessValid == false)
	strMessage = strMessage + "入力ビジネスの特徴!\n";
  if(objForm.contact.value=="")
	strMessage = strMessage + "入力連絡先!\n";
  if(objForm.jobTitle.value=="")
	strMessage = strMessage + "入力職名!\n";
  if(objForm.telephone.value=="")
	strMessage = strMessage + "入力電話!\n";
  if(objForm.email.value=="")
	strMessage = strMessage + "入力Eメール!\n";
	
  if(strMessage==""){
	return true;
  }
  else{
    alert(strMessage);
	return false;
  }	

}


function checkExchangeRegistration(objForm){
  var i=0, strMessage="", strDate="", strError="";
  var optionValid=false;
  var aryDate=""

  for(i=0; i<objForm.length; i++){
	if(objForm[i].type == 'checkbox'  && objForm[i].name.indexOf("option")!=-1){
	  if(objForm[i].checked)
		optionValid = true;	
	}
  }

  if(objForm.name.value=="")
	strMessage = strMessage + "Please input name(s)!\n";
  if(objForm.title.value=="")
	strMessage = strMessage + "Please input title(s)!\n";
  if(objForm.company.value=="")
	strMessage = strMessage + "Please input company!\n";
  if(objForm.telephone.value=="")
	strMessage = strMessage + "Please input telephone!\n";
  if(objForm.email.value=="")
	strMessage = strMessage + "Please input email!\n";
  if(objForm.isneedtransport1[1].checked && objForm.carNo.value=="")
	strMessage = strMessage + "Please input car number!\n";
  if(objForm.isneedtransport1[0].checked)
	objForm.isneedtransport.value = objForm.isneedtransport1[0].value;
  if(objForm.isneedtransport1[1].checked)
	objForm.isneedtransport.value = objForm.isneedtransport1[1].value;
	
  if(strMessage==""){
	return true;
  }
  else{
    alert(strMessage);
	return false;
  }	
}

function checkECMailFriend(objForm){
  var i=0, intValidCount=0, intNEQCount=0, strMessage="", strName="", strError="", strIndex="";
  var isValid=false;
  var aryNameValid = new Array(5);
  var aryEmailValid = new Array(5);
  for (i=0; i<5; i++)
  {
	  aryNameValid[i] = false;
	  aryEmailValid[i] = false;
  }

  for(i=0; i<objForm.length; i++){
	if(objForm[i].type == 'text'  && objForm[i].name.indexOf("friendName_")!=-1){
		strName = objForm[i].name;
		strIndex = strName.replace("friendName_", "");
		if(objForm[i].value!="")
			aryNameValid[strIndex] = true;
	}
	else if(objForm[i].type == 'text'  && objForm[i].name.indexOf("friendEmail_")!=-1 && objForm[i].value!=""){
	  strName = objForm[i].name;
	  strIndex = strName.replace("friendEmail_", "");
      if(isvalidEmail(objForm[i].value))
        aryEmailValid[strIndex] = true;
	}
  }

  for (i=0; i<5; i++)
  {
	  //alert(aryNameValid[i] + "=" + aryEmailValid[i]);
	  if(aryNameValid[i] && aryEmailValid[i])
		  intValidCount++;
	  else if(!aryNameValid[i] && !aryEmailValid[i])
		  isvalid = false;
	  else
	  {
		  isvalid = false;
		  intNEQCount++;
	  }

  }

  if(objForm.name.value=="")
	strMessage = strMessage + "Please input your name!\n";
  if(!isvalidEmail(objForm.email.value))
	strMessage = strMessage + "Please input valid email!\n";
  if((!isvalid && intValidCount<1) || intNEQCount > 0)
	strMessage = strMessage + "Please input name(s) and valid email(s) of your friend!\n";

  if(strMessage==""){
	return true;
  }
  else{
    alert(strMessage);
	return false;
  }	

  return false;

}

function checkECMailFriendb5(objForm){
  var i=0, intValidCount=0, intNEQCount=0, strMessage="", strName="", strError="", strIndex="";
  var isValid=false;
  var aryNameValid = new Array(5);
  var aryEmailValid = new Array(5);
  for (i=0; i<5; i++)
  {
	  aryNameValid[i] = false;
	  aryEmailValid[i] = false;
  }

  for(i=0; i<objForm.length; i++){
	if(objForm[i].type == 'text'  && objForm[i].name.indexOf("friendName_")!=-1){
		strName = objForm[i].name;
		strIndex = strName.replace("friendName_", "");
		if(objForm[i].value!="")
			aryNameValid[strIndex] = true;
	}
	else if(objForm[i].type == 'text'  && objForm[i].name.indexOf("friendEmail_")!=-1 && objForm[i].value!=""){
	  strName = objForm[i].name;
	  strIndex = strName.replace("friendEmail_", "");
      if(isvalidEmail(objForm[i].value))
        aryEmailValid[strIndex] = true;
	}
  }

  for (i=0; i<5; i++)
  {
	  //alert(aryNameValid[i] + "=" + aryEmailValid[i]);
	  if(aryNameValid[i] && aryEmailValid[i])
		  intValidCount++;
	  else if(!aryNameValid[i] && !aryEmailValid[i])
		  isvalid = false;
	  else
	  {
		  isvalid = false;
		  intNEQCount++;
	  }

  }

  if(objForm.name.value=="")
	strMessage = strMessage + "請輸入您的姓名!\n";
  if(!isvalidEmail(objForm.email.value))
	strMessage = strMessage + "請輸入有效的電郵!\n";
  if((!isvalid && intValidCount<1) || intNEQCount > 0)
	strMessage = strMessage + "請輸入朋友的姓名和電郵!\n";

  if(strMessage==""){
	return true;
  }
  else{
    alert(strMessage);
	return false;
  }	

  return false;

}

function checkECMailFriendgb(objForm){
  var i=0, intValidCount=0, intNEQCount=0, strMessage="", strName="", strError="", strIndex="";
  var isValid=false;
  var aryNameValid = new Array(5);
  var aryEmailValid = new Array(5);
  for (i=0; i<5; i++)
  {
	  aryNameValid[i] = false;
	  aryEmailValid[i] = false;
  }

  for(i=0; i<objForm.length; i++){
	if(objForm[i].type == 'text'  && objForm[i].name.indexOf("friendName_")!=-1){
		strName = objForm[i].name;
		strIndex = strName.replace("friendName_", "");
		if(objForm[i].value!="")
			aryNameValid[strIndex] = true;
	}
	else if(objForm[i].type == 'text'  && objForm[i].name.indexOf("friendEmail_")!=-1 && objForm[i].value!=""){
	  strName = objForm[i].name;
	  strIndex = strName.replace("friendEmail_", "");
      if(isvalidEmail(objForm[i].value))
        aryEmailValid[strIndex] = true;
	}
  }

  for (i=0; i<5; i++)
  {
	  //alert(aryNameValid[i] + "=" + aryEmailValid[i]);
	  if(aryNameValid[i] && aryEmailValid[i])
		  intValidCount++;
	  else if(!aryNameValid[i] && !aryEmailValid[i])
		  isvalid = false;
	  else
	  {
		  isvalid = false;
		  intNEQCount++;
	  }

  }

  if(objForm.name.value=="")
	strMessage = strMessage + "请输入您的姓名!\n";
  if(!isvalidEmail(objForm.email.value))
	strMessage = strMessage + "请输入有效的电邮!\n";
  if((!isvalid && intValidCount<1) || intNEQCount > 0)
	strMessage = strMessage + "请输入朋友的姓名和电邮!\n";

  if(strMessage==""){
	return true;
  }
  else{
    alert(strMessage);
	return false;
  }	

  return false;

}

function isvalidEmail(strEmail){
  var isvalid = true;

  if(strEmail=="")
	isvalid = false;
  else if(strEmail.indexOf("@")!=-1 && strEmail.indexOf(".")!=-1)
	isvalid = true;
  else
	isvalid = false;

  return isvalid;
}

function getAction()
{
  var aryURL = self.location.href.split("?");
  var aryPath = aryURL[0].split("/");
  var strAction = aryPath[aryPath.length - 1];

  return strAction;
}

function getHTTPParameter()
{
  var aryURL = self.location.href.split("?");
  var aryParameter = new Array();
  var aryPair = new Array();
  var i;

  if(aryURL.length > 1)
  {
    aryPair = aryURL[1].split("&");
	for (i=0; i<aryPair.length; i++)
	{
       var aryValue = aryPair[i].split("=");
	   aryParameter[aryValue[0]] = aryValue[1];
	}
  }

  return aryParameter;
}

function getLanguageLink(strLanguageKey, strLanguage)
{
	var strParameter = "";
	var iskeyfound = false;

	var aryParameter = getHTTPParameter();
    for (strKey in aryParameter)
    {
	  if(strKey == strLanguageKey)
	  {
		  strParameter = strParameter + strKey + "=" + strLanguage + "&";
		  iskeyfound = true;
	  }
	  else
	  {
		  strParameter = strParameter + strKey + "=" + aryParameter[strKey] + "&";
	  }
    }

    if(!iskeyfound)
	{
		strParameter = strParameter + strLanguageKey + "=" + strLanguage;
	}

	return getAction() + "?" + strParameter;
}

function redirect(strURL)
{
	if(strURL != "")
	{
		window.location = strURL;
	}
}

function languageRedirect(strLanguageKey, strLanguage)
{
	var strURL = getLanguageLink(strLanguageKey, strLanguage);
	redirect(strURL);
}

function switchLeftMenu()
{
	var strAction = getAction();
	var menu = new Array();
	var source = new Array();
	menu["index.jsp"] = "images/menu_o_01.gif";
	menu["html.jsp"] = "images/menu_o_03.gif";
	menu["html.jsp"] = "images/menu_o_04.gif";
	menu["html.jsp"] = "images/menu_o_05.gif";
	menu["html.jsp"] = "images/menu_o_06.gif";
	menu["news.jsp"] = "images/menu_o_07.gif";
	menu["directory.jsp"] = "images/menu_o_08.gif";
	menu["form.jsp"] = "images/menu_o_09.gif";
	menu["job.jsp"] = "images/menu_o_10.gif";
	menu["link.jsp"] = "images/menu_o_11.gif";
	menu["html.jsp"] = "images/menu_o_12.gif";
	menu["html.jsp"] = "images/menu_o_13.gif";
	source["index.jsp"] = "image01";
	source["html.jsp"] = "image02";
	source["html.jsp"] = "image03";
	source["html.jsp"] = "image04";
	source["html.jsp"] = "image05";
	source["news.jsp"] = "image06";
	source["directory.jsp"] = "image07";
	source["form.jsp"] = "image08";
	source["job.jsp"] = "image09";
	source["link.jsp"] = "image10";
	source["html.jsp"] = "image11";
	source["html.jsp"] = "image12";
//alert("Left:" + strAction + "=" + menu[strAction]);

	if(menu[strAction] !=null && menu[strAction] != "")
	{
		document.getElementById(source[strAction]).src = menu[getAction()];
	}
}

function switchTopImages()
{
	var strAction = getAction();
	var strLang = strAction.substring(0, 2);
	strAction = strAction.substring(3);
	var language = new Array();
	language["en"] = "eng";
	language["b5"] = "b5";
	language["gb"] = "gb";
	var source = new Array();
	var pattern = new Array();
	var menu1 = new Array();
	var menu2 = new Array();
	var menu3 = new Array();
	var menu4 = new Array();
	var menu5 = new Array();
	var menu6 = new Array();
	var menu7 = new Array();
	var menu8 = new Array();
	var menu9 = new Array();
	var menu10 = new Array();
	var menu11 = new Array();
	var menu16 = new Array();
	var menu15 = new Array();
	var menu17 = new Array();
	var menu18 = new Array();
	var menu19 = new Array();
	var menu20 = new Array();

    var i =0;
	source[0] = "index.jsp";
	source[1] = "media.jsp";
	source[2] = "public.jsp";
	source[3] = "customer.jsp";
	source[4] = "community.jsp";
	source[5] = "academia.jsp";
	pattern[0] = "_index_top_normal_";
	pattern[1] = "_press_top_normal_";
	pattern[2] = "_public_top_normal_";
	pattern[3] = "_customers_top_normal_";
	pattern[4] = "_community_top_normal_";
	pattern[5] = "_academia_top_normal_";
	/*var aryURL = self.location.href.split("?");
	var aryPair = new Array();

	if(aryURL.length > 1)
	{
		aryPair = aryURL[1].split("&");
		for (i=0; i<aryPair.length; i++)
		{
			var aryValue = aryPair[i].split("=");
			if(aryValue[0] == "lan")
			{
				strLang = aryValue[1];
			}
		}
	}*/


//alert("here");
	for (i=0; i<6; i++)
	{
	    menu1[source[i]] = "../image/revamp/" + strLang + "/" + language[strLang] + pattern[i] + "01.jpg";
	    menu2[source[i]] = "../image/revamp/" + strLang + "/" + language[strLang] + pattern[i] + "02.jpg";
	    menu3[source[i]] = "../image/revamp/" + strLang + "/" + language[strLang] + pattern[i] + "03.gif";
	    menu4[source[i]] = "../image/revamp/" + strLang + "/" + language[strLang] + pattern[i] + "04.gif";
	    menu5[source[i]] = "../image/revamp/" + strLang + "/" + language[strLang] + pattern[i] + "05.gif";
	    menu6[source[i]] = "../image/revamp/" + strLang + "/" + language[strLang] + pattern[i] + "06.gif";
	    menu7[source[i]] = "../image/revamp/" + strLang + "/" + language[strLang] + pattern[i] + "07.gif";
	    menu8[source[i]] = "../image/revamp/" + strLang + "/" + language[strLang] + pattern[i] + "08.gif";
	    menu9[source[i]] = "../image/revamp/" + strLang + "/" + language[strLang] + pattern[i] + "09.gif";
	    menu10[source[i]] = "../image/revamp/" + strLang + "/" + language[strLang] + pattern[i] + "10.jpg";
	    menu11[source[i]] = "../image/revamp/" + strLang + "/" + language[strLang] + pattern[i] + "11.gif";
	    menu15[source[i]] = "../image/revamp/" + strLang + "/" + language[strLang] + pattern[i] + "15.gif";
	    menu16[source[i]] = "../image/revamp/" + strLang + "/" + language[strLang] + pattern[i] + "16.gif";
	    menu17[source[i]] = "../image/revamp/" + strLang + "/" + language[strLang] + pattern[i] + "17.gif";
	    menu18[source[i]] = "../image/revamp/" + strLang + "/" + language[strLang] + pattern[i] + "18.gif";
	    menu19[source[i]] = "../image/revamp/" + strLang + "/" + language[strLang] + pattern[i] + "19.gif";
	    menu20[source[i]] = "../image/revamp/" + strLang + "/" + language[strLang] + pattern[i] + "20.gif";
	}

	/*menu1["index.jsp"] = "../image/revamp/top_01.jpg";
	menu1["media.jsp"] = "../image/revamp/topm_01.jpg";
	menu1["public.jsp"] = "../image/revamp/topg_01.jpg";
	menu1["customer.jsp"] = "../image/revamp/topc_01.jpg";
	menu1["community.jsp"] = "../image/revamp/topcom_01.jpg";
	menu1["academia.jsp"] = "../image/revamp/top_01.jpg";*/
	
//alert("Top:" + strAction + "=" + menu1[strAction]);

	if(menu1[strAction] !=null && menu1[strAction] != "")
	{
		document.getElementById("topImage1").src = menu1[strAction];
	}
	if(menu2[strAction] !=null && menu2[strAction] != "")
	{
		document.getElementById("topImage2").src = menu2[strAction];
	}
	if(menu3[strAction] !=null && menu3[strAction] != "")
	{
		document.getElementById("topImage3").src = menu3[strAction];
	}
	if(menu4[strAction] !=null && menu4[strAction] != "")
	{
		document.getElementById("topImage4").src = menu4[strAction];
	}
	if(menu5[strAction] !=null && menu5[strAction] != "")
	{
		document.getElementById("topImage5").src = menu5[strAction];
	}
	if(menu6[strAction] !=null && menu6[strAction] != "")
	{
		document.getElementById("topImage6").src = menu6[strAction];
	}
	if(menu7[strAction] !=null && menu7[strAction] != "")
	{
		document.getElementById("topImage7").src = menu7[strAction];
	}
	if(menu8[strAction] !=null && menu8[strAction] != "")
	{
		document.getElementById("topImage8").src = menu8[strAction];
	}
	if(menu9[strAction] !=null && menu9[strAction] != "")
	{
		document.getElementById("topImage9").src = menu9[strAction];
	}
	if(menu10[strAction] !=null && menu10[strAction] != "")
	{
		document.getElementById("topImage10").src = menu10[strAction];
	}
	if(menu11[strAction] !=null && menu11[strAction] != "")
	{
		document.getElementById("topImage11").src = menu11[strAction];
	}
	if(menu15[strAction] !=null && menu15[strAction] != "")
	{
		document.getElementById("topImage15").src = menu15[strAction];
	}
	if(menu16[strAction] !=null && menu16[strAction] != "")
	{
		document.getElementById("topImage16").src = menu16[strAction];
	}
	if(menu17[strAction] !=null && menu17[strAction] != "")
	{
		document.getElementById("topImage17").src = menu17[strAction];
	}
	if(menu18[strAction] !=null && menu18[strAction] != "")
	{
		document.getElementById("topImage18").src = menu18[strAction];
	}
	if(menu19[strAction] !=null && menu19[strAction] != "")
	{
		document.getElementById("topImage19").src = menu19[strAction];
	}
	if(menu20[strAction] !=null && menu20[strAction] != "")
	{
		document.getElementById("topImage20").src = menu20[strAction];
	}
}

function switchTopImages2()
{
	var strAction = getAction();
	var strLang = strAction.substring(0, 2);
	strAction2 = strAction.substring(3);
	var language = new Array();
	language["en"] = "en";
	language["b5"] = "b5";
	language["gb"] = "gb";
	if(strLang!="en" && strLang!="b5" && strLang!="gb")
	{
		strLang = "en";
	}

	var source = new Array();
	var file1 = new Array();
	var file2 = new Array();
	var menu1 = new Array();
	var menu2 = new Array();

    var i =0;
	source[0] = "_corporation1_";
	source[1] = "_corporation2_";
	source[2] = "_corporation3_";
	source[3] = "_hightech";
	source[4] = "_full";
	source[5] = "fullenquiry";
	source[6] = "news";
	source[7] = "_open_public";

	file1[0] = "top_hkstp.jpg";
	file1[1] = "top_inno.jpg";
	file1[2] = "top_ie.jpg";
	file1[3] = "top_tech.jpg";
	file1[4] = "top_ic.jpg";
	file1[5] = "top_ic.jpg";
	file1[6] = "top_event.jpg";
	file1[7] = "top_event.jpg";

	file2[0] = "top_hkstp01.jpg";
	file2[1] = "top_inno01.jpg";
	file2[2] = "top_ie01.jpg";
	file2[3] = "top_tech01.jpg";
	file2[4] = "top_ic01.jpg";
	file2[5] = "top_ic01.jpg";
	file2[6] = "top_event01.jpg";
	file2[7] = "top_event01.jpg";

	for (i=0; i<source.length; i++)
	{
	    menu1[source[i]] = "http://www.hkstp.org/HKSTPC/image/revamp/" + strLang + "/" + file1[i];
	    menu2[source[i]] = "http://www.hkstp.org/HKSTPC/image/revamp/" + strLang + "/" + file2[i];
	    //menu1[source[i]] = "../image/revamp/" + strLang + "/" + file1[i];
	    //menu2[source[i]] = "../image/revamp/" + strLang + "/" + file2[i];
	}
    
	if(strAction=="news.jsp")
	{
		document.getElementById("top_main01").src = menu2["news"];
		document.getElementById("top_main").src = menu1["news"];
	}
	else if(strAction=="fullEnquiry.jsp")
	{
		document.getElementById("top_main").src = menu1["fullenquiry"];
		document.getElementById("top_main01").src = menu2["fullenquiry"];
	}
	else if(strAction.indexOf("_corporation1_") != -1)
	{
		document.getElementById("top_main").src = menu1["_corporation1_"];
		document.getElementById("top_main01").src = menu2["_corporation1_"];
	}
	else if(strAction.indexOf("_corporation3_") != -1)
	{
		document.getElementById("top_main").src = menu1["_corporation3_"];
		document.getElementById("top_main01").src = menu2["_corporation3_"];
	}
	else if(strAction.indexOf("_hightech") != -1)
	{
		document.getElementById("top_main").src = menu1["_hightech"];
		document.getElementById("top_main01").src = menu2["_hightech"];
	}
	else if(strAction.indexOf("_full") != -1)
	{
		document.getElementById("top_main").src = menu1["_full"];
		document.getElementById("top_main01").src = menu2["_full"];
	}
	else if(strAction.indexOf("_open_public") != -1)
	{
		document.getElementById("top_main").src = menu1["_open_public"];
		document.getElementById("top_main01").src = menu2["_open_public"];
	}
}

function switchMiddleMemu()
{
	var strAction = getAction();
	var strLang = strAction.substring(0, 2);
	strAction = strAction.substring(3);
	var menu = new Array();
	var menu2 = new Array();
	var source = new Array();
	var language = new Array();
	language["en"] = "eng";
	language["b5"] = "b5";
	language["gb"] = "gb";

	menu["media.jsp"] = "../image/revamp/" + strLang + "/" + language[strLang] + "_press_top_over_15.gif";
	menu["public.jsp"] = "../image/revamp/" + strLang + "/" + language[strLang] + "_public_top_over_13.gif";
	menu["customer.jsp"] = "../image/revamp/" + strLang + "/" + language[strLang] + "_customers_top_over_14.gif";
	menu["community.jsp"] = "../image/revamp/" + strLang + "/" + language[strLang] + "_community_top_over_16.gif";
	menu["academia.jsp"] = "../image/revamp/" + strLang + "/" + language[strLang] + "_academia_top_over_12.gif";
	menu2["media.jsp"] = "url(../image/revamp/midmenu_05.gif)";
	menu2["public.jsp"] = "url(../image/revamp/midmenu_06.gif)";
	menu2["customer.jsp"] = "url(../image/revamp/midmenu_08.gif)";
	menu2["community.jsp"] = "url(../image/revamp/midmenu_10.gif)";
	menu2["academia.jsp"] = "url(../image/revamp/midmenu_13.gif)";

	source["media.jsp"] = "topImage15";
	source["public.jsp"] = "topImage13";
	source["customer.jsp"] = "topImage14";
	source["community.jsp"] = "topImage16";
	source["academia.jsp"] = "topImage12";
//alert("Middle:" + strAction + "=" + menu[strAction]);
	/*if(menu[strAction] !=null && menu[strAction] != "")
	{
		document.getElementById(source[strAction]).src = menu[strAction];
	}*/
	if(menu2[strAction] !=null && menu2[strAction] != "")
	{
		document.getElementById("leftMenuRow").style.backgroundImage = menu2[strAction];
		//alert(document.getElementById("leftMenuRow").style.backgroundImage);
	}
}

function switchOfferMemu()
{
	var strLang = "en";
	var menu = new Array();
	var bannerMenu = new Array();
	var source = new Array();
	var aryURL = self.location.href.split("?");
	var aryParameter = new Array();
	var aryPair = new Array();
	var i;
	var strValue = "";

	if(aryURL.length > 1)
	{
		aryPair = aryURL[1].split("&");
		for (i=0; i<aryPair.length; i++)
		{
			var aryValue = aryPair[i].split("=");
			if(aryValue[0] == "typeId2")
			{
				strValue = aryValue[1];
			}
			else if(aryValue[0] == "lan")
			{
				strLang = aryValue[1];
			}
		}
	}
//alert(strValue);
	menu["OT_006"] = "image/revamp/" + strLang + "/4venue_o_01.gif";
	menu["OT_007"] = "image/revamp/" + strLang + "/4venue_o_03.gif";
	menu["OT_008"] = "image/revamp/" + strLang + "/4venue_o_05.gif";
	menu["OT_009"] = "image/revamp/" + strLang + "/4venue_o_07.gif";
	bannerMenu["OT_006"] = "image/revamp/" + strLang + "/venue21.jpg";
	bannerMenu["OT_007"] = "image/revamp/" + strLang + "/venue19.jpg";
	bannerMenu["OT_008"] = "image/revamp/" + strLang + "/venue20.jpg";
	bannerMenu["OT_009"] = "image/revamp/" + strLang + "/venue20.jpg";
	source["OT_006"] = "image50";
	source["OT_007"] = "image51";
	source["OT_008"] = "image52";
	source["OT_009"] = "image53";
//alert(menu[strValue]);
//alert(bannerMenu[strValue]);

//alert("Middle:" + strValue + "=" + menu[strValue]);
	if(menu[strValue] !=null && menu[strValue] != "")
	{
		document.getElementById(source[strValue]).src = menu[strValue];
	}
	if(bannerMenu[strValue] !=null && bannerMenu[strValue] != "")
	{
		document.getElementById("FBBanner").src = bannerMenu[strValue];
	}
}

function switchImages()
{
	switchTopImages2();
	switchMiddleMemu();
	//switchLeftMenu();
	switchOfferMemu();
	fixTop();
    document.getElementById('top_main').focus();
}

function offerJumpMenu(targ,selObj,lang, strMode){ //v3.0
//alert(targ+".location='offer.jsp?typeId=OT_005&typeId2=OT_006&typeId3="+selObj.options[selObj.selectedIndex].value+"&lan=" + lang + "'");
  var strModeValue = "";

  if(strMode != "")
	strModeValue = "&mode=" + strMode;
  eval(targ+".location='offer.jsp?typeId=OT_005&typeId2=OT_006&typeId3="+selObj.options[selObj.selectedIndex].value+"&lan=" + lang + strModeValue +"'");
}

function writeFlash(strSource, intWidth, intHeight, strElement)
{
	var strContent = "";

    strContent = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0\" id=\"myFlashMovie\" width=\"" + intWidth + "\"" + " height=\"" + intHeight + "\">\n" ;
    strContent = strContent + "<param name=\"movie\" value=\"" + strSource + "\">\n"; 
    strContent = strContent + "<param name=\"quality\" value=\"high\">\n"; 
    strContent = strContent + "<param name=\"play\" value=\"true\">\n"; 
    strContent = strContent + "<param name=\"bgcolor\" value=\"#FFFFFF\">\n";
    strContent = strContent + "<embed play=\"true\" swliveconnect=\"true\" name=\"myFlashMovie\" id=\"myFlashMovie\" src=\"" + strSource + "\" quality=\"high\" bgcolor=\"#FFFFFF\" width=\"" + intWidth + "\" height=\"" + intHeight + "\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"> </embed >\n"; 
    strContent = strContent + "</object >\n"; 
//alert(strContent);
document.getElementById(strElement).innerHTML = strContent;
}

//Fix the top position
function fixTop() {
  var strId, intValue;

		for (var i=1; i<10; i++)
		{	
			strId = "layer" + i;
			intValue = document.getElementById(strId).style.top;
			intValue = intValue.replace(/px/, "");
			intValue = intValue - 68;
			//alert(strId + "=" + document.getElementById(strId).style.top);
			document.getElementById(strId).style.top = intValue + "px" ;
			//alert(strId + "=" + document.getElementById(strId).style.top);
		}
}

function checkIPRegistration(objForm)
{
  var i=0, strMessage="", strDate="", strError="";

  if(objForm.name.value == "")
	strMessage = strMessage + "Please input name!\n";
  if(objForm.email.value == "")
	strMessage = strMessage + "Please input email!\n";
  if(objForm.title.value == "")
	strMessage = strMessage + "Please input job title!\n";
  if(objForm.companyName.value == "")
	strMessage = strMessage + "Please input Company/Organization!\n";
  if(getCheckedValue(objForm.industryId) == "")
	strMessage = strMessage + "Please select Sector/Industry!\n";
  if(getCheckedValue(objForm.categoryId) == "")
	strMessage = strMessage + "Please select Interested Patent Area!\n";

  if(strMessage==""){
	return true;  
  }
  else{
    alert(strMessage);
	return false;
  }	
}

function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

function checkIPPatent(strType, objForm)
{
	var i=0, strMessage="", strDate="", strError="";
	
	if(objForm.type.value == "1")
	{
		//if(objForm.categoryId.value == "")
		//	strMessage = strMessage + "Please select category!\n";
	}
	else
	{
		if(objForm.keyword.value == "")
			strMessage = strMessage + "Please input keyword!\n";
	}

	if(strMessage=="")
	{
		if(objForm.type.value == "1")
		{
			objForm.keyword.value = "";
		}
		else
		{
			objForm.universityId.value = "";
			objForm.categoryId.value = "";
		}

		return true;
	}
	else
	{
		alert(strMessage);
		return false;
	}	
}

function changeCatIntro(strId)
{
document.getElementById("catgoryIntro").innerHTML = lstCatIntro[strId];
}
//-->