

String.prototype.tokenize = tokenize;
var interval = 2.5; // delay between rotating images (in seconds)
		var random_display = 0; // 0 = no, 1 = yes
		interval *= 1000;
		
		var image_index = 0;
function tokenize()
  {
     var input             = "";
     var separator         = " ";
     var trim              = "";
     var ignoreEmptyTokens = true;

     try {
       String(this.toLowerCase());
     }
     catch(e) {
       window.alert(invalidUtokenizer);
       return;
     }

     if(typeof(this) != "undefined")
       {
          input = String(this);
       }

     if(typeof(tokenize.arguments[0]) != "undefined")
       {
          separator = String(tokenize.arguments[0]);
       }

     if(typeof(tokenize.arguments[1]) != "undefined")
       {
          trim = String(tokenize.arguments[1]);
       }

     if(typeof(tokenize.arguments[2]) != "undefined")
       {
	   
          if(!tokenize.arguments[2])
            ignoreEmptyTokens = false;
       }
	
	   
     var array = input.split(separator);

     if(trim)
       for(var i=0; i<array.length; i++)
         {
           while(array[i].slice(0, trim.length) == trim)
             array[i] = array[i].slice(trim.length);
           while(array[i].slice(array[i].length-trim.length) == trim)
             array[i] = array[i].slice(0, array[i].length-trim.length);
         }

     var token = new Array();
     if(ignoreEmptyTokens)
       {
          for(var i=0; i<array.length; i++)
            if(array[i] != "")
              token.push(array[i]);
       }
     else
       {
          token = array;
       }

     return token;
  }

function TimeToSeconds(time)
{
	var time2=0;
	var time1;
	if(time !=null && time!='undefined')
	{
	time1=time.tokenize(":"," ",false);
	time2 = parseInt(time1[0]*60*60,10)+parseInt(time1[1]*60,10);
	return time2;
	}
}



function getCookieVal (offset) {
   var endstr = document.cookie.indexOf (";", offset);

   if ( endstr == -1 )
      endstr = document.cookie.length;
   return(unescape(document.cookie.substring(offset, endstr)));
}

function encrypt(str, pwd) 
	{
	  if(pwd == null || pwd.length <= 0) {
		return null;
	  }
	  var prand = "";
	  for(var i=0; i<pwd.length; i++) {
		prand += pwd.charCodeAt(i).toString();
	  }
	  var sPos = Math.floor(prand.length / 5);
	  var mult = parseInt(prand.charAt(sPos) + prand.charAt(sPos*2) + prand.charAt(sPos*3) + prand.charAt(sPos*4) + prand.charAt(sPos*5));
	  var incr = Math.ceil(pwd.length / 2);
	  var modu = Math.pow(2, 31) - 1;
	  if(mult < 2) {
		return null;
	  }
	  var salt = Math.round(Math.random() * 1000000000) % 100000000;
	  prand += salt;
	  while(prand.length > 10) {
		prand = (parseInt(prand.substring(0, 10)) + parseInt(prand.substring(10, prand.length))).toString();
	  }
	  prand = (mult * prand + incr) % modu;
	  var enc_chr = "";
	  var enc_str = "";
	  for(var i=0; i<str.length; i++) {
		enc_chr = parseInt(str.charCodeAt(i) ^ Math.floor((prand / modu) * 255));
		if(enc_chr < 16) {
		  enc_str += "0" + enc_chr.toString(16);
		} else enc_str += enc_chr.toString(16);
		prand = (mult * prand + incr) % modu;
	  }
	  salt = salt.toString(16);
	  while(salt.length < 8)salt = "0" + salt;
	  enc_str += salt;
	  return enc_str;
	}


function decrypt(str, pwd) 
	{
	  if(str == null || str.length < 8) {
		return;
	  }
	  if(pwd == null || pwd.length <= 0) {
		return;
	  }
	  var prand = "";
	  for(var i=0; i<pwd.length; i++) {
		prand += pwd.charCodeAt(i).toString();
	  }
	  var sPos = Math.floor(prand.length / 5);
	  var mult = parseInt(prand.charAt(sPos) + prand.charAt(sPos*2) + prand.charAt(sPos*3) + prand.charAt(sPos*4) + prand.charAt(sPos*5));
	  var incr = Math.round(pwd.length / 2);
	  var modu = Math.pow(2, 31) - 1;
	  var salt = parseInt(str.substring(str.length - 8, str.length), 16);
	  str = str.substring(0, str.length - 8);
	  prand += salt;
	  while(prand.length > 10) {
		prand = (parseInt(prand.substring(0, 10)) + parseInt(prand.substring(10, prand.length))).toString();
	  }
	  prand = (mult * prand + incr) % modu;
	  var enc_chr = "";
	  var enc_str = "";
	  for(var i=0; i<str.length; i+=2) {
		enc_chr = parseInt(parseInt(str.substring(i, i+2), 16) ^ Math.floor((prand / modu) * 255));
		enc_str += String.fromCharCode(enc_chr);
		prand = (mult * prand + incr) % modu;
	  }
	  return enc_str;
}

function validateEmail(str)
{
	    var str=trim(str);    //balu on 07/01/09
		var at="@";
		var dot=".";
		var lat=str.indexOf(at);
		var lstr=str.length;
		var ldot=str.indexOf(dot);
		
		if (str.indexOf(at)==-1){
		//   alert("Invalid E-mail ID");
		   return false;
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		 //  alert("Invalid E-mail ID");
		   return false;
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		  //  alert("Invalid E-mail ID");
		    return false;
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		 //   alert("Invalid E-mail ID");
		    return false;
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		 //   alert("Invalid E-mail ID");
		    return false;
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		  //  alert("Invalid E-mail ID");
		    return false;
		 }
		
		 if (str.indexOf(" ")!=-1){
		 //   alert("Invalid E-mail ID");
		    return false;
		 }

 		 return true;				
}



