	/*----------------------------------------------------------------
	Description   :- Common Function to confirm the deletion and rediredt to the delete validation page
	Programmer    :- SBI
	Last Modified :- 12/March/2009
	-------------------------------------------------------------------*/
	 function deleteconfirm(page,name,params,msg,msg1,msg3)
	{ 
		if(confirm(msg+" "+name + "?\n"+ msg1 + name + msg3))
		window.location = page + "?" + params +"&name="+ name;
	}
	
	/*----------------------------------------------------------------
	Description   :- function to change the status of the links
	Programmer    :- SBI
	Last Modified :- 12/March/2009
	-------------------------------------------------------------------*/
	function updatestatusconfirm(page,name,status,msg,params,paging)
	{ 
		if(confirm(msg + name + "?"))
		window.location = page + "?"+ params + "&status=" + status + "&page="+paging ;
	}
	
	function popup(page)
	{
		window.open(page,'banner','menubar=no,toolbar=no,location=no,directories=no,status=no,width=600,height=550,left=100,top=90');
	}
	/*----------------------------------------------------------------
	Description   :- function to check whether the search is valid or not
	Programmer    :- SBI
	Last Modified :- 12/March/2009
	-------------------------------------------------------------------*/
	function checkValidSearch() {
		var theZip;
		var theCity;
		var theState;

		theZip = document.getElementById('zipcode').value;  
		theCity = document.getElementById('city').value;
		theState = document.getElementById('state').value;

		var validZip = /^\d{5}/;

		if (theZip=='') {
				alert('Please enter a Zip Code and either  a City or a  State.');
				return false;
			} else {
					window.location='index.php?process=search&zp='+theZip+'&cy='+theCity+'&st='+theState;
			}
	}
	
	/*----------------------------------------------------------------
	Description   :- function to search the storeageare by size
	Programmer    :- SBI
	Last Modified :- 16/March/2009
	-------------------------------------------------------------------*/
	 function SearchBySize(zip,city,state){ 
		 var size = document.getElementById('size').value;
		 if(size){ 
		 	var url = 'index.php?process=search&zp='+zip+'&cy='+city+'&st='+state+"&size="+size; //alert("kk"+url);
				window.location=url;
		 }else{
			return false; 
		 }
	 }
	
	 function SearchBySize1(){ 
		 var size = document.getElementById('size').value;
		 if(size){ 
		 	var url = 'index.php?process=search&size='+size; //alert(url);
				window.location=url;
		 }else{
			return false; 
		 }
	 }	
	/*----------------------------------------------------------------
	Description   :- function to search the storeageare by features
	Programmer    :- SBI
	Last Modified :- 16/March/2009
	-------------------------------------------------------------------*/
	 function SearchByfeatures(zip,city,state){ 
		 var features = document.getElementById('features').value;
		 if(features){ 
		 	var url = 'index.php?process=search&zp='+zip+'&cy='+city+'&st='+state+"&fp="+features; //alert("kk"+url);
				window.location=url;
		 }else{
			return false; 
		 }
	 }
		 
	 function SearchByfeatures1(){ 
		 var features = document.getElementById('features').value;
		 if(features){ 
		 	var url = 'index.php?process=search&fp='+features; //alert("kk"+url);
				window.location=url;
		 }else{
			return false; 
		 }
	 }
    /*----------------------------------------------------------------
    Description   :- Function to Validate a number
    Programmer    :- SBI
    Last Modified :- 14/March/2009
    -------------------------------------------------------------------*/
	function ValidateNumber(e)
	{
		var key;
		var keychar;
	
		if (window.event)
		key = window.event.keyCode;
		else if (e)
			key = e.which;
		else
			return true;
	
		keychar = String.fromCharCode(key);
		keychar = keychar.toLowerCase();
	
		if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27) )
			return true;
		else if ((("0123456789.").indexOf(keychar) > -1))
			return true;
		else
			return false;
	}
	
    /*----------------------------------------------------------------
    Description   :- Function to change the content in the mouseover
    Programmer    :- SDYA
    Last Modified :- 16/March/2009
    -------------------------------------------------------------------*/
	function changetoThumb(id,type,size,thumb,flash,desc)
	{
		var spanid;
		if(type=='home')
			spanid	= "unit"+id+"h";
		else
			spanid	= "unit"+id+"b";
		document.getElementById(spanid).innerHTML = "<img src='images/virtualunits/"+thumb+"' alt='"+thumb+"' border=0 />";
		return true;
	}
	
    /*----------------------------------------------------------------
    Description   :- Function to change the content in the mouse out
    Programmer    :- SDYA
    Last Modified :- 16/March/2009
    -------------------------------------------------------------------*/
	function changetoSize(id,type,size)
	{
		var spanid;
		if(type=='home')
			spanid	= "unit"+id+"h";
		else
			spanid	= "unit"+id+"b";
/*			alert(spanid);*/
		document.getElementById(spanid).innerHTML = size;
		return true;
	}
	
    /*----------------------------------------------------------------
    Description   :- Function to show the flash content on clicking the unit size
    Programmer    :- SDYA
    Last Modified :- 16/March/2009
    -------------------------------------------------------------------*/
	function showflash(fname,desc,size)
	{
		var image_name = "images/virtualunits/"+fname;
		document.getElementById('choose_size').innerHTML = size+' Storage';
		document.getElementById('choose_desc').innerHTML = desc;
		document.getElementById('choose_img').innerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="375" height="278"><param name="movie" value="'+image_name+'" /><param name="quality" value="high" /><embed src="'+image_name+'" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="375" height="278"></embed>';
		
	}
    /*----------------------------------------------------------------
    Description   :- Function to show card info div
    Programmer    :- SBI
    Last Modified :- 17/March/2009
    -------------------------------------------------------------------*/
 	function ShowCradInfo(){
		document.getElementById('CreditCard').style.display="block";
	}//end
    /*----------------------------------------------------------------
    Description   :- Function to hide card info div
    Programmer    :- SBI
    Last Modified :- 17/March/2009
    -------------------------------------------------------------------*/
 	function HideCardInfo(){
		document.getElementById('CreditCard').style.display="none";
	}//end
	
    /*----------------------------------------------------------------
    Description   :- Function to submit reserve or hold form
    Programmer    :- SBI
    Last Modified :- 18/March/2009
    -------------------------------------------------------------------*/
	function reserve_hold_submit(){
			document.reserveor_hold.action="index.php?process=reserveorhold&action=submitinfo";
			document.reserveor_hold.submit();
	}//end
	
	
    /*----------------------------------------------------------------
    Description   :- Function to confirm hold
    Programmer    :- SBI
    Last Modified :- 18/March/2009
    -------------------------------------------------------------------*/
	function confirmHold(Location,sizeId,Zipcode,OrderId){
	$.post("ajaxpage.php",{loc:Location,ut:sizeId,zp:Zipcode,orderid:OrderId,mode:"hold",rand:Math.random() } ,function(data)
		{ 
			document.getElementById('loader').style.display="block";
			if(data==' success'){
				var url = "index.php?process=reserveorhold&action=thanku&orderid="+OrderId+"&loc="+Location+"&ut="+sizeId+"&zp="+sizeId;//alert(url);
				window.location= url;
			}else {  
				document.getElementById('loader').style.display="none";
				return false;
			}
  		}
		);
	}//end
	
	
	
    /*----------------------------------------------------------------
    Description   :- Function to confirm reservation
    Programmer    :- SBI
    Last Modified :- 18/March/2009
    -------------------------------------------------------------------*/
	function confirmReservation(Location,sizeId,Zipcode,OrderId,gatway){ 
		if(gatway=='Paypal'){
			var url = "index.php?process=reserveorhold&action=paypal&orderid="+OrderId+"&loc="+Location+"&ut="+sizeId+"&zp="+sizeId;  
			window.location= url;
		}else{
			document.getElementById('loader').style.display="block";
		$.post("ajaxpage.php",{loc:Location,ut:sizeId,zp:Zipcode,orderid:OrderId,mode:"reserve",rand:Math.random() } ,function(data)
			{ //alert("herer"+data);
				if(data==' success'){
					var url = "index.php?process=reserveorhold&action=reservation_completed&orderid="+OrderId+"&loc="+Location+"&ut="+sizeId+"&zp="+sizeId;//alert(url);
					window.location= url;
				}else { //alert("sssssssssssss");
					//document.getElementById('loader').style.display="none";
					document.getElementById('loader').innerHTML=data;
					return false;
				}
			}
			);
		}
	}//end
	
    /*----------------------------------------------------------------
    Description   :- Function to submit login form
    Programmer    :- SBI
    Last Modified :- 19/March/2009
    -------------------------------------------------------------------*/
	function submitLogin(){
		document.frm_login.action="index.php?process=login";
		document.frm_login.submit();
	}//end
	
    /*----------------------------------------------------------------
    Description   :- Function to find the facility 
    Programmer    :- SBI
    Last Modified :- 19/March/2009
    -------------------------------------------------------------------*/
	function findfacility(){
		var state = document.getElementById('sel_state').value;	 //alert("inner"+state);
		if(state){
			$.post("ajaxpage.php",{state:state,mode:"findfacility",rand:Math.random() } ,function(data)
				{
						document.getElementById('facilityDiv').innerHTML = data;
				}
				);
		}else{
			document.getElementById('facilityDiv').innerHTML = '<select name="sel_facility" id="sel_facility" disabled="disabled"><option value="">Select a storage facility...</option></select>';
		}
	}
	
    /*----------------------------------------------------------------
    Description   :- Function to choose your size
    Programmer    :- SBI
    Last Modified :- 20/March/2009
    -------------------------------------------------------------------*/
	function chooseyourSize(size,url){
		window.location = "index.php?process=findstorage&size="+size;
		//window.location = "index.php?process=storagesearch&unitsSize="+size+url;
	}//end
	
	/*------------------------------------------------------------------
	Description   :- function to display payonline menu
	Programmer    :- VML
	Last Modified :- 05/FEB/2008
	---------------------------------------------------------------------*/
	function Payonelinemenu(from){
	document.getElementById('Payonline').className = "basictab";
	document.getElementById('Onetimepayment').className = "basictab";
	document.getElementById('div_Payonline').style.display='none';
	document.getElementById('div_Onetimepay').style.display = "none";
	  
	  if(from =='Payonline'){
			document.getElementById('div_Payonline').style.display='block';
			document.getElementById('Payonline').className = "selected";
		}
		if(from =='onetimepay'){
			document.getElementById('div_Onetimepay').style.display = "block";
			document.getElementById('Onetimepayment').className = "selected";
		 }
		
	 }
	
	/*------------------------------------------------------------------
	Description   :- ajaxPaging
	Programmer    :- SBI
	Last Modified :- 24/Aug/2008
	-------------------------------------------------------------------*/
	function ajax_paging(id,page){ 
	 $.post("ajaxpage.php",{ page:page,mode:"creditcardpaymentinfo",rand:Math.random() } ,function(data)
		{
				document.getElementById(id).innerHTML = data;
		}
		);
 	}
	
	/*------------------------------------------------------------------
	Description   :- Show Payment Info details
	Programmer    :- SBI
	Last Modified :- 04/June/2009
	-------------------------------------------------------------------*/
		function ShowPaymentnfo(){
			var paymenttype = document.getElementById('gateway').value;
			if(paymenttype=='paypal'){
				document.getElementById('showPaypal').style.display='block';	
 				document.getElementById('cardDetails').style.display='none';	
			}else{
				document.getElementById('showPaypal').style.display='none';	
 				document.getElementById('cardDetails').style.display='block';	
			}
 		}

