function getInewsImg(thisind)
{
	var img1 = "";

	pageURL = location.href;
	pageWOhttp = pageURL.substring(7,pageURL.length);
	var strokeL = new Array(10)
	j = 0
	
	for (i=0; i < pageWOhttp.length; i++)
	{
		if (pageWOhttp.charAt(i) == "/")
			strokeL[j++] = i
	}
	
	// Automobile
	if (thisind == 1)
	{
		img1 = "<img src=\"/"+ pageWOhttp.substring(strokeL[0]+1,strokeL[2]) +"/images/autoimg.jpg\" border=0>";
	}

	// Plastic
	else if (thisind == 3)
	{
		img1 = "<img src=\"/"+ pageWOhttp.substring(strokeL[0]+1,strokeL[2]) +"/images/plasticimg.jpg\" border=0>";
	}

	// Textile
	else if (thisind == 4)
	{
		img1 = "<img src=\"/"+ pageWOhttp.substring(strokeL[0]+1,strokeL[2]) +"/images/textileimg.jpg\" border=0>";
	}

	// Packaging
	else if (thisind == 5)
	{
		img1 = "<img src=\"/"+ pageWOhttp.substring(strokeL[0]+1,strokeL[2]) +"/images/packimg.jpg\" border=0>";
	}
	
	// Machinery
	else if (thisind == 6)
	{
		img1 = "<img src=\"/"+ pageWOhttp.substring(strokeL[0]+1,strokeL[2]) +"/images/macimg.jpg\" border=0>";
	}
			
	return img1;
}

function getInewsTitleImg(thisind)
{
	var img1 = "";

	pageURL = location.href;
	pageWOhttp = pageURL.substring(7,pageURL.length);
	var strokeL = new Array(10)
	j = 0
	
	for (i=0; i < pageWOhttp.length; i++)
	{
		if (pageWOhttp.charAt(i) == "/")
			strokeL[j++] = i
	}
		
	// Automobile
	if (thisind == 1)
	{
		img1 = "<img src=\"/"+ pageWOhttp.substring(strokeL[0]+1,strokeL[2]) +"/images/auto_txt.gif\" border=0>";
	}

	// Plastic
	else if (thisind == 3)
	{
		img1 = "<img src=\"/"+ pageWOhttp.substring(strokeL[0]+1,strokeL[2]) +"/images/plas_txt.gif\" border=0>";
	}

	// Textile
	else if (thisind == 4)
	{
		img1 = "<img src=\"/"+ pageWOhttp.substring(strokeL[0]+1,strokeL[2]) +"/images/tex_txt.gif\" border=0>";
	}

	// Packaging
	else if (thisind == 5)
	{
		img1 = "<img src=\"/"+ pageWOhttp.substring(strokeL[0]+1,strokeL[2]) +"/images/pack_txt.gif\" border=0>";
	}
	
	// Machinery
	else if (thisind == 6)
	{
		img1 = "<img src=\"/"+ pageWOhttp.substring(strokeL[0]+1,strokeL[2]) +"/images/mac_txt.gif\" border=0>";
	}
			
	return img1;
}

function getInewsImgBar(thisind)
{
	var img1 = "";

	pageURL = location.href;
	pageWOhttp = pageURL.substring(7,pageURL.length);
	var strokeL = new Array(10)
	j = 0
	
	for (i=0; i < pageWOhttp.length; i++)
	{
		if (pageWOhttp.charAt(i) == "/")
			strokeL[j++] = i
	}
	
	// Automobile
	if (thisind == 1)
	{
		img1 = "<img src=\"/"+ pageWOhttp.substring(strokeL[0]+1,strokeL[2]) +"/images/autoimgbar.jpg\" border=0>";
	}

	// Plastic
	else if (thisind == 3)
	{
		img1 = "<img src=\"/"+ pageWOhttp.substring(strokeL[0]+1,strokeL[2]) +"/images/plasticimgbar.jpg\" border=0>";
	}

	// Textile
	else if (thisind == 4)
	{
		img1 = "<img src=\"/"+ pageWOhttp.substring(strokeL[0]+1,strokeL[2]) +"/images/textileimgbar.jpg\" border=0>";
	}

	// Packaging
	else if (thisind == 5)
	{
		img1 = "<img src=\"/"+ pageWOhttp.substring(strokeL[0]+1,strokeL[2]) +"/images/packimgbar.jpg\" border=0>";
	}
	
	// Machinery
	else if (thisind == 6)
	{
		img1 = "<img src=\"/"+ pageWOhttp.substring(strokeL[0]+1,strokeL[2]) +"/images/macimgbar.jpg\" border=0>";
	}
			
	return img1;
}

