
function SelectMonths(select)
	{
	
		var countryID = 0;
		
		var monthsID = 0;
		
		if( select == "2")
		{
			countryID = document.getElementById("selectCountry").value;
			
			monthsID = document.getElementById("selectMonth").value;
			
			if(monthsID < 0 || monthsID > 12 || isNaN(monthsID))
			{
					monthsID = 0 ;
			}
			if(isNaN(countryID))
			{
				return;
			}
			else
			{
				
				if(isNaN(countryID) || countryID < 0 || countryID > 241 )
				{
					return;
				}
			}
		}
		
		if( select == "1")
		{
			 monthsID = document.getElementById("selectMonth").value;
			 
			countryID = document.getElementById("selectCountry").value;
			
			if(countryID < 1 || countryID > 241)
			{
					countryID = 0 ;
			}
			
			if(isNaN(monthsID))
			{
				return;
			}
			else
			{
				
				if(monthsID < 0 || monthsID > 12)
				{
					return;
				}
			}
			
		}
		
		var url = "TradeShowList"+UrlEncode(" ")+"-"+GE("txtIndustries").value+"-"+monthsID+"-"+countryID+"-1.html";

		location.href=url;		
	}
	
	function SendSingleMail(id)
	{
		GE("txtSelectTrade").value = ","+id+","; 
		GE('Form1').submit();
		
	}
	
	function SendMail()
	{ 
		var eleList = document.getElementsByTagName("input");
		
		var select = ","; 
		
		for (var i=0;i<eleList.length;i++)
		{		
			var Obj=eleList[i];
			
			if(Obj.id.indexOf('check_') >= 0)
			{
				if(Obj.type == "checkbox")
				{
					if(Obj.checked == true)
					{
						if(select.indexOf(Obj.value + ",") < 0)
						{
							
							select+=Obj.value + ","
						}
						
					}
					
				}
			} 
		}
		
		GE("txtSelectTrade").value = select; 
		
		return select;
	}
	
	function ResponseEmail()
	{
		var select = SendMail();
		
		if( select == "," || select == "")
		{
			alert( "Please select one item(s)." );
		}
		else
		{
			location.href= "ContactOrganizer" + ClearUrlString( UrlEncode(select) ) + ".html";
		}
	
	}
	
	function ResponsePage()
	{
		
		var key = document.getElementById("TradeSearch1_tradeSearch_Input").value;
		
		var industries = document.getElementById("TradeSearch1_tradeSearch_selectIndustries").value.replace(/(^\s*)|(\s*$)/g, "").replace(/\s+/g,'_').replace("&","l_l");
		
		var countryID = document.getElementById("TradeSearch1_tradeSearch_selectLocations").value;
		
		var monthsID = document.getElementById("TradeSearch1_tradeSearch_selectMonths").value;
		
		var pageIndex = document.getElementById("txtInput").value;
		
		if(isNaN(pageIndex))
		{
			alert("Please input valid page number!");
			
			return;
			
		}
		else
		{
			if(pageIndex < 1)
			{
				pageIndex = 1;
			}
		}
		
		key = ClearUrlString( UrlEncode(key) );
		
		if( key == "" || key.length > 50)
		{
			key =UrlEncode(" ");
		}
		
		if( industries == "" || industries.length > 50)
		{
			industries =UrlEncode(" ");
		}
		
		if(monthsID < 1 || monthsID > 12 || isNaN(monthsID))
		{
			monthsID = 0 ;
		}
		
		if(countryID < 1 || countryID > 241 || isNaN(countryID))
		{
			countryID = 0 ;
		}
		
		var url = "TradeShowList"+key+"-"+industries+"-"+monthsID+"-"+countryID+"-"+pageIndex+".html";

		location.href=url;
		
	}
	
	function SelectedByCheckBox(id)
	{
	
		var oper = GE(id).checked;
		
		GE(id).checked = oper;
		
		SelectedAllOrClearAll(oper);
		
	}
	
	function SelectedAllOrClearAll(oper)
	{
		GE("checkboxTop").checked = oper;
		GE("checkboxFoot").checked = oper;
		var eleList = document.getElementsByTagName("input");
		
		var select = ","; 
		
		for (var i=0;i<eleList.length;i++)
		{		
			var Obj=eleList[i];
			
			if(Obj.id.indexOf('check_') >= 0)
			{
				if(Obj.type == "checkbox")
				{
				
					Obj.checked = oper;
					
				}
			} 
		}
		
		SendMail();
	
	}