////////////////////////////////////////////Get date displayed as Wed Mar 4 2009//////////////////////////////////////////////////////////////////////////
        function getDate(year,month,day){
                d=new Date();
                d.setFullYear(year,month,day);
               // var myDate = new Date(year,month,day);
                //alert(myDate.format('M jS, Y')); 
                //d.formatDate(MMM d, y);
                document.getElementById('date').innerHTML=d;
        }
        var country;
        var state;
        var prim_cat;
              
        function hide_subCategories(link,PM_index,PM_name,show_sub_category)
        {
               if(show_sub_category=='yes')
                {
                        setInnerHTMLById('pri_category',' > '+PM_name);
                        getById('pri_category').setAttribute('onClick',getById('primebg'+PM_index).getAttribute('onClick'));
                        setInnerHTMLById('sec_category','');
                        getById('sec_category').onclick=='';
                        if(document.getElementById('prime'+PM_index).className!="drop"){
                                document.getElementById('prime'+PM_index).className="drop";
                                document.getElementById('primebg'+PM_index).className="a";
                                document.getElementById('sec'+PM_index).style.display = 'block';
                                startAjaxCategoryInTheLeft(PM_index,PM_name);
                        }
                        else{
                                document.getElementById('prime'+PM_index).className="";
                                document.getElementById('primebg'+PM_index).className="";
                                document.getElementById('sec'+PM_index).style.display = 'none';
                        }
                }
                else
                {
                        var url="index.php?menu=search&cmd=primary_category";
                        var country=getInnerHTMLById('countryName');
                        var state=getInnerHTMLById('stateName');
                        var city=getInnerHTMLById('cityName');
                        PM_name=PM_name.replace('&','%26');
                        url+="&pri_id="+PM_index+"&pri_category="+PM_name;
                        if(country !='')
                        url+='&country='+country;
                        if(state !='')
                        url+='&state='+state;
                        if(city !='')
                        url+='&city='+city;
                        if(aa!='')
                                url += '&sel_date='+aa;
                        window.location=url;       
                }
                
        }
   /*     function hide_subCategories(link,PM_index,PM_name){
                setInnerHTMLById('pri_category',' > '+PM_name);
                //getById('pri_category').onclick="\"collapseDrop('"+PM_index+"','"+PM_name+"');\"";//link.onclick;
                document.getElementById('pri_category').setAttribute('onclick',"collapseDrop('"+PM_index+"','"+PM_name+"');");
                setInnerHTMLById('sec_category','');
                getById('sec_category').onclick=='';
                if(document.getElementById('prime'+PM_index).className!="drop"){
                        document.getElementById('prime'+PM_index).className="drop";
                        document.getElementById('primebg'+PM_index).className="a";
                        document.getElementById('sec'+PM_index).style.display = 'block';
                        startAjaxCategoryInTheLeft(PM_index,PM_name);
                }
                else{
                        document.getElementById('prime'+PM_index).className="";
                        document.getElementById('primebg'+PM_index).className="";
                        document.getElementById('sec'+PM_index).style.display = 'none';
                      
                }
                
        }*/
        
        function get_cities(link,PM_index,city){
             
               
                if(document.getElementById('allstatebg'+PM_index).className!="drop"){
                        //document.getElementById('allstatebg'+PM_index).className="drop";
                        //document.getElementById('statebg'+PM_index).className="a";
                        //document.getElementById('city'+PM_index).style.display = 'block';
                        startAjaxCityInBase(link,PM_index,city);
                }
               /* else{
                        document.getElementById('allstatebg'+PM_index).className="";
                        document.getElementById('statebg'+PM_index).className="";
                        document.getElementById('city'+PM_index).style.display = 'none';
                        document.getElementById('breadcum').innerHTML=country+state;
                        
                }*/
                
        }
        function getCity(city){
                setInnerHTMLById("pre_city_arrow"," > ");
                document.getElementById('cityName').innerHTML=city;
                getById('cityName').onclick="javascript:getCity('"+city+"');";
        
        }
        function hideRemove(no){
                for(i=20;i<no;i++){
                        
                        document.getElementById('prime'+i).style.display='block';
                        document.getElementById('hide').style.display='none';
                
                }
        }
        function hideStates(no){
                for(i=20;i<no;i++){
                        document.getElementById('states'+i).style.display='block';
                        document.getElementById('hidestates').style.display='none';
                }
        }
        
        function checkNumberOfCategories(no){
                while(no==5){
                if(no==5)
                        alert("you cannot select more than 5 categories");
                else
                        no++;
                }
                      
        }
        function highlightEvent(){
        
                alert('event');
                if(document.getElementById('event').className!="current"){
                        document.getElementById('event').className=="current";   
                }
                else
                        document.getElementById('event').className=="";
        }
        
        function count(no){
                
                document.getElementById("inp_char").style.display = 'inline';
                //document.getElementById("inp_char").innerHTML=+'Characters Left';
                if(no >500 ){
                        document.addevent.event_desc.value=document.addevent.event_desc.value.substring(0,500);
                        document.getElementById("char").value = 0;
                        alert("Please Enter Description in between 500 character");
                }
                 
        }
        
        function displayDays(rad_val){
                
                if(rad_val=='Weekly')
                document.getElementById('day').style.display = 'block';
                else
                document.getElementById('day').style.display = 'none';
        }
        function get_radio_value(){
               
                for (var i=0; i < document.addevent.type.length; i++){
                        if (document.addevent.type[i].checked){
                                var rad_val = document.addevent.type[i].value;
                        }
                }
              
                displayDays(rad_val);
                
        }
        function displayPriceBox(price_val){
                
                if(price_val=='cost1')
                document.getElementById('price').style.display = 'block';
                else
                document.getElementById('price').style.display = 'none';
        }
        function get_price(){
              
                for (var i=0; i < document.addevent.cost1.length; i++){
                        if (document.addevent.cost1[i].checked){
                                var price_val = document.addevent.cost1[i].value;
                        }
                }
                
                displayPriceBox(price_val);
                
        }

        function get_URL(link,id,pname,pri_id,pri_name)
        {
            pri_name = pri_name.replace('&','%26');
            pname=pname.replace('&','%26');
            var url="index.php?menu=search&cmd=categories&pri_id="+pri_id+"&pri_category="+pri_name+"&id="+id+"&name="+pname;
            var state=getInnerHTMLById('stateName');
            var country=getInnerHTMLById('countryName');
            var city=getInnerHTMLById('cityName');
            setInnerHTMLById('sec_category',' > '+pname);
            getById('sec_category').onclick=link.onclick;
            if(country !='')
	    url+='&country='+country;
            if(state !='')
	    url+='&state='+state;
            if(city !='')
            url+='&city='+city;
            if(aa!='')
                        url += '&sel_date='+aa;
            window.location=url;  
        }
      
      /*  function get_URL(link,id,pname,pri_id,pri_name){
            pri_name = pri_name.replace('&','%26');
            var url="index.php?menu=search&cmd=categories&pri_id="+pri_id+"&pri_category="+pri_name+"&id="+id+"&name="+pname;
            var state=getInnerHTMLById('stateName');
            var country=getInnerHTMLById('countryName');
            var city=getInnerHTMLById('cityName');
            if(pname !='')
            setInnerHTMLById('sec_category',' > '+pname);
            getById('sec_category').onclick=link.onclick;
            if(country !='')
	    url+='&country='+country;
            if(state !='')
	    url+='&state='+state;
            if(city !='')
            url+='&city='+city;
            if(pname=='' && id=='' && document.getElementById('prime'+pri_id).className!="drop")
                window.location=url;
            else if(pname!='' && id!='' && document.getElementById('prime'+pri_id).className=="drop")
                window.location=url;
            else{
                        document.getElementById('prime'+pri_id).className="";
                        document.getElementById('primebg'+pri_id).className="";
                        document.getElementById('sec'+pri_id).style.display = 'none';
                      
                }
                
        }*/
        
        function collapseDrop(PM_index,PM_name){
                if(document.getElementById('prime'+PM_index).className!="drop"){
                        document.getElementById('prime'+PM_index).className="drop";
                        document.getElementById('primebg'+PM_index).className="a";
                        document.getElementById('sec'+PM_index).style.display = 'block';
                        //startAjaxCategoryInTheLeft(PM_index,PM_name);
                }
                else{
                        document.getElementById('prime'+PM_index).className="";
                        document.getElementById('primebg'+PM_index).className="";
                        document.getElementById('sec'+PM_index).style.display = 'none';
                      
                }
        }
        
        function keywordSearch(num){
                
                var state=getInnerHTMLById('stateName');
                var country=getInnerHTMLById('countryName');
                var city=getInnerHTMLById('cityName');
                var url="index.php?menu=search&cmd=keywords";
                //alert(url);
                if(num==2)
                        var val=document.keyword.keywords_bottom.value;
                else
                        var val=document.keyword_top.keywords.value;
                if(val !='')
                        url+='&keyword='+val;
                if(country !='')
                    url+='&country='+country;
                if(state !='')
                    url+='&state='+state;
                if(city !='')
                    url+='&city='+city;
                    
                window.location=url;
                     
        }
        function get_open_now_URL(){
            
            var url="index.php?menu=open_now";
            var state=getInnerHTMLById('stateName');
            var country=getInnerHTMLById('countryName');
            var city=getInnerHTMLById('cityName');
           
            if(country !='')
                url+='&country='+country;
            if(state !='')
                url+='&state='+state;
            if(city !='')
                url+='&city='+city;
            
            window.location=url;
            
        }
        function get_local_help_URL(menu){
            
            var url="index.php?menu="+menu;
            var state=getInnerHTMLById('stateName');
            var country=getInnerHTMLById('countryName');
            var city=getInnerHTMLById('cityName');
           
            if(country !='')
                url+='&country='+country;
            if(state !='')
                url+='&state='+state;
            if(city !='')
                url+='&city='+city;
            
            window.location=url;
            
        }