/**
 * library works with local content
 */

/**
 * Function sends ajax request and shows news for requested region
 * @author benjamin.povirk@pop-tv.si, 22.6.08
 * @return string innerHTML
 */
function regionSelect(rid) {
	var url = '/lbin/ajax/region_select.php?method=ajax&rid='+rid;
	returnContent('region_box_content', url);
}

/**
 * Function shows list of selectable regions and hides news from region showing
 * @author benjamin.povirk@pop-tv.si, 22.6.08
 */
function regionShowList() {
	$('region_box_region_news').style.display = 'none';
	$('region_box_regions_list').style.display = 'block';
}

/**
 * Function requests content for region_id on domready if region_id cookie is set. Used when loading generated page.
 * @author benjamin.povirk@pop-tv.si, 22.6.08
 * @return string innerHtml
 */
window.addEvent('domready', function()	{
	var regionCookie = Cookie.get('rid');
	if (  regionCookie != '' && typeof(regionCookie) != 'undefined' )
		regionSelect(regionCookie);
	return false;
});