function trimAll( strValue ) {
/************************************************
DESCRIPTION: Removes leading and trailing spaces.

PARAMETERS: Source string from which spaces will
  be removed;

RETURNS: Source string with whitespaces removed.
*************************************************/ 
 var objRegExp = /^(\s*)$/;

    //check for all spaces
    if(objRegExp.test(strValue)) {
       strValue = strValue.replace(objRegExp, '');
       if( strValue.length == 0)
          return strValue;
    }
    
   //check for leading & trailing spaces
   objRegExp = /^(\s*)([\W\w]*)(\b\s*$)/;
   if(objRegExp.test(strValue)) {
       //remove leading and trailing whitespace characters
       strValue = strValue.replace(objRegExp, '$2');
    }
  return strValue;
}



	function onEnter(param,e)
		{
			var keyNo="";
			if(window.event)
				keyNo=window.event.keyCode;
			else
				keyNo=e.which
			if(keyNo==13)
			{
				
				if(param=='allSearch')
				{
					   searchNew(param);
					   ChangeLocation();
				}
				if(param=='allSearchnew')
				{	
						document.forms["RestaurantSelectionForm"].searchCountry.value=document.getElementById("searchCountrynew").value;
						document.forms["RestaurantSelectionForm"].searchPostcode.value=document.getElementById("middlesearchPostcode").value;				   
					
				    searchNew('allSearch');
				    ChangeLocation();
				}
				if(param=='allSearchnew1')
				{
						document.forms["RestaurantSelectionForm"].searchCountry.value=document.getElementById("searchCountrynew1").value;
						document.forms["RestaurantSelectionForm"].searchPostcode.value=document.getElementById("middlesearchPostcode1").value;
						searchNew('allSearch');
				    	ChangeLocation();
				}
			   if(param=='sortItems')
					getSortedItems();
			  
			   if(param=='allSearchInd')
				{
					   searchNewInd('allSearch');					  
				}	
			
    		}
		}

function getRemValues()
	{
	   
	  
		var user=GetCookie('cacUser');
		var pass=decrypt(GetCookie('cacPassword'),"123456789123");
		if(document.forms[1].userName!=null && user!=null)
		{
		    document.forms[1].userName.value=user;
			document.forms[1].password.value=pass;
		}else
		{
		document.forms["LoginInfoForm"].userName.value="username";
		document.forms["LoginInfoForm"].password.value="password";
	    }
	
	}
