var agt=navigator.userAgent.toLowerCase();
var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
               && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
               && (agt.indexOf('webtv')==-1));
var is_major = parseInt(navigator.appVersion);
var is_opera = (agt.indexOf("opera") != -1);
var not_nav6 = (is_nav && (is_major < 5));
var isNN=(navigator.appName=="Netscape");

var is_opera7 = (is_opera && agt.indexOf("7.")!=-1);
var is_opera6 = (is_opera && !is_opera7);


var my_height;
function detect_height(){
	if(isNN){
		if(not_nav6){
			my_height=window.innerHeight+5;
		}else{
			my_height=window.innerHeight;
		}
	}else if(is_opera){
		my_height=window.innerHeight;
	}else{
		my_height=document.body.clientHeight;
	}
}
//detect_height()

//window.onresize = resizer
//window.onerror = handle_error
var msg_array = new Array()
var url_array = new Array()
var lno_array = new Array()

function handle_error(msg,url,lno){
   msg_array[msg_array.length] = msg
   url_array[url_array.length] = url
   lno_array[lno_array.length] = lno
   pom = "*** Mssg No. : "+msg_array.length
   pom+= (lno_array.length>0) ? " (ln:"+lno_array[0]+")" : ""
   window.status = pom
   return true
}

function starer(){
	detect_height()
	sredi_sadrzaj()
}
function resizer(){
	detect_height()
//	setTimeout("sredi_sadrzaj()",100)
	sredi_sadrzaj()
}
function sredi_sadrzaj(){
//	alert(document.getElementById("login").offsetHeight)
	if(document.getElementById){

		b_height = document.getElementById("partBCLevelX0").offsetHeight
		document.getElementById("news").height = my_height - b_height - document.getElementById("search").offsetHeight

	}else{
//		alert("NN 4")
	}
}

function printOrder(_url) {
	printWindow = window.open(_url,
							  "printWindow","toolbar=0, location=0, status=1, resizable=1, menubar=1, "+
							  "scrollbars=1, width=750, height=540");
	printWindow.focus();
}

function mailpage(_str)
{
   mail_str = "";
   if(!_str){
      mail_str += location.href;
   }else{
      chek = _str.substr(0,_str.indexOf('_title_')) + "'" + document.title + "'"
      bodi = _str.substr(_str.indexOf('_title_')+7,_str.length)
      bodi = bodi.substr(0,bodi.indexOf('_title_')) + bodi.substr(bodi.indexOf('_title_')+7,bodi.length)
      bodi = bodi.substr(0,bodi.indexOf('_url_')) + location.href + bodi.substr(bodi.indexOf('_url_')+5,bodi.length)
      
      mail_str = "mailto:?subject=" + chek;
      mail_str += "&body=" + bodi;
   }
location.href = mail_str;
}