function submit_form(theForm)
{
	theForm.submit();
}

function reset_form(theForm)
{
	theForm.reset();
}

function gotoPage(tURL)
{
	opener.location.href = tURL;
	self.close()
}

function submitEmF(theForm,thisAct)
{
	haveSelect = 0;
	
	for(emi=1; emi <= theForm.lrow.value; emi++)
	{
  		tmpV = "theForm.c"+emi;
  		if (eval(tmpV))
  		{
	  		tmpV1 = "theForm.c"+emi+".checked";
	  		if (eval(tmpV1))
				haveSelect = 1;
		}
	}
	
	if (haveSelect == 1)
	{
		theForm.action = theForm.action + "?todo=" + thisAct;
		theForm.submit();
	}
}

function doneEmF(theForm)
{
	theForm.action = "sendadd.asp";
	theForm.submit();	
}

function chkVote(theForm,pgid)
{
	ChkChoice = 0;
  	for (i=0; i <= 1; i++)
  	{
  		tmpV = "theForm.c["+i+"].checked";
  		if (eval(tmpV))
  		{
			ChkChoice = 1;
			if (pgid == 1)
				theForm.action = "javascript:popVote('polling/showpoll.asp?pollid=5&mychoice="+(i+1)+"')";
			else
				theForm.action = "javascript:popVote('../polling/showpoll.asp?pollid=5&mychoice="+(i+1)+"')";			
			theForm.submit();
			return (true);
		}
	}
  	
  	if (ChkChoice == 0)
  	{
	    	alert("Please make your vote!");
	    	theForm.c[0].focus();
	    	return (false);  		
	}
}

function validFS_en(theForm)
{
	noError = 1;
	
	if (theForm.searchme.value == "")
	{
		if ((theForm.smonth.options[theForm.smonth.selectedIndex].value == "") && (theForm.syear.options[theForm.smonth.selectedIndex].value == "") && (theForm.myIndustry_id.options[theForm.myIndustry_id.selectedIndex].value == -1))
		{
		    	alert("Please select any one of the search criteria.");
		    	theForm.myIndustry_id.focus();
		    	noError = 0;
		    	return (false);  		
		}
	}

	if ((theForm.smonth.options[theForm.smonth.selectedIndex].value != "") && (theForm.syear.options[theForm.smonth.selectedIndex].value == ""))
	{
	    	alert("Please select year.");
	    	theForm.syear.focus();
	    	noError = 0;
	    	return (false);  		
	}
	if ((theForm.syear.options[theForm.smonth.selectedIndex].value != "") && (theForm.smonth.options[theForm.smonth.selectedIndex].value == ""))
	{
	    	alert("Please select month.");
	    	theForm.smonth.focus();
	    	noError = 0;
	    	return (false);  		
	}

	if (noError == 1)
		return (true);
}

function validFS_tw(theForm)
{
	noError = 1;
	
	if (theForm.searchme.value == "")
	{
		if ((theForm.smonth.options[theForm.smonth.selectedIndex].value == "") && (theForm.syear.options[theForm.smonth.selectedIndex].value == "") && (theForm.myIndustry_id.options[theForm.myIndustry_id.selectedIndex].value == -1))
		{
		    	alert("½Ð¿ï¾Ü·j¯Á±ø¥ó.");
		    	theForm.myIndustry_id.focus();
		    	noError = 0;
		    	return (false);  		
		}
	}

	if ((theForm.smonth.options[theForm.smonth.selectedIndex].value != "") && (theForm.syear.options[theForm.smonth.selectedIndex].value == ""))
	{
	    	alert("½Ð¿ï¾Ü¦~¥÷.");
	    	theForm.syear.focus();
	    	noError = 0;
	    	return (false);  		
	}
	if ((theForm.syear.options[theForm.smonth.selectedIndex].value != "") && (theForm.smonth.options[theForm.smonth.selectedIndex].value == ""))
	{
	    	alert("½Ð¿ï¾Ü¤ë¥÷.");
	    	theForm.smonth.focus();
	    	noError = 0;
	    	return (false);  		
	}

	if (noError == 1)
		return (true);
}

