  var YWSID = "wo_mQNyjWzprfWtETVkicg"; // common required parameter (api key)

    var map = null;
    var icon = null;

    /*
     * Creates the map object and calls setCenterAndBounds
     * to instantiate it.
     */
	 

    /*
     * Construct the URL to call for the API request
     */
    function constructYelpURLNew(term,location, counter) {
/*        var mapBounds = map.getBounds();*/

        var URL = "http://api.yelp.com/" +
            "business_review_search?"+
            "callback=" + "handleResults_" + counter + 
            "&term=" + term + 
			"&location=" + location + 	
          //  "&num_biz_requested=1" +
			// "&limit=1" +
            "&ywsid=" + YWSID;

        return encodeURI(URL);
		

		
		
    }

    /*
     * Called on the form submission: updates the map by
     * placing markers on it at the appropriate places
     */

    function YelpReviews(term, location, counter) {
		     
        var yelpRequestURL = constructYelpURLNew(term,location, counter);

        /* do the api request */
        var script = document.createElement('script');
        script.src = yelpRequestURL;
        script.type = 'text/javascript';
        var head = document.getElementsByTagName('head').item(0);
        head.appendChild(script);
        return false;
    }

/*  get  Lat, Lon from post code ---------------------- */
function usePointFromPostcode(postcode,callbackFunction) {
	var localSearch = new GlocalSearch();
	localSearch.setSearchCompleteCallback(null, 
		function() {
			
			if (localSearch.results[0])
			{		
				var resultLat = localSearch.results[0].lat;
				var resultLng = localSearch.results[0].lng;
				var point = new GLatLng(resultLat,resultLng);
				callbackFunction(point);
				setCenterToPoint(point);
			}else{
				alert("Postcode not found!");
			}
		});	
		
	//localSearch.execute(postcode + ", UK");
	localSearch.execute(postcode);
}

    function createMarkerNew(biz, point, markerNum) {
		var reviewHtml = generateInfoReviewHtmlNew(biz);
		document.getElementById('div_reviews_'+markerNum).innerHTML = reviewHtml;
			
			
    }
	
	// created by INDRA KUMAR--------
	
	function generateInfoReviewHtmlNew(biz)
	{ 
		
		var text = '';
				
			text += '<a href="'+biz.url+'" target="_blank">';
			text += '<img src="' + biz.rating_img_url_small + '" alt="Yelp Rating: ' + biz.avg_rating + '"  title="Yelp Rating: ' + biz.avg_rating + '" /></a>' ;
	
		text += '';
		return text;
	}
