function setNewLocale(){
	f = document.forms["form_locale"];
	if(window.location.search == ""){
		f.action = "index.php";
	}
	f.submit();
}

function changeNewsCategory(url){
	window.location = url;
}

function showNews(num){
	var loc = window.location;
	var prefix = (String(loc).indexOf("?") > -1 ? "&" : "?");
	//alert(String(loc).indexOf("?"));
	window.location = loc + prefix + "news_id=" + num; 
}

function returnToAllNews(newsNum){
	var loc = String(window.location);
	loc = loc.replace("&news_id=" + newsNum, "");
	loc = loc.replace("?news_id=" + newsNum, "");
	window.location = loc;
}

function doSearch(){
	var sStr = document.getElementById("searchInp").value;
	if(sStr == "" || sStr == " "){
		return;
	}
	var sSelect = document.getElementById("sSelect");
	sSelect = sSelect.options[sSelect.selectedIndex].value;
	while(sStr.indexOf("&") > -1){
		sStr = sStr.replace("&", "");
	}
	var loc = String(window.location);
	if(loc.indexOf("search") > 0){
		loc = loc.substr(0, loc.indexOf("search")-1);
	}
	var prefix = (String(loc).indexOf("?") > -1 ? "&" : "?");
	if(loc.indexOf("index.php") < 0){
		prefix = "index.php" + prefix;
	}
	window.location = loc + prefix + "search=" + sStr + "&sSelect=" + sSelect; 
}
var num = 5;
var f = false;
var b = new Array;

function prel(path){
  if(document.images) {
    for(i=1;i<=num;i++){
      str = path + 'buttons/b' + i + '_o.jpg';
      b[i-1] = new Image();
      b[i-1].src = str;
      }
    f = true;
  }
}

function on(path, im){
  if (document.images && (f == true)) {document.images[im].src= path + "buttons/"+im+"_o.jpg";}
}

function off(path, im){
  if (document.images && (f == true)) {document.images[im].src = path + "buttons/"+im+".jpg";}
}

var wndCollage = null;
function popupCollage(src, w, h){
	if(wndCollage && !wndCollage.closed){
		wndCollage.close();
	}
	wndCollage = window.open(src, '', 'width=' + w + ',height=' + h + ',location=0');
}