// Method to reload ads
function reloadAd(adSize, h_ord, w, h){
	h_tile+=1;
	frameId='frame-'+adSize;
	
	if(!document.getElementById(frameId)){
			
			var adFrame = $("<iframe />")
			var adSrc   = '/php/ads/ad-tags.php?h_ord='+h_ord+'&size='+adSize+'&section='+section+'&post='+post+'&h_tile='+h_tile;
 			adFrame.attr("src",adSrc);
			adFrame.attr("scrolling","no");
			adFrame.attr("width",w);
			adFrame.attr("height",h);
			adFrame.attr("frameborder",0)
			var adDiv = $("#"+adSize);
			adDiv.empty();
			adDiv.append(adFrame);
	
	}else{
   	
		document.getElementById(frameId).src = '/php/ads/ad-tags.php?h_ord='+h_ord+'&size='+adSize+'&section='+section+'&post='+post+'&h_tile='+h_tile;
	
	}
return true;
}

function get_page_url(url){
	var page = url+'#'+currentPage;
	return page;
}

// Track refresh in Google Analytics
function track_pageview(args){
	var ref = (typeof args.ref == 'undefined') ? "" : args.ref;
	var url = (typeof args.url == 'undefined') ? "" : args.url;
	var pageTracker = _gat._getTracker("UA-932072-1");
	pageTracker._trackPageview(url + ref); 
}

//search box
$(function() {
	$('.s-text').focus(function() {
		$(this).val('');
	});
});
