	var u = document.URL; // split at protocol
	var myvar=new Array("lang","module","header","action","id","query1","query2","start","day","month","year","message","url","sg_id","s_id","txt_search","user_search","submit","txtsearch","languges","members","operationtype","operationtitle","bday","bmonth","byear","eday","emonth","eyear","ipaddress","go","lang","ms_id","type","query3","u_name","u_id","locale","option","bfile","fname","chgorder","import","page","orderby");
	var a=u.toLowerCase();
	//alert(a);
	a.toLowerCase();
	//alert(a);
	var pos=a.indexOf('?');
	if (pos>0) 
	{
		var len=a.length;
		arr1=a.substring(pos+1,len);
		if (arr1.length>0)
		{
			var arrsplit = new Array();
			arrsplit = arr1.split('&');
			var i;
			for (i in arrsplit)
			{
				var isexist="0";
				var piece = new Array();
				piece = arrsplit[i].split('=');
				var j;
				for (j in myvar)
				{
					if (piece[0]==myvar[j])
					{
						isexist="1";
					}
				}
				if (isexist=="0")
				{
					//alert("1");
					window.location='error.htm';
					break;
				}
				switch(piece[0])
				{
				case "lang":
					var myarr=new Array("en_us","def",""," ","farsi","english");
					var k;
					isexistval="0";
					for (k in myarr)
					{
						if (piece[1]==myarr[k])
						{
							isexistval="1";
						}
					}
					if (isexistval=="0")
					{
						//alert("2");
						window.location='error.htm';
						break;
					}
				  break;    
				case "module":
					var myarr=new Array(""," ","index.html","internalpage","news","gallery","service","poll","reserve","reserveform","service","faqs","user","sitemap","contactus","search");
					var k;
					isexistval="0";
					for (k in myarr)
					{
						if (piece[1]==myarr[k])
						{
							isexistval="1";
						}
					}
					if (isexistval=="0")
					{
						//alert("3");
						window.location='error.htm';
						break;
					}
				  break; 
				  case "header":
					var myarr=new Array(""," ","showindex");
					var k;
					isexistval="0";
					for (k in myarr)
					{
						if (piece[1]==myarr[k])
						{
							isexistval="1";
						}
					}
					if (isexistval=="0")
					{
						//alert("4");
						window.location='error.htm';
						break;
					}
				  break; 
				  case "action":
					var myarr=new Array(""," ","show","insertuser","insertservice","editservice","editgservice","editpanel","insertnews","editnews","editgnews","newmessage","emptylog","exportexcel","list_subpage","editinternalpage","addinternalpage","insertuser","sendmessage","edit","insert","insertgallery","editfilesofgallery","editgallery","edit","csspanel","csscomponent","cssgloballink","cssotherpage","cssmainpage","cssglobalconfig","configuration_link","configuration","list","submit","showarchive","listarchive","show","insert","showimage","search","showarchive","listarchive","showinfo","reserve","send","edituser","list","showreserve","showchangereserve","changereserve","sendchangereserveform","show","checkpass","showarchive","listarchive","update","result","search","show","search","showarchive","listarchive","login","new","register","forgetpassword","sendforgetpasswordlink","listarchive","update","sendcontactmail","deletemessage","show","logout","showarchive","insert","edit","insertuser","updatestate","search","report","delete","reportchangereserve","changeform","editreport","exportexcel","emptylog","insertmessage","details","insertuser");
					var k;
					isexistval="0";
					for (k in myarr)
					{
						if (piece[1]==myarr[k])
						{
							isexistval="1";
						}
					}
					if (isexistval=="0")
					{
						//alert("5");
						window.location='error.htm';
						break;
					}
				  break; 
				  case "id":
				  if (piece[1]/2 || piece[1] == 0)
 					 piec = parseInt(i);
				  if !(typeof piec=="number" || piece[1]=="" || piece[1]==" ")
				  {
					  //alert("dd");
					window.location='error.htm';
					break;
				  }
				  break; 
				  case "query1":
					var myarr=new Array("0","1",""," ","noneof","messagenoarchive","messagearchive");
					var k;
					isexistval="0";
					for (k in myarr)
					{
						if (piece[1]==myarr[k])
						{
							isexistval="1";
						}
					}
					if (isexistval=="0")
					{
						//alert("7");
						window.location='error.htm';
						break;
					}
				  break; 
				  case "query2":
					var myarr=new Array("0","1",""," ","secure","show");
					var k;
					isexistval="0";
					for (k in myarr)
					{
						if (piece[1]==myarr[k])
						{
							isexistval="1";
						}
					}
					if (isexistval=="0")
					{
						//alert("8");
						window.location='error.htm';
						break;
					}
				  break; 
				  case "start":
					  if (piece[1]/2 || piece[1] == 0)
 					  piec = parseInt(i);
					  if !(typeof piec=="number" || piece[1]=="" || piece[1]==" " )
					  {
						  //alert("1");
						window.location='error.htm';
						break;
					  }
				  break; 
				  case "day":
					  if (piece[1]/2 || piece[1] == 0)
 					  piec = parseInt(i);
					  if !(typeof piec=="number" || piece[1]=="" || piece[1]==" " )
					  {
						    //alert("2");
						window.location='error.htm';
						break;
					  }
				  break; 
				  case "month":
					  if (piece[1]/2 || piece[1] == 0)
 					  piec = parseInt(i);
					  if !(typeof piec=="number" || piece[1]=="" || piece[1]==" " )
					  {
						    //alert("3");
						window.location='error.htm';
						break;
					  }
				  break; 
				   case "year":
					  if (piece[1]/2 || piece[1] == 0)
 					  piec = parseInt(i);
					  if !(typeof piec=="number" || piece[1]=="" || piece[1]==" " )
					  {
						    //alert("4");
						window.location='error.htm';
						break;
					  }
				  break; 
				default:
				 
				}
			}
		}
	}
