/****************************************************************
	//	Created By	:   S.Sathiya
	//	Created On	: 	5-09-06
	//	Created For	:   Consumer Rates 
*****************************************************************/
   
   //#--	Creating the Object for Ajax
	var ajax = new sack();

 	//#--	-------------------------------------------------------------------	
	//#--	Delay Function, When calling No responce from Ajax
	function delay()
	{
		
		setTimeout('showCity()',1);
		
	}
	//#--	End of the Delay Function
 	//#--	-------------------------------------------------------------------

	
	function delayProduct()
	{
		
		setTimeout('showProduct()',1);
		
	}
	
	//#--	Starting the Show Feature Function
	//#--	-------------------------------------------------------------------
 	function showProduct()
	{
		try
		{
			//#--	Checking the Ajax Responces is 'Indefine'
			if(ajax.response==undefined){
				delayProduct(); 
			}
			else{
				document.getElementById("divProduct").innerHTML = ajax.response;
 				ajax.response = undefined;
			}
		}
		catch(Error)
		{
			ErrorHandling(Error);
		}
	}
	//#--	-------------------------------------------------------------------
	
	
 	//#--	Starting the Show City Function	
	function showCity()
	{
		try
		{
			//#--	Checking the Ajax Responces is 'Indefine'
			if(ajax.response==undefined){
				delay(); 
			}
			else{
				document.getElementById("divState").innerHTML = ajax.response;
 				ajax.response = undefined;
			}
		}
		catch(Error)
		{
			ErrorHandling(Error);
		}
	}//#--	End of the Show City Function


	//#!- -------------------------------------------------------------------------

	function funregstates()
	{
	 	try
	   {
			var vCountryAbb  = document.frmRegister.textCountry.value; 
			document.getElementById("divState").innerHTML = '<img src="../../images/spacer.gif" width=1 height=10 border="0"><span class="textBold">Loading...</span>';
		 
			if(vCountryAbb !="")
			{
				ajax.requestFile = '../web/state_changing.php?countryId='+vCountryAbb;
			}
			ajax.runAJAX();		// Execute AJAX function
			ajax.onCompletion = delay(); 
		}
		catch(Error)
		{
			ErrorHandling(Error);
		} 
	}
 	//#--	-------------------------------------------------------------------
	 function funstates() 
	 {
	  	   try
		   {
				var vCountryAbb  = document.frmMember.txtCountry.value; 
				document.getElementById("divState").innerHTML = '<img src="../../images/spacer.gif" width=1 height=10 border="0"><span class="textBold">Loading...</span>';
			 
				if(vCountryAbb !="")
				{
					ajax.requestFile = '../admin/state_changing.php?countryId='+vCountryAbb;
				}
				ajax.runAJAX();		// Execute AJAX function
				ajax.onCompletion = delay(); 
			}
			catch(Error)
			{
				ErrorHandling(Error);
			} 
	   }
 	//#--	-------------------------------------------------------------------
	//#--	Starting the State Function
	function funRate(pmlen)
   	{
		try {
				document.getElementById("divProduct").innerHTML = "Loading...";
				if(pmlen > 1)
				{
					ajax.requestFile = '../admin/adm_product_load.php?rateid='+document.frmLender.cmbratetype[pmloopid-1].value+'&len='+pmlen;	// Specifying which file to get
				}				
				else
				{
					ajax.requestFile = '../admin/adm_product_load.php?rateid='+document.frmLender.cmbratetype.value+'&len='+pmlen;	// Specifying which file to get
				}
				ajax.runAJAX();		// Execute AJAX function
				ajax.onCompletion = delay(pmloopid);
        }
		catch(Error){
			ErrorHandling(Error);
		}//#--	End of the State Function
	}
 	//#--	-------------------------------------------------------------------

	//#--	-------------------------------------------------------------------
	//#--	End of the Show Product Function
	function funProduct()
	{
	 	try
	   {
			var vCatId  = document.frmProduct.txtProductCat.value; 
		//	var vCatId  = document.frmProduct.vCatId.value; 
			document.getElementById("divProduct").innerHTML = '<img src="../../images/spacer.gif" width=1 height=10 border="0"><span class="textBold">Loading...</span>';
		 
			if(vCatId !="")
			{
				ajax.requestFile = '../web/product_changing.php?CatId='+vCatId;
			}
			ajax.runAJAX();	// Execute AJAX function
			ajax.onCompletion = delayProduct(); 
		}
		catch(Error)
		{
			ErrorHandling(Error);
		} 
	}
 	//#--	-------------------------------------------------------------------





