function display_latestitems_ci(url)
{
	$("#latest_div").html("<div style='text-align:center;width:430px;'><img src='"+baseurl+"images/pre_loader_green.gif'></div>");
	$.ajax(	{
			   type: "POST",
			   url: url,
			   data: "",
			   success: function(html)	{
					
					$("#latest_div").html(html);
					
					
										}
			}); 
}
function showpost(url)
	{
		//alert(url);
		document.getElementById('blogs_div').style.display='none';		
		document.getElementById('blog_view').style.display='block';		
		$.ajax({
		   type: "POST",
			 url: url,
		   data: "",
		   success: function(html){
				 $("#blog_view").html(html);
		   }
	 }); 
		
	}
	
	function display_hotitem(url,id,address)
	{
		if(address)
			display_google_map(address);
		document.getElementById('blog_view').style.display='none';
		document.getElementById('hotitems_div').style.display='block';		
		document.getElementById('latest_div').style.display='none';
        $("#hotitems_div").html("<div style='text-align:center;width:430px;'><img src='"+baseurl+"images/pre_loader_green.gif'></div>");
		$.ajax({
		   type: "POST",
			 url: url,
		   data: "",
		   success: function(html){
			    
				 $("#hotitems_div").html(html);
				 if(id)
			    {
				  disp_id="hotitem_"+id;
				  highlightid="highlighthotitem_"+id;
				  
				  document.getElementById(disp_id).focus();
				   scrollheight=document.getElementById(highlightid).clientHeight;
				   scrollheight=scrollheight+180;
				  window.scrollBy(0,scrollheight);
				  document.getElementById(highlightid).style.backgroundColor="#FFFD56";
				  fadeid="#"+highlightid;
				  $(fadeid).animate({backgroundColor:"#EEF4FF"},3000);
				}
		   }
		}); 
		
			removestyle_deals();
			removestyle_blogs();
			removestyle_comments();
			removestyle_storeinfo();
			removestyle_photo();
			removestyle_past_hotitems();
			removestyle_past_deals();
			removestyle_latest();
		 document.getElementById('hotitems').className ='active_link_class';
	}

	
	function display_latest(url,id,address)
	{ 
		if(address)
			display_google_map(address);
		document.getElementById('blog_view').style.display='none';
		document.getElementById('deals_div').style.display='none';	
		document.getElementById('latest_div').style.display='block';
        $("#latest_div").html("<div style='text-align:center;width:430px;'><img src='"+baseurl+"images/pre_loader_green.gif'></div>");
			
		$.ajax({
		   type: "POST",
			 url: url,
		   data: "",
		   success: function(html){
				 $("#latest_div").html(html);
				 if(id)
			    {
				  disp_id="latest_"+id;
				  highlightid="highlightlatest_"+id;
				  if(document.getElementById(disp_id))
				  {
					  document.getElementById(disp_id).focus();
					   scrollheight=document.getElementById(highlightid).clientHeight;
					   scrollheight=scrollheight+180;
				  window.scrollBy(0,scrollheight);
					  document.getElementById(highlightid).style.backgroundColor="#FFFD56";
					  fadeid="#"+highlightid;
					  $(fadeid).animate({backgroundColor:"#ffffff"},3000);
				  }
				  else
				  {
					  fadeid="#"+highlightid;	
					  $(fadeid).animate({backgroundColor:"#EEF6FF"},3000);
				  }
				}
		   }
		});
		
			removestyle_deals();
			removestyle_hotitems();
			removestyle_blogs();
			removestyle_comments();
			removestyle_storeinfo();
			removestyle_photo();
			removestyle_past_hotitems();
			removestyle_past_deals();
			
		 document.getElementById('latest').className ='active_link_class';
	}

	function display_latest_shopper(url,id,address)
	{ 
		if(address)
			display_google_map(address);
		document.getElementById('blog_view').style.display='none';
		document.getElementById('deals_div').style.display='none';	
		document.getElementById('latest_div').style.display='block';
        $("#latest_div").html("<div style='text-align:center;width:430px;'><img src='"+baseurl+"images/pre_loader_green.gif'></div>");
			
		$.ajax({
		   type: "POST",
			 url: url,
		   data: "",
		   success: function(html){
				 $("#latest_div").html(html);
				 if(id)
			    {
				  disp_id="latest_"+id;
				  highlightid="highlightlatest_"+id;
				  if(document.getElementById(disp_id))
				  {
					  document.getElementById(disp_id).focus();
					   scrollheight=document.getElementById(highlightid).clientHeight;
					   scrollheight=scrollheight+180;
				  window.scrollBy(0,scrollheight);
					  document.getElementById(highlightid).style.backgroundColor="#FFFD56";
					  fadeid="#"+highlightid;
					  $(fadeid).animate({backgroundColor:"#ffffff"},3000);
				  }
				  else
				  {
					  fadeid="#"+highlightid;	
					  $(fadeid).animate({backgroundColor:"#EEF6FF"},3000);
				  }
				}
		   }
		});
		
			removestyle_deals();
			removestyle_hotitems();
			removestyle_blogs();
			removestyle_comments();
			removestyle_storeinfo();
			removestyle_photo();
			removestyle_past_hotitems();
			removestyle_past_deals();
			
		 document.getElementById('latest').className ='active_link_class';
	}


	function display_deals(url,id,address)
	{
		if(address)
			display_google_map(address);
		document.getElementById('blog_view').style.display='none';
		document.getElementById('deals_div').style.display='block';		
		document.getElementById('latest_div').style.display='none';
        $("#deals_div").html("<div style='text-align:center;width:430px;'><img src='"+baseurl+"images/pre_loader_green.gif'></div>");
		$.ajax({
		   type: "POST",
			 url: url,
		   data: "",
		   success: function(html){
				 $("#deals_div").html(html);
				 if(id)
			    {
				  disp_id="deal_"+id;
				  highlightid="highlightdeal_"+id;
				 
				  scrollheight=document.getElementById(highlightid).clientHeight;
				  document.getElementById(disp_id).focus();
				  scrollheight=scrollheight+180;
				  window.scrollBy(0,scrollheight);
				  
				  document.getElementById(highlightid).style.backgroundColor="#FFFD56";
				  fadeid="#"+highlightid;
				  $(fadeid).animate({backgroundColor:"#FFFFFF"},3000);
				}
		   }
		}); 
		
			removestyle_hotitems();
			removestyle_blogs();
			removestyle_comments();
			removestyle_storeinfo();
			removestyle_photo();
			removestyle_past_hotitems();
			removestyle_past_deals();
			removestyle_latest();
		 document.getElementById('deals').className ='active_link_class';
			
	}
	
	function display_blogs(url)
	{
		document.getElementById('blog_view').style.display='none';
		document.getElementById('blogs_div').style.display='block';		
		document.getElementById('latest_div').style.display='none';
         $("#blogs_div").html("<div style='text-align:center;width:430px;'><img src='"+baseurl+"images/pre_loader_green.gif'></div>");
		$.ajax({
		   type: "POST",
			 url: url,
		   data: "",
		   success: function(html){
				 $("#blogs_div").html(html);
		   }
		}); 
		
			removestyle_hotitems();
			removestyle_deals();
			removestyle_comments();
			removestyle_storeinfo();
			removestyle_photo();
			removestyle_past_hotitems();
			removestyle_past_deals();
			removestyle_latest();
		 document.getElementById('blogs').className ='active_link_class';
	}

	function display_comments(url)
	{	
		document.getElementById('blog_view').style.display='none';
		document.getElementById('comment_div').style.display='block';		
		document.getElementById('latest_div').style.display='none';
        $("#comment_div").html("<div style='text-align:center;width:430px;'><img src='"+baseurl+"images/pre_loader_green.gif'></div>");
		$.ajax({
		   type: "POST",
			 url: url,
		   data: "",
		   success: function(html){
				 $("#comment_div").html(html);
		   }
		});
		
			removestyle_hotitems();
			removestyle_deals();
			removestyle_blogs();
			removestyle_storeinfo();
			removestyle_photo();
			removestyle_past_hotitems();
			removestyle_past_deals();
			removestyle_latest();
			document.getElementById('comment').className ='active_link_class';	
	}
	
	function display_storeInfo(address)
	{
		if(document.getElementById('blog_view'))
		document.getElementById('blog_view').style.display='none';
		
		if(document.getElementById('storeinfo_div'))
		document.getElementById('storeinfo_div').style.display='block';
			
			
			removestyle_hotitems();
			removestyle_deals();
			removestyle_blogs();
			if(window.removestyle_blog)
			removestyle_blog();
			removestyle_comments();
			if(window.removestyle_recent)
			removestyle_recent();		 //hide recent tab (deals- recent deals)
			if(window.removestyle_past)
			removestyle_past();			//hide recent tab  (deals- past deals)
			removestyle_past_hotitems(); //hide past hot item which arew comming under hot item when user clik on view past hot item
			removestyle_past_deals();//hide past deals which arew comming under deals when user clik on view past deal
			removestyle_latest(); 	//To hide latest tab
			removestyle_photo();	//To hide photo tab
			if(window.removestyle_friends)
			removestyle_friends();	//To hide comment tab
		
		
		if(document.getElementById('storeinfo')){
		document.getElementById('storeinfo').removeAttribute('class');
		document.getElementById('storeinfo').className ='active_link_class';
		}
		if(document.getElementById('messages')){
		document.getElementById('messages').removeAttribute('class');
		document.getElementById('messages').className ='active_link_class';
		}
		
		
		if(document.getElementById('messages_div'))
		document.getElementById('messages_div').style.display='block';
		document.getElementById('latest_div').style.display='none';
        
		display_google_map(address);
	}
	
	function display_past_hotitems(url)
	{
		document.getElementById('blog_view').style.display='none';
		document.getElementById('past_hotitems_div').style.display='block';		
		$.ajax({
		   type: "POST",
			 url: url,
		   data: "",
		   success: function(html){
				 $("#past_hotitems_div").html(html);
		   }
		});			
		
		removestyle_hotitems();
		removestyle_deals();
		removestyle_blogs();
		removestyle_comments();
		removestyle_storeinfo();
		removestyle_photo();
		removestyle_past_deals();
		removestyle_latest();
		document.getElementById('hotitems').className ='active_link_class';
		document.getElementById('latest_div').style.display='none';
	}
	
	function display_past_deals(url)
	{
		document.getElementById('blog_view').style.display='none';
		document.getElementById('past_deals_div').style.display='block';		
		$.ajax({
		   type: "POST",
			 url: url,
		   data: "",
		   success: function(html){
				 $("#past_deals_div").html(html);
		   }
		});		
		
		removestyle_hotitems();
		removestyle_deals();
		removestyle_blogs();
		removestyle_comments();
		removestyle_past_hotitems();
		removestyle_storeinfo();
		removestyle_photo();
		removestyle_latest();

		document.getElementById('deals').className ='active_link_class';
		document.getElementById('latest_div').style.display='none';
	}

	
	function removestyle_hotitems()
	{
		if(document.getElementById('hotitems_div'))
		{
			document.getElementById('hotitems_div').style.display='none';		
			document.getElementById('hotitems').className ='display_menu';
		}
	}
	
	function removestyle_deals()
	{
		if(document.getElementById('deals_div'))
		{
			document.getElementById('deals_div').style.display='none';		
			document.getElementById('deals').className ='display_menu';
		}
	}
	
	function removestyle_blogs()
	{
		if(document.getElementById('blogs_div'))
		{
			document.getElementById('blogs_div').style.display='none';
			
			if(document.getElementById('blogs'))
			{
				document.getElementById('blogs').className ='display_menu';
			}
		}
	}
	
	function removestyle_comments()
	{
		if(document.getElementById('comment_div'))
		{
			document.getElementById('comment_div').style.display='none';
			document.getElementById('comment').className ='display_menu';
		}
	}
	
	function removestyle_storeinfo()
	{
		if(document.getElementById('storeinfo_div'))
		{
			document.getElementById('storeinfo_div').style.display='none';
			document.getElementById('storeinfo').className ='display_menu';
		}
		if(document.getElementById('messages_div'))
		{
			document.getElementById('messages_div').style.display='none';
			document.getElementById('messages').className ='display_menu';
		}
		
	}
	
	function removestyle_past_hotitems()
	{
			if(document.getElementById('past_hotitems_div'))
		document.getElementById('past_hotitems_div').style.display='none';
		
		//document.getElementById('hotitems').className ='display_menu';
	}
	
	function removestyle_past_deals()
	{
		if(document.getElementById('past_deals_div'))
		document.getElementById('past_deals_div').style.display='none';
		
		//document.getElementById('deals').className ='display_menu';
	}
	function removestyle_latest()
	{
        if(document.getElementById('latest'))
		{
			document.getElementById('latest').removeAttribute('class');
            document.getElementById('latest').className ='display_menu';
		
		} 
        if(document.getElementById('latest_div'))
		{
			document.getElementById('latest_div').removeAttribute('class');
			document.getElementById('latest_div').style.display='none';
		
		}
	}
	
	
	
	function display_referbox()
	{
		/* document.getElementById('referbox').style.display='block';
		document.getElementById('forgetPass').style.display="none"; */
		//document.getElementById('sign_in').style.display="none"; 
		Popuphelper.show('position',Screen.getBody(),'center center',{'constrainToScreen':true});
		document.getElementById('signup_mail').focus();
	}
    
    function display_referbox_specific()
	{
		//storeid="00"+storeid;
		var flag = true;
		
	   referbox = document.getElementById('referbox');       
		referbox.style.display='block';
		referbox.style.position='absolute';
		
		//document.getElementById('forgetPass').style.display="none";
		//document.getElementById('sign_in'+storeid).style.display="none";
       //alert('Total width :'+screen.width+' out of which x position :'+e.screenX);
       //alert('Total height :'+screen.height+' out of which y position :'+e.screenY);
	}
	function getScrollXY() {
      var scrOfX = 0, scrOfY = 0;
      if( typeof( window.pageYOffset ) == 'number' ) {
        //Netscape compliant
        scrOfY = window.pageYOffset;
        scrOfX = window.pageXOffset;
      } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
        //DOM compliant
        scrOfY = document.body.scrollTop;
        scrOfX = document.body.scrollLeft;
      } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
        //IE6 standards compliant mode
        scrOfY = document.documentElement.scrollTop;
        scrOfX = document.documentElement.scrollLeft;
      }
      //return [ scrOfX, scrOfY ]; 
      return scrOfY ; //returning only the Y as we are dealing with Y co-ordinate only.
}
	
	function display_blog_view_popup()
	{
		if((document.getElementById('blog_view_popup').style.display) =='block')
			document.getElementById('blog_view_popup').style.display='none';
		else
			document.getElementById('blog_view_popup').style.display='block';
	}
	
	function display_comment_popup()
	{
		if((document.getElementById('comment_popup').style.display) =='block')
			document.getElementById('comment_popup').style.display='none';
		else
			document.getElementById('comment_popup').style.display='block';
	}
	
	function openSign_in()
	{
		document.getElementById('referbox').style.display="none";
		if(document.getElementById('sign_in'))
		document.getElementById('sign_in').style.display="block";
		document.getElementById('errorlogin').style.display="none";
		
	}
    
    function openSign_in_specific(storeid)
	{
		storeid="00"+storeid;
		document.getElementById('referbox'+storeid).style.display="none";
		document.getElementById('sign_in'+storeid).style.display="block";
		document.getElementById('errorlogin').style.display="none";
		
	}
	
	function closeSign_in()
	{
		document.getElementById('sign_in').style.display="none";
		document.getElementById('email').value="";
		if(document.getElementById('password'))
		{
			document.getElementById('password ').value="";	
		}		
		
		//document.getElementById('errormsg').style.display="none";
	}
    
    function closeSign_in_specific(storeid)
	{
		storeid="00"+storeid;
		document.getElementById('sign_in'+storeid).style.display="none";
		document.getElementById('email').value="";
		if(document.getElementById('password'))
		{
			document.getElementById('password').value="";	
		}		
		
		//document.getElementById('errormsg').style.display="none";
	}
    
	function email_check(id)
	{
		var email = document.getElementById('email'+id).value;
		var password = document.getElementById('password'+id).value;
		
		if(email=="")
		{
			document.getElementById('errorlogin').style.display="block";
			return false;
		}
		if(password=="")
		{
			document.getElementById('errorlogin').style.display="block";
			return false;
		}
		if(email=="" || password=="")
		{
			return false;
		}
		else
		{	
			return true;
		}
	}
	
	function openSign_in_error()
	{
		document.getElementById('sign_in').style.display="block";
		document.getElementById('errorlogin').style.display="block";
	}
	
	function closeForgetPassword()
	{
		document.getElementById('forgetPass').style.display="none";
		document.getElementById('paasEmail').value="";
		document.getElementById('errormsg').style.display="none";
	}
	function forgetPassword()
	{
		document.getElementById('sign_in').style.display="none";
		document.getElementById('forgetPass').style.display="block";
	}
	/* Function : used for showing forgot password popup store_id( 'referbox'+row->id) These fun called from frontpage2009_content*/
	function forgot_Pass(store_id)
	{
		document.getElementById(store_id).style.display="none";
		document.getElementById('forgetPass').style.display="block";
	}
    function forgetPassword_specific(storeid)
	{
		document.getElementById('sign_in'+storeid).style.display="none";
		document.getElementById('forgetPass').style.display="block";
	}
	function submitForgetPassword()
	{
		//alert(baseurl);
		var email = document.getElementById('paasEmail').value;
		if(email.length >0)
		{
			
			document.forgetPassform.action=baseurl+"homepage/forgetPassword";
			
			var options =
				 {
					  type:"POST",
					  success:showresponse
				};
				
			$('#forgetPassform').ajaxSubmit(options); 
			
			//document.getElementById("abuse_error").style.display="none";
		}
		return false;
	}
			
	function showresponse(responseText, statusText)
	{
		//alert(responseText);
		if(responseText=="error" )
		{
			
			document.getElementById('errormsg').style.display="block";
		}
		else
		{
			document.getElementById('paasEmail').value="";
			document.getElementById('errormsg').style.display="none";
			document.getElementById('forgetPass').style.display="none";
		}
	}
    
    function display_google_map(address)
    {
         showAddress(address);

    }
    /**
    *description: function to initilize and load google map with desired address being marked.
    *author:aniket
    *date:23th July 2009
    *version: 1.0
    *reference: http://code.google.com/apis/maps/
    */
    
    function showAddress(address)
    {
        var map = new GMap2(document.getElementById('google_map_div'));
		if(document.getElementById('photo_googlemap')!=null)
    	displaySmallGoogleMap(address);
        var mapControl = new GMapTypeControl();
        map.addControl(mapControl);
        map.addControl(new GSmallMapControl());
        var geocoder = new GClientGeocoder();
        geocoder.getLatLng(
            address,
            function(latlng)
            {
                if (!latlng)
                {
                  //  alert(address + " not found");
                }
                else
                {
                    map.setCenter(latlng, 15);
                    var marker = new GMarker(latlng);
                    map.addOverlay(marker);  
                }
            }
          );
    }
    
	    function displaySmallGoogleMap(address)
    {
    	var map2 = new GMap2(document.getElementById('photo_googlemap')/* ,{ size: new GSize(100,100)} */);
    	var mapControl2 = new GSmallMapControl();
    	 //map2.addControl(mapControl2);
    	 //map2.addControl(new GSmallZoomControl());
    	 var geocoder = new GClientGeocoder();
         geocoder.getLatLng(
             address,
             function(latlng)
             {
                 if (!latlng)
                 {
                    // alert(address + " not found");
                 }
                 else
                 {
                	 map2.setCenter(latlng, 15);
 					 var marker1 = new GMarker(latlng);
 					 map2.addOverlay(marker1);
                 
                 }
             }
           );
    }
	function display_photo()
	{
		 document.getElementById('photo_div').style.display="block";

			removestyle_deals();
			if(window.removestyle_recent)
			removestyle_recent();
			removestyle_blogs();
			removestyle_comments();
			removestyle_storeinfo();
			removestyle_past_hotitems();
			removestyle_hotitems();
			removestyle_past_deals();
			removestyle_latest();
			if(window.removestyle_stores)
			removestyle_stores();
			if(window.removestyle_friends)
			removestyle_friends();
			if(window.removestyle_past)
			removestyle_past();
			
			
			
		document.getElementById('image').removeAttribute('class');
		document.getElementById('image').className ='active_link_class';
		//alert("img");
		//alert("img");
	}
    function removestyle_photo()
	{
		if(document.getElementById('photo_div'))
		{
			document.getElementById('photo_div').style.display='none';		
			document.getElementById('image').className ='display_menu';
		}
	}

