// JavaScript Document
<!--
function onLoadRating(div,ratingId){
	// alert(div+'/'+ratingId);
	 var rating = new Spry.Widget.Rating(div,{readOnly:isReadOnly, ratingValue:getRating(ratingId), allowMultipleRating:false, allowMultipleVoting: allowRatingOnce, rateHandler:sendRating});
}

function getVenThumb(region,lookupFunc){ //(region, lookupFunc){
	var id = lookupFunc('{venPagingDs::ts:id}');
	var div = id+'Img';
	var img = id+'_logo';
	Spry.Utils.updateContent(div,'includes/widgets/media/get_media.php?folder=venues&match='+img);
}
// this is a function to change the display type
function getVenLink(region, lookupFunc){
	var id = lookupFunc('{venPagingDs::ts:id}');
	/*id = id.substring(id.lastIndexOf(':'));*/
	return venDisplayUrl+ ((venDisplayUrl.indexOf("?") == -1 )? '?id=' : '&id=') + id;
}

function getVenByFilter(notifier,data){
	if(venDontNotify)
		return false;
	var url;
	var params;
	url = venURL;
	params = 'search=true&'+data+'&'+venFilterParams;
	venListDs.setURL(url,{method:"POST",postData:params,headers: {  "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8" }});
	venListDs.loadData();
}
var params = ((window.location.search).search('search') != -1)? (window.location.search).replace("?",'') : 'search=true&'+venFilterParams; // search from url params
var venDisplayUrl = defaultVenDisplayURL? defaultVenDisplayURL : '?page=display'; // url to display ven details
var venURL = "includes/widgets/venues/get_venues_com.php";
var venListDs = new Spry.Data.XMLDataSet(venURL, "feed/entry", {method: "POST", postData: params, headers: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8" }});
venListDs.setColumnType("published", "date");
venListDs.setColumnType("updated", "date");
venListDs.setColumnType("content", "html");
var venPagingDs = new Spry.Data.PagedView(venListDs, { pageSize: venPagesSize });
var venPagingDsInfo = venPagingDs.getPagingInfo();
var filterNotifier = filterNotifier? filterNotifier : new Spry.Utils.Notifier();
var venObserver = {};
venObserver.getByFilter = getVenByFilter;
filterNotifier.addObserver(venObserver);
//-->