function validFS_cn(theForm)
{
	noError = 1;
	
	if (theForm.searchme.value == "")
	{
		if ((theForm.smonth.options[theForm.smonth.selectedIndex].value == "") && (theForm.syear.options[theForm.smonth.selectedIndex].value == "") && (theForm.myIndustry_id.options[theForm.myIndustry_id.selectedIndex].value == -1))
		{
		    	alert("ÇëÑ¡ÔñËÑË÷Ìõ¼þ.");
		    	theForm.myIndustry_id.focus();
		    	noError = 0;
		    	return (false);  		
		}
	}

	if ((theForm.smonth.options[theForm.smonth.selectedIndex].value != "") && (theForm.syear.options[theForm.smonth.selectedIndex].value == ""))
	{
	    	alert("ÇëÑ¡ÔñÄê·Ý.");
	    	theForm.syear.focus();
	    	noError = 0;
	    	return (false);  		
	}
	if ((theForm.syear.options[theForm.smonth.selectedIndex].value != "") && (theForm.smonth.options[theForm.smonth.selectedIndex].value == ""))
	{
	    	alert("ÇëÑ¡ÔñÔÂ·Ý.");
	    	theForm.smonth.focus();
	    	noError = 0;
	    	return (false);  		
	}

	if (noError == 1)
		return (true);
}

function validateQnaire(theForm)
{
	// q3
	theForm.q3list.value = "";
	
	for (i=1; i <= 8; i++)
	{
		tmpV1 = "theForm.q3a"+i+".checked";
		if (eval(tmpV1))
		{
			if (theForm.q3list.value != "")
			theForm.q3list.value += ",";
				  			
			tmpV2 = "theForm.q3a"+i+".value";
			theForm.q3list.value += eval(tmpV2);
		}
	}

	// q4
	theForm.q4list.value = "";
	
	for (i=1; i <= 5; i++)
	{
		tmpV1 = "theForm.q4a"+i+".checked";
		if (eval(tmpV1))
		{
			if (theForm.q4list.value != "")
			theForm.q4list.value += ",";
				  			
			tmpV2 = "theForm.q4a"+i+".value";
			theForm.q4list.value += eval(tmpV2);
		}
	}
	
	// q9
	theForm.q9list.value = "";
	
	for (i=1; i <= 5; i++)
	{
		tmpV1 = "theForm.q9a"+i+".checked";
		if (eval(tmpV1))
		{
			if (theForm.q9list.value != "")
			theForm.q9list.value += ",";
				  			
			tmpV2 = "theForm.q9a"+i+".value";
			theForm.q9list.value += eval(tmpV2);
		}
	}

	// q10
	theForm.q10list.value = "";
	
	for (i=1; i <= 11; i++)
	{
		tmpV1 = "theForm.q10a"+i+".checked";
		if (eval(tmpV1))
		{
			if (theForm.q10list.value != "")
			theForm.q10list.value += ",";
				  			
			tmpV2 = "theForm.q10a"+i+".value";
			theForm.q10list.value += eval(tmpV2);
		}
	}			
}

function checkWhichSearch(theForm,whichLang)
{
	toChange = ""
	toGo = 1;
	if (whichLang == 1)
	{
		if (theForm.q.value == "")
		{
			    alert("Please enter one or more search terms in the search box.");
			    theForm.q.focus();
			    toGo = 0;
		}
			
		toChange = "/eng/"
	}	
	else if (whichLang == 2)
	{
		if (theForm.q.value == "")
		{
			    alert("ÄãÎ´ÓÐÊäÈëËÑÑ°¹Ø¼ü×Ö£¬ÇëÖØÐÂÊäÈë¡£");
			    theForm.q.focus();
			    toGo = 0;
		}
		toChange = "/simp/"
	}
	else if (whichLang == 3)
	{
		if (theForm.q.value == "")
		{
			    alert("§A¥¼¦³¿é¤J·j´MÃöÁä¦r¡A½Ð­«·s¿é¤J¡C");
			    theForm.q.focus();
			    toGo = 0;
		}
		toChange = "/trad/"
	}
	
	if (toGo == 1)	
	{
		if (theForm.whichSection.options[theForm.whichSection.selectedIndex].value == "0")
			theForm.action = toChange + "se/se.asp";
		else if (theForm.byGoogle.checked)
			theForm.action = toChange + "se/se.asp";
		else
			theForm.action = toChange + "se/ourse.asp";
			
		theForm.submit();
	}
}

