function show_form(div_id)
{
	var url_new = "type=show_reviewform";	
		
	var url="/includes/listing.php";	
		
	ajax_call(url_new, div_id, url);			
	
}
function add_review(div_id)
{
	
	var form_obj = eval("document.listing_form");	
	var place = encodeURIComponent(form_obj.place.value);
	var headline = encodeURIComponent(form_obj.headline.value);
	var comments = encodeURIComponent(form_obj.comments.value);	
	var user_code = encodeURIComponent(form_obj.user_code.value);	
	
	/*
	if(headline == false)
	{
		alert("Please Enter Review Title");		
		form_obj.headline.focus();
		return false;
	}
	if(place == false)
	{
		alert("Please Enter Where you are from?");
		form_obj.place.focus();
		return false;
	}
	*/

	//document.getElementById('comments_user').style.display = 'none';	
	//document.getElementById('temp_div').style.display = 'inline';		
	
	div_id = "comments_user";
	
	var url_new = "type=review&headline="+headline+"&place="+place+"&comments="+comments+"&user_code="+user_code;	
	
	var url="/includes/listing.php";	
	
	ajax_call(url_new, div_id, url);
	
	return true;	
	
}	

function change_rating_image(div_id,id)
{
	
	
	document.getElementById(div_id).innerHTML = "<img src='/images/saving_txt.gif'/>";	
	
	var url_new = "type=rating&user_rating="+id;	
	
	var url="/includes/listing.php";	
	
	ajax_call(url_new, div_id, url);	
	
	return false;	
	
}	

function user_rating_image(id)
{
	for(i=1; i<=id; i++)
	{
		document.getElementById("user_rating_img"+i).src = '/images/yellow_star.gif';
	}

	for(i=id+1; i<=5; i++)
	{
		document.getElementById("user_rating_img"+i).src = '/images/white_star.gif';
	}

}

function reset_rating_image(rate)
{	
	for(i=1; i<=5; i++)
	{
		if(rate >= i)
			document.getElementById("user_rating_img"+i).src = '/images/blue_star.gif';
		else
			document.getElementById("user_rating_img"+i).src = '/images/white_star.gif';

	}

}


/*
function showmap(address,map_show_cont) 
{  
   if (GBrowserIsCompatible())
   {
	var map = null;

	var geocoder = null;

	map = new GMap2(document.getElementById("map"));

	map.addControl(new GSmallMapControl());

	map.addControl(new GMapTypeControl());

	geocoder = new GClientGeocoder();  


	if (geocoder) {

	     geocoder.getLatLng(

	     address,

	     function(point) {

		if (!point) {

		 alert(address + " not found"); 

		} else {


		 var icon = new GIcon();

		 icon.image = "http://www.google.com/mapfiles/marker.png";
		 icon.shadow = "http://www.google.com/mapfiles/shadow50.png";

		 //icon.image = "/images/yellow_star.gif";
		 //icon.shadow = "/images/yellow_star.gif";

		 icon.iconSize = new GSize(34, 34);
		 icon.shadowSize = new GSize(30, 30);	 
		 icon.iconAnchor = new GPoint(8, 10);	 

		 icon.infoWindowAnchor = new GPoint(5, 1);
		 var point0 = new GPoint(point);

		 map.setCenter(point, 15);
		var propicon = new GIcon(icon);

		 var marker = new GMarker(point,propicon);            

		 map.addOverlay(marker);

		 marker.openInfoWindowHtml(map_show_cont);

		}

		}

		);

	       }
	}
} 
*/