function getMain()
{
		var mainwin;

		if(window.name=="" || window.name=="main")
		{
			mainwin=this;
	  	}
	   	else if(window.name=="Details1234" || window.name=="OrderTime")
	   	{
	   	  	mainwin=window.opener;
	   	}
	  	else if(window.name=="OrderTime3")	
	  	{
	  		mainwin=window.opener.opener;
	  	}
	  	return mainwin;
}
function setpostcode(pcode)
{
		document.forms[0].searchPostcode.value =pcode;
		searchNew('allsearch');
}	

	function loginClicked(a)
	{
	
	 var visitortime = new Date();
	 var tz=(visitortime.getTimezoneOffset()/60)*(-1);
	 var sloc="";
	  if(document.forms[0].blocationName!=null)
	  {
		 sloc=document.forms[0].blocationName[document.forms[0].blocationName.selectedIndex].text;
	
	  }

	if(a=="login")
	{
		var mikExp = /[$\\@\\\#%\^\&\*\(\)\[\]\+\_\{\}\`\~\=\.\,\;\'\"\:\[0-9]|]/;
		if(document.forms[1].userName.value == "" || document.forms[1].userName.value==null)	
			{
				alert("Please enter UserName.");
				document.forms[1].userName.focus();
			}
		else 
		if(document.forms[1].password.value == "" || document.forms[1].password.value==null)
		{
			alert("Please enter Password.");
			document.forms[1].password.focus();
			
		}
		else
		if(mikExp.test(document.forms[1].userName.value.substring(0,1))&& !(document.forms[1].userName.value == "")&&!(document.forms[1].userName.value == null))
		{
			alert("User Id   -- First letter should be character")
			document.forms[1].userName.focus();
		}
		else
		{
			if(document.forms[1].checkRemind.checked)
			{
				
				 var days=20;
	 			 var expires = new Date ();
    		    expires.setTime(expires.getTime() + days * (24 * 60 * 60 * 1000)); 
				var date= new Date();
				date.setYear(parseInt(date.getYear(),10)+2)
				var name=encrypt( document.forms[1].password.value,"123456789123")
				SetCookie('cacUser',document.forms[1].userName.value,expires,"/");
				SetCookie('cacPassword',encrypt( document.forms[1].password.value,"123456789123"),expires,"/");
			}
		
			document.forms[1].ordertype.value=a;
			document.forms[1].timezone.value=tz;
			document.forms[1].action='Order.do?login=true';
			document.forms[1].submit();
		}
	}
  
     if(a=="allSearch")
	{
	 
	   var rstp="";
	   var searchWith="";
	   var message="";
	   
		var cuisine=document.forms[0].cuisine[document.forms[0].cuisine.selectedIndex].value;
		var dish=document.forms[0].dish.value;
		var restName=document.forms[0].restName.value;
		
		if(document.forms[0].takeaway.checked)
			rstp =1+"|";
	    if(document.forms[0].delivery.checked)
	        rstp +=2+"|";
		if(document.forms[0].online.checked)
			rstp +=3+"|";
		if(document.forms[0].restaurant.checked)//eatin
			rstp +=4+"|";
		if(rstp=="")
		rstp='1|2|3|4|';
	

	    if(document.forms[0].restCountry[document.forms[0].restCountry.selectedIndex].text=='Select')
		{
			alert("please select the country");
		    message="not Valid"
		}
		
			if(document.forms[0].postcode.value=="" && document.forms[0].searchName.value=="")
			{
				alert("Please Enter a Postcode or a Place");
				message="not valid";
			}
			if(document.forms[0].postcode.value!="" && document.forms[0].searchName.value!="")
			{
				alert("Please Search by One Parameter either postcode or place")
					message='not valid';
			}
		if(message=="")
		{
			if(document.forms[0].searchName.value!="")
				 searchWith='place';

			if(document.forms[0].postcode.value!="" )
				searchWith='postcode';
			
		}
		if(message=="" && searchWith!="")
		{
			document.forms[0].action="Order.do?ordertype="+a+"&timezone="+tz+"&shippingLoc="+sloc+"&resttype="+rstp+"&cuisine="+cuisine+"&searchWith="+searchWith+"&dish="+dish+'&restName='+restName;
			document.forms[0].submit();
		}
	}
	if(a=="postcode" || a=="dish" || a=="cuisine" || a=='sct'  )
	{
      var rstp="";
	  var status='true';
	  var dish="";
	  var statecitytown="";
	  var searchWith="";
	  
	  if(document.forms[0].restCountry[document.forms[0].restCountry.selectedIndex].text=='Select')
		{
			alert("please select the country");
		   status='false'
		}	

		if(document.forms[0].takeaway.checked)
			rstp =1+"|";
	    if(document.forms[0].delivery.checked)
	        rstp +=2+"|";
		if(document.forms[0].online.checked)
			rstp +=3+"|";
		if(document.forms[0].restaurant.checked)//eatin
			rstp +=4+"|";
		
      var cuisine=document.forms[0].cuisine[document.forms[0].cuisine.selectedIndex].value;

		if(a=="dish")
		{
	
			if(document.forms[0].dish.value == "")
			{
				clearOrder();
				alert("Please enter dish.");
				document.forms[0].dish.focus();
				
				status='false';
			}
			else
			{
				dish=document.forms[0].dish.value;
			}
				
		}
		
		

		if(a!='sct' && document.forms[0].postcode.value == "")
		{
			alert("Please enter postcode.");
			document.forms[0].postcode.focus();
			status='false';
			
		}

		if(a=='sct')
		{
           statecitytown=document.forms[0].searchName.value;
		}
		if(a!='sct')
		if(document.forms[0].postcode!=null || document.forms[0].searchName!=null)
			{
				if(document.forms[0].postcode.value=="" && document.forms[0].searchName.value=="")
				{
					alert("Please Enter a Postcode or a Place");
					message="not valid";
				}
				if(document.forms[0].postcode.value!="" && document.forms[0].searchName.value!="")
				{
					alert("Please Search by One Parameter either postcode or place")
						message='not valid';
				}
				if(document.forms[0].searchName.value!="" && document.forms[0].postcode=="")
					 searchWith='place';
				if(document.forms[0].postcode!="" && document.forms[0].searchName.value=="")
					searchWith='postcode';
			
			}
	  
		if(status=='true' && searchWith!="")
		{
			clearOrder();
			if(a=='dish')
			document.forms[0].action="Order.do?ordertype="+a+"&searchValue="+dish+"&timezone="+tz+"&shippingLoc="+sloc+"&resttype="+rstp+"&cuisine="+cuisine+"&searchWith="+searchWith;
			if(a=='sct')
				document.forms[0].action="Order.do?ordertype="+a+"&searchValue="+statecitytown+"&timezone="+tz+"&shippingLoc="+sloc+"&resttype="+rstp+"&cuisine="+cuisine+"&searchWith="+searchWith;
		  	else
			document.forms[0].action="Order.do?ordertype="+a+"&searchValue="+cuisine+"&timezone="+tz+"&shippingLoc="+sloc+"&resttype="+rstp+"&cuisine="+cuisine+"&searchWith="+searchWith;

			document.forms[0].submit();
		}
	}
}
function funEnter(a,e)

{
	var key;
 	if(window.event)
          key = window.event.keyCode;     //IE
     else
          key = e.which;     //firefox

    
	if(key== 13)
	{
		e.Handled=true;
	  loginClicked(a);
	 return false;
	}
}
function funEnternew(a,e)

{
	var key;
   e.eventStop();
	if(window.event)
          key = window.event.keyCode;     //IE
     else
          key = e.which;     //firefox

    
	if(key== 13)
	{
		e.handled=true;
	  loginClicked2(a)
	}
}


function getIndexTotalPages()
				{  
					  document.forms[1].indexnextVal.value = "0";
					  document.forms[1].indexparam.value="change";
					  document.forms[1].action="first.do?indexlimit=page";
					  document.forms[1].submit();
				}
			function indexNext1()
			{
				var val1 = parseInt(document.forms[1].indextotLocations.value,10)
				var val2 = parseInt(document.forms[1].indexnextVal.value,10)
				var val3 = parseInt(document.forms[1].indexhidTotalPages.value,10)
					if((val2+val3)<val1)
					{
						document.forms[1].action="first.do?indexlimit=next";
						document.forms[1].submit();
					}
					else
					{
						
					}
			}	
		function showpages(value,value1)
		{
			
			document.forms[1].indexnextVal.value=value;
			document.forms[1].action="first.do?indexlimit=frontpage&selectedIndex="+value1;
			document.forms[1].submit();
			
		}	
			
			
function indexStart1()
		{
				document.forms[1].action="first.do?indexlimit=start";
				document.forms[1].submit();
		}

		function indexEnd1()
		{
				document.forms[1].action="first.do?indexlimit=end";
				document.forms[1].submit();
		}
		function indexPrev1()
		{
			var val1 = parseInt(document.forms[1].indextotLocations.value,10)
			var val2 = parseInt(document.forms[1].indexnextVal.value,10)
			var val3 = parseInt(document.forms[1].indexhidTotalPages.value,10)
			if(val2>=val3)
			{
				document.forms[1].action="first.do?indexlimit=prev";
				document.forms[1].submit();
			}
			else
			{
				
			}
		}


function upperSearchNew()
{
						document.forms["RestaurantSelectionForm"].searchCountry.value=document.getElementById("searchCountrynew").value;
						document.forms["RestaurantSelectionForm"].searchPostcode.value=document.getElementById("middlesearchPostcode").value;				   
						searchNew('allSearch');
				    	ChangeLocation();
}
function bottomSearchNew()
{
						document.forms["RestaurantSelectionForm"].searchCountry.value=document.getElementById("searchCountrynew1").value;
						document.forms["RestaurantSelectionForm"].searchPostcode.value=document.getElementById("middlesearchPostcode1").value;
						searchNew('allSearch');
				    	ChangeLocation();
}	
function ChangeLocation()
{
	if(document.forms["RestaurantSelectionForm"].shipLocName!=null)
		document.forms["RestaurantSelectionForm"].shipLocName.value="select";
}

//mar25 anvesh
function indexChangeLocation()
{
	var cntry=document.forms[0].searchCountry.value;
	document.forms[1].searchCountry.value=cntry;
	if(cntry!=null)
	{
		new Ajax.Updater("countrypostcodes", "first.do?countrysearch="+cntry, {onComplete:function(){},asynchronous:false, evalScripts:true});
	}
	
}
  function funRegister(type)
{

	document.forms[0].action="register.do?newUser=new&registertype="+type;
	document.forms[0].submit();
		
} 
   
   function searchNew(a)
	{
		var formType="restaurantForm";
		var rstp="";
		var message="";
		var word="";
		var searchWith="";
		var postcode="";
		var place="";
		var dish="";
		var country="";
		var restName="";
		var searchlocations="";
		errorMessage1="";
		errorMessage=errorMessage1;
		var	status=true;
		var visitortime = new Date();
	    var timezone=(visitortime.getTimezoneOffset()/60)*(-1);
		var cuisine= document.getElementById("restSelectFormMain").cuisineTypes.value;
		if(document.getElementById("restSelectFormMain").dishValue.value!="" && document.getElementById("restSelectFormMain").dishValue.value!=null)
			dish= document.getElementById("restSelectFormMain").dishValue.value.replace(/'/,"")
		if(document.getElementById("restSelectFormMain").searchRest.value!="" && document.getElementById("restSelectFormMain").searchRest.value!=null);
		   restName= document.getElementById("restSelectFormMain").searchRest.value;
		if(document.getElementById("restSelectFormMain").takeaway1.checked==true){
				rstp =1+"|";
				 document.getElementById("takeaway1").value=true;
		}
		else
			 document.getElementById("takeaway1").value=false;
		
		if( document.getElementById("restSelectFormMain").delivery1.checked==true){
				rstp +=2+"|";
			 document.getElementById("delivery1").value=true;
		}
		else
			 document.getElementById("delivery1").value=false;
    
    	if( document.getElementById("restSelectFormMain").restaurant1.checked==true)//eatin
		{		rstp +=3+"|";
		 document.getElementById("restaurant1").value=true;
		}
		else
			 document.getElementById("restaurant1").value=false;
			
		if(document.getElementById("restSelectFormMain").onlinedel1!=null && document.getElementById("restSelectFormMain").onlinedel1.checked==true){
				rstp +=4+"|";
				document.getElementById("onlinedel1").value=true;
		}
		else
			 document.getElementById("onlinedel1").value=false;
			 
        if(document.getElementById("restSelectFormMain").onlinecol1!=null && document.getElementById("restSelectFormMain").onlinecol1.checked==true){
				rstp +=5+"|";
				document.getElementById("onlinecol1").value=true;
		}
		else
			 document.getElementById("onlinecol1").value=false;

		if(rstp=="")
			rstp='1|2|3|4|5';
		 document.getElementById("restSelectFormMain").restaurantsType.value=rstp;
		if(document.getElementById("restSelectFormMain").shipLocName!=null)
		{
			country= document.getElementById("restSelectFormMain").shipLocName.value;
        searchlocations = document.getElementById("restSelectFormMain").shipLocName.value;
         }
        
          if(document.getElementById("restSelectFormMain").searchCountry!=null)
        {
	   	if( document.getElementById("restSelectFormMain").searchCountry[ document.getElementById("restSelectFormMain").searchCountry.selectedIndex].text=='Select')
			{
				errorMessage+="please select the country\n\n";	
			  if(status)
						{
							status=false;
						}
			  message="not valid";
			}
			else
			country= document.getElementById("restSelectFormMain").searchCountry.value;
          }
			if( document.getElementById("restSelectFormMain").searchPostcode.value=="" &&  document.getElementById("restSelectFormMain").stateCityTown.value=="")
			{
				errorMessage+="Please Enter a Postcode or a Place\n\n";	
					if(status)
						{
						if(document.getElementById("restSelectFormMain").formType!=null)
							{
								if(document.getElementById("restSelectFormMain").formType.value!="cuisineForm")//srikar 20-9-08
								{	
									document.getElementById("restSelectFormMain").searchPostcode.focus();
									status=false;
								}
							}else
							{
								document.getElementById("restSelectFormMain").searchPostcode.focus();
								status=false;
							}
						}
				message="not valid";
			}
			if( document.getElementById("restSelectFormMain").searchPostcode.value!="")
			{
				var pcode=document.getElementById("restSelectFormMain").searchPostcode.value; //balu on 16/9/08
				var plength=pcode.length;
				if(plength<2)
				errorMessage+="Please Enter atleast 2 (PostCode)Characters to Search\n";	
				if(status)
						{
							if(document.getElementById("restSelectFormMain").formType!=null)
							{
								if(document.getElementById("restSelectFormMain").formType.value!="cuisineForm")//srikar 20-9-08
								{
								document.getElementById("restSelectFormMain").searchPostcode.focus();
								status=false;
								}
							}else
							{
								document.getElementById("restSelectFormMain").searchPostcode.focus();
								status=false;
							}
						}
			}
			if( document.getElementsByName("searchPostcode")[0].value!="" &&  document.getElementsByName("stateCityTown")[0].value!="")
			{
				alert("Please Search by One Parameter either postcode or place")
					message='not valid';
			}
		var stateCityTown="";
			if(message=="")
			{
				if( document.getElementById("restSelectFormMain").stateCityTown.value!="" && document.getElementById("restSelectFormMain").stateCityTown.value!=null)
				{
					place= document.getElementById("restSelectFormMain").stateCityTown.value;
					 searchWith='place';
					 stateCityTown=document.getElementById("restSelectFormMain").stateCityTown.value;
				}
				if( document.getElementById("restSelectFormMain").searchPostcode.value!="" )
				{
					postcode= document.getElementById("restSelectFormMain").searchPostcode.value;
					searchWith='postcode';
				}
			}
	
		if(errorMessage!=errorMessage1)
			  {
				alert(errorMessage);
			  }
		else if(message=="" && searchWith!="")
		{
			searchType="allSearch";
			searchValue ="allSearch";
			var strURL = 'RestaurantSelection.do?stateCityTown='+stateCityTown+'&searchValue='+searchValue+'&msg=success&searchType='+searchType+'&formType='+formType+'&timezone='+timezone+'&cuisineType='+cuisine+'&dishValue='+dish+'&restaurantsType='+rstp+'&searchRest='+restName+'&searchCountry='+country+"&searchPostcode="+postcode;
			if(document.getElementById("mainPage") != null) //Calling from HomePage
			{
				document.getElementById("restSelectFormMain").action=strURL;
  		   		document.getElementById("restSelectFormMain").submit();
			}
			else 
			{
				 if(document.getElementById("restaurants")!=null)  //mu270509
				 {
				 	viewModule("searchCriteria");
					new Ajax.Updater("restaurants",strURL+"&pageType=half&nextValnew=0&billShipAddressId="+searchlocations,{onComplete:function(){fillCartBlock();setOpenDays("restaurantDesc");},asynchronous:false, evalScripts:true});
				 }
				 else
				 {
				 	document.getElementById("restSelectFormMain").action=strURL;
  		   			document.getElementById("restSelectFormMain").submit();
				 }
			}
		}
	}


function SetCookie(name,value,expires,path,domain,secure) {
	
   if(name.substring(0,6)=="Order." || name == "ServerNumberOrdered" || name=="NumberOrdered" || name=="userType"){
		return;
	}
  document.cookie = name + "=" + escape (value) +
                     ((expires) ? "; expires=" + expires.toGMTString() : "") +
                     ((path) ? "; path=" + path : "") +
                     ((domain) ? "; domain=" + domain : "") +
                     ((secure) ? "; secure" : "");

} 


  
  
  function display_am_pm(deliverytimings)
 {
 	var dtimings=deliverytimings.split(";");
  var timings="";
  for(var i=0;i<dtimings.length-1;i++)
	{
	 var dtime=dtimings[i].split("To");
	 var  dopen=dtime[0].split(":");
		var dclose=dtime[1].split(":");
						var dopen1=dopen[0];
						//alert(dopen1);
						var dclose1=dclose[0];
						var deliveryopen="";
						var deliveryclose="";
						if(parseFloat(dopen1)>=12)
	                      {
	                      	if(parseFloat(dopen1)>12)
							dopen1=dopen1-12;
                        	deliveryopen=dopen1+":"+dopen[1]+" pm";   
	                         }
	                         else
	                         {   
	                        	 deliveryopen=dopen1+":"+dopen[1]+" am"; 
	                         }   
						if(parseInt(dclose1)>=12)
	                      { 
	                      	if(parseFloat(dclose1)>12)      
							dclose1=dclose1-12;
                            deliveryclose=dclose1+":"+dclose[1]+" pm";   
	                         }
	                         else
	                         {    
	                        	 deliveryclose=dclose1+":"+dclose[1]+" am"; 
	                         }
	timings+=deliveryopen+" "+ "To" +" "+deliveryclose+" "+";"+ " "+"<br/>";
	}  
  return timings;
   }
 
 function GetCookie(key) {

   var arg = key + "=";
   var alen = arg.length;
   var clen = document.cookie.length;
   var i = 0;
   
 if(key.substring(0,6)=="Order." || key == "ServerNumberOrdered" || key=="NumberOrdered" || key=="userType"){
	 if(typeof(parent.obj) != "undefined" && parent.obj != null && parent.obj.order != null){
	 	if(key.substring(0,13) == "Order.Server.")
	 		return parent.obj.reorder[parseInt(key.substring(13),10)-1];
	 	else if(key.substring(0,6) == "Order.")
	 		return parent.obj.order[parseInt(key.substring(6),10)-1];
	 	else if(key == "ServerNumberOrdered")
	 		return parent.obj.serverOrdered;
	 	else if(key == "NumberOrdered")
	 		return parent.obj.order.length;
	 	else
	 		return parent.obj.key;
	 }
     else{
     	return "";
     }
     
   }
   
   while ( i < clen ) {
      var j = i + alen;
     
      if ( document.cookie.substring(i, j) == arg ) 
      {
      	return(getCookieVal (j));
      }
      i = document.cookie.indexOf(" ", i) + 1;
      if ( i == 0 ) break;
   }
   return(null);
}

function decrypt(str, pwd) 
	{
	  if(str == null || str.length < 8) {
		return;
	  }
	  if(pwd == null || pwd.length <= 0) {
		return;
	  }
	  var prand = "";
	  for(var i=0; i<pwd.length; i++) {
		prand += pwd.charCodeAt(i).toString();
	  }
	  var sPos = Math.floor(prand.length / 5);
	  var mult = parseInt(prand.charAt(sPos) + prand.charAt(sPos*2) + prand.charAt(sPos*3) + prand.charAt(sPos*4) + prand.charAt(sPos*5));
	  var incr = Math.round(pwd.length / 2);
	  var modu = Math.pow(2, 31) - 1;
	  var salt = parseInt(str.substring(str.length - 8, str.length), 16);
	  str = str.substring(0, str.length - 8);
	  prand += salt;
	  while(prand.length > 10) {
		prand = (parseInt(prand.substring(0, 10)) + parseInt(prand.substring(10, prand.length))).toString();
	  }
	  prand = (mult * prand + incr) % modu;
	  var enc_chr = "";
	  var enc_str = "";
	  for(var i=0; i<str.length; i+=2) {
		enc_chr = parseInt(parseInt(str.substring(i, i+2), 16) ^ Math.floor((prand / modu) * 255));
		enc_str += String.fromCharCode(enc_chr);
		prand = (mult * prand + incr) % modu;
	  }
	  return enc_str;
}
function DeleteCookie(name,path,domain) {
if(name=="ServerNumberOrdered" && typeof(obj)!="undefined"){
		obj.serverOrdered=null;
		obj.reorder = new Array(); 
	}
   if ( GetCookie(name) ) {
      document.cookie = name + "=" +
                        ((path) ? "; path=" + path : "") +
                        ((domain) ? "; domain=" + domain : "") +
                        "; expires=Thu, 01-Jan-70 00:00:01 GMT";
   }
} 
function forgotPassword1()
	{
			pwdwindow=window.open('forgotpw.do?first=first','Logon','fullscreen=no,toolbar=no,status=yes,menubar=no,scrollbars=no,resizable=no,directories=no,location=no,width=375,height=300')
			pwdwindow.moveTo(20,20);
	} 
 
 
 
	function clearData()
	{
		document.getElementById('light').style.display='none';
		document.getElementById('fade').style.display='none';
		document.forms[1].userName.value="";
		document.forms[1].password.value="";
	}
	function clearData1()
	{	
		document.forms[1].userName.value="";
		document.forms[1].password.value="";
	    document.getElementById("resultmsg").innerHTML="";		
		document.getElementById('light').style.display='block';
		document.getElementById('fade').style.display='block';
		document.forms[1].userName.focus();
	}
				
	function clearUserName()                                          //balu on 16/9/08
	{
		userName=document.forms[1].elements['userName'].value;
		if(userName=="username" || userName=="UserName")
		document.forms[1].elements['userName'].value="";
	}
	function getUserName()
	{
		if(document.forms[1].elements['userName'].value=='')
		document.forms[1].elements['userName'].value="UserName";
	}
	function clearPassword()
	{
		userPassword=document.forms[1].elements['password'].value;
		if(userPassword=="password")
		document.forms[1].elements['password'].value="";
	}
	function getPassword()
	{
		if(document.forms[1].elements['password'].value=='')
		document.forms[1].elements['password'].value="password";
	}
	function invalidUser()
	{	
				document.forms[1].userName.value="user name";
				document.forms[1].password.value="password"; //balu on 17/09/08
	}  
	
	//for light box
	
	function clearUserName1()                                          //balu on 16/9/08
	{
		userName=document.getElementById("loginName").value;
		if(userName=="username" || userName=="UserName")
		document.getElementById("loginName").value="";
	}
	function getUserName1()
	{
		if(document.getElementById("loginName").value=='')
		document.getElementById("loginName").value="UserName";
	}
	function clearPassword1()
	{
		userPassword=document.getElementById("password").value;
		if(userPassword=="password")
		document.getElementById("password").value="";
	}
	function getPassword1()
	{
		if(document.getElementById("password").value=='')
		document.getElementById("password").value="password";
	}
	
	
	// ending 
	
	
	
	
	function intimate()
	{ 
		 if(document.forms[1].intimate.value=="intimated")
		 {
		 	document.forms[1].userName.value="";
			document.forms[1].password.value="";
		 	document.getElementById('light').style.display='block';
			document.getElementById('fade').style.display='block';
		 }
	}
	  function getCuisineTypesDetails(a,d)
	{
	          var country=document.getElementById("searchCountry").options[document.getElementById("searchCountry").selectedIndex].value;
	          document.forms[0].restaurantName.value=a;
	          document.forms["restSelectFormMain"].ccategory.value="";
	          document.forms["restSelectFormMain"].searchCuisine.value="";
	          document.forms["restSelectFormMain"].scategory.value="";
					  var postcodetrim=d;	
	                  var visitortime = new Date();
					  var tz=(((visitortime.getTimezoneOffset())/60)*(-1));
					  document.forms[0].timezone.value=tz;
					  if(document.forms[0].searchPostcode.value!="")
						  {
						  	d=document.forms[0].searchPostcode.value;
						  }		  
					  else
					  	 {
					  	 	postcodetrim=trimAll(d);
					  	 	if(postcodetrim.length>=6)
					  	 	postcodetrim=postcodetrim.substring(0,postcodetrim.length-3);
					  	 	document.forms[0].searchPostcode.value=postcodetrim;
						 } 
			document.forms[0].action='RestaurantSelection.do?searchValue=allSearch&searchType=allSearch&formType=cuisineForm&view=cart&searchPostcode='+postcodetrim+'&searchCountry='+country+'&resID='+a;
	        document.forms[0].submit();			
	}
	
	function aboutUs()
	{
		document.getElementById("maincolumn").style.display="none";
		document.getElementById("custhiworks").style.display="none";
		document.getElementById("vendorhiworks").style.display="none";
		document.getElementById("aboutUs").style.display="block";
		document.getElementById("contactUs").style.display="none";
	}
	function contactUs()
	{
		document.getElementById("maincolumn").style.display="none";
		document.getElementById("custhiworks").style.display="none";
		document.getElementById("vendorhiworks").style.display="none";
		document.getElementById("aboutUs").style.display="none";
		document.getElementById("contactUs").style.display="block";
	}
	
	function customerHowItWorks()
	{
		document.getElementById("maincolumn").style.display="none";
		document.getElementById("aboutUs").style.display="none";
		document.getElementById("vendorhiworks").style.display="none";
		document.getElementById("custhiworks").style.display="block";
		document.getElementById("contactUs").style.display="none";
	}
	function funover()
	{
	    document.getElementById("innerlogorow").className="innerlogorowhover";
	}
		var postCodeArr=new Array();
	function funMore(k)
	{
		  new Ajax.Updater("countrypostcodes","first.do?paramx=totalpostcodes",{onComplete:function(){document.getElementById("morebut").style.display="none";},asynchronous:false, evalScripts:true});           
	}
	
	function imageItem(image_location) 
	{
		this.image_item = new Image();
		this.image_item.src = image_location;
	}
	function get_ImageItemLocation(imageObj)
	{
	   return(imageObj.image_item.src)
	}
	function generate(x, y) 
	{
		var range = y - x + 1;
		return Math.floor(Math.random() * range) + x;
	}
	function getNextImage() 
	{
		if (random_display) {
		image_index = generate(0, number_of_image-1);
		}
		else {
		image_index = (image_index+1) % number_of_image;
		}
		var new_image = get_ImageItemLocation(image_list[image_index]);
		return(new_image);
	}
	function rotateImage(place) 
	{
	 var new_image = getNextImage();
	 document[place].src = new_image;
	 var recur_call = "rotateImage('"+place+"')";
	 setTimeout(recur_call, interval);
	}	
	
function getLocations()
{
	if($("citiesID").value!="select")
	{
		document.forms["RestaurantSelectionForm"].city.value=document.forms["RestaurantSelectionForm"].cities[document.forms["RestaurantSelectionForm"].cities.selectedIndex].text
		document.forms["RestaurantSelectionForm"].cityId.value=$("citiesID").value;
		new Ajax.Updater('locationListID', 'locations.do?param=locations', {
			onComplete:function()
			{ 
				new Ajax.Updater('locationsDivID1', 'locations.do?param=locations&param1=cityWise', {
			 onComplete:function()
			 { 
			 	 $("searchPostcodeID").value="";     
			   }  ,parameters:Form.serialize(document.forms[0]),asynchronous:true,evalScripts:true});		
			       
			  }  ,parameters:Form.serialize(document.forms[0]),asynchronous:true,evalScripts:true});
	}
	else
	{
		$("cityLocationsID").value="select";
		$("searchPostcodeID").value="";
	}
}	
function funGetMore(k)
{
	if(document.forms["RestaurantSelectionForm"].cities[document.forms["RestaurantSelectionForm"].cities.selectedIndex].text=='select')
	{
		alert("please select city and then click more\n");
	}
	else
	{
		document.forms["RestaurantSelectionForm"].city.value=document.forms["RestaurantSelectionForm"].cities[document.forms["RestaurantSelectionForm"].cities.selectedIndex].text
		document.forms["RestaurantSelectionForm"].cityId.value=$("citiesID").value;
		new Ajax.Updater('locationsDivID', 'locations.do?param=locations&param1=more', {
		onComplete:function()
		{      
		  }  ,parameters:Form.serialize(document.forms[0]),asynchronous:true,evalScripts:true});		
	}           
}	

function populatePostcode()
{ 

	 if($("cityLocationsID").value!='select')
	 {
	  $("searchPostcode").value=$("cityLocationsID").value;
	 }	
	 else
	   $("searchPostcode").value="";
 }	
  function searchNewInd(a)
	{
		var formType="restaurantForm";
		var rstp="";
		var message="";
		var word="";
		var searchWith="";
		var postcode="";
		var place="";
		var dish="";
		var country="";
		var restName="";
		var searchlocations="";
		errorMessage1="";
		errorMessage=errorMessage1;
		var	status=true;
		var visitortime = new Date();
	    var timezone=(visitortime.getTimezoneOffset()/60)*(-1);
		var cuisine= document.getElementById("restSelectFormMain").cuisineTypes.value;
		if(document.getElementById("restSelectFormMain").dishValue.value!="" && document.getElementById("restSelectFormMain").dishValue.value!=null)
			dish= document.getElementById("restSelectFormMain").dishValue.value.replace(/'/,"")
		if(document.getElementById("restSelectFormMain").searchRest.value!="" && document.getElementById("restSelectFormMain").searchRest.value!=null);
		   restName= document.getElementById("restSelectFormMain").searchRest.value;
		if(document.getElementById("restSelectFormMain").takeaway1.checked==true){
				rstp =1+"|";
				 document.getElementById("takeaway1").value=true;
		}
		else
			 document.getElementById("takeaway1").value=false;
		
		if( document.getElementById("restSelectFormMain").delivery1.checked==true){
				rstp +=2+"|";
			 document.getElementById("delivery1").value=true;
		}
		else
			 document.getElementById("delivery1").value=false;
    
    	if( document.getElementById("restSelectFormMain").restaurant1.checked==true)//eatin
		{		rstp +=3+"|";
		 document.getElementById("restaurant1").value=true;
		}
		else
			 document.getElementById("restaurant1").value=false;
			
		if(document.getElementById("restSelectFormMain").onlinedel1!=null && document.getElementById("restSelectFormMain").onlinedel1.checked==true){
				rstp +=4+"|";
				document.getElementById("onlinedel1").value=true;
		}
		else
			 document.getElementById("onlinedel1").value=false;
			 
        if(document.getElementById("restSelectFormMain").onlinecol1!=null && document.getElementById("restSelectFormMain").onlinecol1.checked==true){
				rstp +=5+"|";
				document.getElementById("onlinecol1").value=true;
		}
		else
			 document.getElementById("onlinecol1").value=false;

		if(rstp=="")
			rstp='1|2|3|4';
		 document.getElementById("restSelectFormMain").restaurantsType.value=rstp;		
        if(document.getElementById("restSelectFormMain").searchCountry!=null)
        {
	   	   if( document.getElementById("restSelectFormMain").cities[ document.getElementById("restSelectFormMain").cities.selectedIndex].text=='select')
			{
				errorMessage+="please select the City\n\n";	
			  if(status)
				{
					document.getElementById("restSelectFormMain").cities.focus();
					status=false;
				}			
			}			
          }
			if( document.getElementById("restSelectFormMain").searchPostcode.value=="" &&  document.getElementById("restSelectFormMain").cityLocations.value=="select")
			{
				
				errorMessage+="Please Enter a Location or a Postcode\n\n";	
				if(status)
				{	
					document.getElementById("restSelectFormMain").searchPostcode.focus();
					status=false;							
				 }			
			}
			if( document.getElementById("restSelectFormMain").searchPostcode.value!="")
			{
				var pcode=document.getElementById("restSelectFormMain").searchPostcode.value; //balu on 16/9/08
				var plength=pcode.length;
				if(plength<2)
				errorMessage+="Please Enter atleast 2 (PostCode)Characters to Search\n";	
				if(status)
				{
					if(document.getElementById("restSelectFormMain").formType!=null)
					{
						document.getElementById("restSelectFormMain").searchPostcode.focus();
						status=false;
					}
				 }
			}
			
		if(errorMessage!=errorMessage1)
		  {
			alert(errorMessage);
		  }
		else 
		{
			searchType="allSearch";
			searchValue ="allSearch";			
			country='IND';
			postcode=document.getElementById("restSelectFormMain").searchPostcode.value;
//			var strURL = 'RestaurantSelection.do?searchValue='+searchValue+'&msg=success&searchType='+searchType+'&formType='+formType+'&timezone='+timezone+'&cuisineType='+cuisine+'&dishValue='+dish+'&restaurantsType='+rstp+'&searchRest='+restName+'&searchCountry='+country+"&searchPostcode="+postcode+"&lucene=lucene";
			var strURL = 'RestaurantSelection.do?searchValue='+searchValue+'&msg=success&searchType='+searchType+'&formType='+formType+'&timezone='+timezone+'&cuisineType='+cuisine+'&dishValue='+dish+'&restaurantsType='+rstp+'&searchRest='+restName+'&searchCountry='+country+"&searchPostcode="+postcode+"&luceneSearch=lucene";		
			document.getElementById("restSelectFormMain").action=strURL;
	   		document.getElementById("restSelectFormMain").submit();		
		}
 }	
function setpostCodeLoc(pcode)
{
	document.forms[0].searchPostcode.value =pcode;
	searchNewInd('allsearch');
}	
function getLocationsNew()
{
	document.forms["RestaurantSelectionForm"].city.value=document.forms["RestaurantSelectionForm"].cities[document.forms["RestaurantSelectionForm"].cities.selectedIndex].text
	document.forms["RestaurantSelectionForm"].cityId.value=$("citiesID").value;
	new Ajax.Updater('locationListID', 'locations.do?param=locations', {
		onComplete:function()
		{ 
			$("searchPostcode").value="";			  
		  }  ,parameters:Form.serialize(document.forms[0]),asynchronous:true,evalScripts:true});
}		

function getOrdersPage()
{
	var visitortime = new Date();
	var tz=(visitortime.getTimezoneOffset()/60)*(-1);	
	//document.forms[0].action="Order.do?ordertype=login&login=true&timezone="+tz;
	//document.forms[0].action="home.do?ordertype=login&timezone="+tz;
	document.forms[0].action="home.do";
	document.forms[0].submit();	
}

function logoff()
{
	document.forms[1].action="logoff.do";
	document.forms[1].submit();
} 	


	

	
function RestaurantTypesIN(restType)
{
	 divid=restType;	 
	 new Ajax.Updater('col', "first.do?homeordfor="+divid, {onComplete:function(){},asynchronous:false, evalScripts:true});	 
}

function partyrdersHomeLink()
{
  new Ajax.Updater('col', "jsp/jsp/partyOrdersHome.jsp", {onComplete:function(){},asynchronous:false, evalScripts:true});
}
	
function funEnterIn(a,e,type)
{
	var key;
 	if(window.event)
          key = window.event.keyCode;     //IE
     else
          key = e.which;     //firefox

    
	if(key== 13)
	{
		e.Handled=true;
	  searchNewResType(a,type);
	 return false;
	}
}

function searchNewResType(a,type)
{
	if(document.getElementById("postin")!=null && document.getElementById("postin").value!="")
	{
		if(type=='TakeAway')
		{
		  document.forms["RestaurantSelectionForm"].orderFor.value="Collection";	
		  document.getElementById("restSelectFormMain").takeaway1.checked="true";
		}else if(type=='Delivery')
		{
			document.forms["RestaurantSelectionForm"].orderFor.value="Delivery";
		   document.getElementById("restSelectFormMain").delivery1.checked="true";
		}else if(type=='Eatin')
		{
			document.forms["RestaurantSelectionForm"].orderFor.value="Eatin";
		   document.getElementById("restSelectFormMain").restaurant1.checked="true";
		}
		
	    document.getElementById("restSelectFormMain").searchPostcode.value=document.getElementById("postin").value; 
	    searchNewInd(a);
	
	}else
	{
		alert("Please Enter Your Postcode");
		document.getElementById("postin").focus();
	}
}
var suggest="";
function funSuggestRestaurant()
{
	var	status=true;
	var errorMessage1="There were problem with one or more of your entries\n";	
	var errorMessage=errorMessage1;
	if(!validateNotEmpty($("suggestName").value))
	{
		errorMessage+="Your Name is required\n";
		if(status)
		{
			$("suggestName").focus();
			status=false;
		}
	 }
	 if(!validateNotEmpty($("suggestEmail").value))
	{
		errorMessage+="Your Email is required\n";
		if(status)
		{
			$("suggestEmail").focus();
			status=false;
		}
	 }
	 else
	{
		if(!validateEmail($("suggestEmail").value))
		{
			errorMessage+="Email is not valid\n";
			if(status)
			{
				$("suggestEmail").focus();
				status=false;
			}
		}							
	}
	if(!validateNotEmpty($("restNameId").value))
	{
			errorMessage+="Restaurant Name is required\n";
			if(status)
			{
				$("restNameId").focus();
				status=false;
			}
	 }
	 if(!validateNotEmpty($("restAddressId").value))
	{
			errorMessage+="Restaurant Address is required\n";
			if(status)
			{
				$("restAddressId").focus();
				status=false;
			}
	 }
	if(errorMessage!=errorMessage1)
	{
		alert(errorMessage);
	}
	else
	{
		suggestjson=new suggestRestObj($("suggestName").value,$("suggestEmail").value,$("restNameId").value,$("restAddressId").value,$("restPhoneId").value,$("restCommentId").value);
		suggest=Object.toJSON(suggestjson);
		new Ajax.Updater('suggestID', 'suggest.do?param='+suggest, {onComplete:function(){
//		new Ajax.PeriodicalUpdater("suggestID", "jsp/suggestSuccess.jsp", {		  	
//			frequency : 50,
//			decay : 2
//			});
		},asynchronous:true,evalScripts:true});
		
		new Ajax.PeriodicalUpdater("suggestID", "jsp/suggestSuccess.jsp", {		  	
			frequency : 10,
			decay : 2
			});
	}

	
}		
	
function checkEnquiryForm()
{
// document.forms[0].action="enquiry.do";
// document.forms[0].submit();
new Ajax.Updater('locationsDivID', "jsp/EnquiryDetails.jsp", {onComplete:function(){},asynchronous:false, evalScripts:true});
}	
function voucherSelection(){
	
        var searchCountry="";
        if(document.forms[0].searchCountry!=null)
        searchCountry=document.forms[0].searchCountry.value;
		document.forms[0].action='vouchers.do?param=tempSelect&searchCountry='+searchCountry;
		document.forms[0].submit();
		}	

// Static pages for learn more ,how it works .....
	
// Static pages for learn more ,how it works .....
	
	function DescriptionsInd(des)
{
	if(des!=null && des=='aboutus')
	new Ajax.Updater('locationsDivID', "jsp/aboutUsInd.jsp", {onComplete:function(){},asynchronous:false, evalScripts:true});
	else if(des!=null && des=='custhiworks')
	new Ajax.Updater('locationsDivID', "jsp/customerHowItWorksInd.jsp", {onComplete:function(){},asynchronous:false, evalScripts:true});
	else if(des!=null && des=='vendorhiworks')
	new Ajax.Updater('locationsDivID', "jsp/vendorHowItWorksInd.jsp", {onComplete:function(){},asynchronous:false, evalScripts:true});
	else if(des!=null && des=='faq')
	new Ajax.Updater('locationsDivID', "jsp/FaqInd.jsp", {onComplete:function(){},asynchronous:false, evalScripts:true});
	else if(des!=null && des=='businessowners')
	new Ajax.Updater('locationsDivID', "jsp/BusinessOwnersInd.jsp", {onComplete:function(){},asynchronous:false, evalScripts:true});
	else if(des!=null && des=='tellafriend')
	new Ajax.Updater('locationsDivID', "jsp/TellaFriendInd.jsp", {onComplete:function(){},asynchronous:false, evalScripts:true});
	else if(des!=null && des=='jobs')
	new Ajax.Updater('locationsDivID', "jsp/jobsInd.jsp", {onComplete:function(){},asynchronous:false, evalScripts:true});
	else if(des!=null && des=='contactus')
	new Ajax.Updater('locationsDivID', "jsp/contactUsInd.jsp", {onComplete:function(){},asynchronous:false, evalScripts:true});
	else if(des!=null && des=='agreement')
	new Ajax.Updater('locationsDivID', "jsp/userAgreementInd.jsp", {onComplete:function(){},asynchronous:false, evalScripts:true});
	else if(des!=null && des=='privacypolicy')
	new Ajax.Updater('locationsDivID', "jsp/PrivacyPolicyInd.jsp", {onComplete:function(){},asynchronous:false, evalScripts:true});
}
function customerDescription(indexval)	
{
	if(indexval!=null && indexval=='1')
	new Ajax.Updater('locationsDivID', "jsp/customerHowItWorksInd.jsp", {onComplete:function(){},asynchronous:false, evalScripts:true});
	else if(indexval!=null && indexval=='2')
	new Ajax.Updater('locationsDivID', "jsp/customerHowItWorksInd2.jsp", {onComplete:function(){},asynchronous:false, evalScripts:true});
	else if(indexval!=null && indexval=='3')
	new Ajax.Updater('locationsDivID', "jsp/customerHowItWorksInd3.jsp", {onComplete:function(){},asynchronous:false, evalScripts:true});
	else if(indexval!=null && indexval=='4')
	new Ajax.Updater('locationsDivID', "jsp/customerHowItWorksInd4.jsp", {onComplete:function(){},asynchronous:false, evalScripts:true});
}

function vendorDescription(indexval)
{	
	if(indexval!=null && indexval=='1')
	new Ajax.Updater('locationsDivID', "jsp/vendorHowItWorksInd.jsp", {onComplete:function(){},asynchronous:false, evalScripts:true});
	else if(indexval!=null && indexval=='2')
	new Ajax.Updater('locationsDivID', "jsp/vendorHowItWorksInd2.jsp", {onComplete:function(){},asynchronous:false, evalScripts:true});
	else if(indexval!=null && indexval=='3')
	new Ajax.Updater('locationsDivID', "jsp/vendorHowItWorksInd3.jsp", {onComplete:function(){},asynchronous:false, evalScripts:true});
}

