/**
main.js (0.75)
*/
 jQuery(document).ready(function() {
      setInterval("checkAnchor()", 300);  
 });  
 var currentAnchor = null;
 var currentSearch = null;
 //Function which chek if there are anchor changes, if there are, sends the ajax petition  
 function checkAnchor(){  
     //Check if it has changes  
 if(document.location.hash){
	 if(document.location.hash=='#loadSearch'){
		//if(currentSearch != jQuery('#textsearch').val()){
			//alert('in');
			currentAnchor = document.location.hash;
		 	currentSearch = jQuery('#textsearch').val();
			getSearch(jQuery('#textsearch').val(),1);
			//alert('try');
			document.location.hash='loadSearchC';
	 		return;
		//}
		//return;
	 }
	 if(document.location.hash=='#loadSearchC'){
		return;
	 }	 
     if(currentAnchor != document.location.hash){  
         currentAnchor = document.location.hash;
		 currentSearch = null;
		 var splits = currentAnchor.substring(1).split('_');
		 //callfunction = currentAnchor.substring(1,currentAnchor.length);
		 //alert(callfunction);
		 window[splits[0]](splits[1]);
		 //alert(currentAnchor + '-' + previousAnchor);
		 //previousAnchor=currentAnchor;
		 /*
         //if there is not anchor, the loads the default section  
         if(!currentAnchor)  
             query = "section=home";  
         else  
         {  
             //Creates the  string callback. This converts the url URL/#main&id=2 in URL/?section=main&id=2  
               
             //Get the section  
             var section = splits[0];  
             delete splits[0];  
             //Create the params string  
             var params = splits.join('&');  
             var query = "section=" + section + params;  
         }  
         //Send the petition  
         $.get("callbacks.php",query, function(data){  
             $("#content").html(data);  
         });
		 */
    }
 }
 }
 function pac(){
	 
	alert("called"); 
 }
  function farm(){
	 
	alert("called"); 
 }