function chkVoteNew(theForm,pgid)
{
	ChkChoice = 0;
  	for (i=0; i <= theForm.NoChoice.value; i++)
  	{
  		tmpV = "theForm.c["+i+"].checked";
  		if (eval(tmpV))
  		{
			ChkChoice = 1;
			if (pgid == 1)
				theForm.action = "javascript:popQuiz('onlinevote/thank.asp?voteid="+theForm.Voteid.value+"&c="+(i+1)+"')";
			else
				theForm.action = "javascript:popQuiz('../onlinevote/thank.asp?voteid="+theForm.Voteid.value+"&c="+(i+1)+"')";			
			theForm.submit();
			return (true);			
		}
	}
  	
  	if (ChkChoice == 0)
  	{
	    	alert("Please make your vote!");
	    	theForm.c[0].focus();
	    	return (false);  		
	}
}

function chkVoteNewFull(theForm,pgid)
{
	ChkChoice = 0;
  	for (i=0; i <= theForm.NoChoice.value; i++)
  	{
  		tmpV = "theForm.c["+i+"].checked";
  		tmpV1 = "theForm.c["+i+"].value";
  		if (eval(tmpV))
  		{
			ChkChoice = 1;
			if (i>=0 && i <=3)
				myVoteid = 1;
			else if (i>=4 && i <=7)
				myVoteid = 2;
			else if (i>=8 && i <=11)
				myVoteid = 3;
			else if (i>=12 && i <=14)
				myVoteid = 4;
			else if (i>=15 && i <=17)
				myVoteid = 5;
				
			theForm.action = "javascript:popQuizFull('thank1.asp?voteid="+myVoteid+"&c="+eval(tmpV1)+"')";			
			theForm.submit();
			return (true);			
		}
	}
  	
  	if (ChkChoice == 0)
  	{
	    	alert("Please make your vote!");
	    	theForm.c[0].focus();
	    	return (false);  		
	}
}

function gotoAdv(thisLang,thisMag)
{
	if (thisLang == 1)
	{
			if (thisMag == "CAJ")
			{
				//CAJ
				parent.location.replace("/pub/en/caj/enquiry3.asp");
			}
			else if (thisMag == "CMJ")
			{
				//CMJ
				parent.location.replace("/pub/en/cmj/enquiry3.asp");
			}
			else if (thisMag == "CPRJ")
			{
				//CPRJ
				parent.location.replace("/pub/en/cprj/enquiry3.asp");
			}
			else if (thisMag == "PP")
			{
				//PP
				parent.location.replace("/pub/en/pp/enquiry3.asp");
			}
			else if (thisMag == "ATACTA")
			{
				//ATA CTA
				parent.location.replace("/pub/en/ata/enquiry3.asp");
			}	
	}
	else if (thisLang == 2)
	{
			if (thisMag == "CAJ")
			{
				//CAJ
				parent.location.replace("/pub/tw/caj/enquiry3.asp");
			}
			else if (thisMag == "CMJ")
			{
				//CMJ
				parent.location.replace("/pub/tw/cmj/enquiry3.asp");
			}
			else if (thisMag == "CPRJ")
			{
				//CPRJ
				parent.location.replace("/pub/tw/cprj/enquiry3.asp");
			}
			else if (thisMag == "PP")
			{
				//PP
				parent.location.replace("/pub/tw/pp/enquiry3.asp");
			}
			else if (thisMag == "ATACTA")
			{
				//ATA CTA
				parent.location.replace("/pub/tw/ata/enquiry3.asp");
			}	
	}
	else if (thisLang == 3)
	{
			if (thisMag == "CAJ")
			{
				//CAJ
				parent.location.replace("/pub/cn/caj/enquiry3.asp");
			}
			else if (thisMag == "CMJ")
			{
				//CMJ
				parent.location.replace("/pub/cn/cmj/enquiry3.asp");
			}
			else if (thisMag == "CPRJ")
			{
				//CPRJ
				parent.location.replace("/pub/cn/cprj/enquiry3.asp");
			}
			else if (thisMag == "PP")
			{
				//PP
				parent.location.replace("/pub/cn/pp/enquiry3.asp");
			}
			else if (thisMag == "ATACTA")
			{
				//ATA CTA
				parent.location.replace("/pub/cn/ata/enquiry3.asp");
			}	
	}		
}

function mail() { 
	var t = new Date(); at = "@"; subject = "Adsale enquiry (" + t.getYear() +"/" + (t.getMonth()+1) + "/" + t.getDate() + " "+ t.getHours() + ":" +t.getMinutes() + ":" + t.getSeconds() + ")"; window.location = "mailto:info06" + at + "EventTrip.com?subject=" +escape(subject);
}