function SelectFocusLogin() {
document.login.login.value="";
}
function SelectFocusPass() {
document.login.password.value="";
}
var popWindow;
function moresure(beer)
{
	var winURL = "moresure.php?" + beer;
        //if (! popWindow ) {
		popWindow = window.open(winURL , 'sure', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width=450,height=750')
	//}
	//else {
		popWindow.focus();
	//	popWindow.location = winURL;
	//}
}
function aaus()
{
	var winURL = "aaus.php?";
        //if (! popWindow ) {
		popWindow = window.open(winURL , 'aaus', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width=370,height=750')
	//}
	//else {
		popWindow.focus();
	//	popWindow.location = winURL;
	//}
}
function oms(odd)
{
	var winURL = "oms.php?odd="+odd;
        //if (! popWindow ) {
		popWindow = window.open(winURL , 'oms', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width=350,height=800')
	//}
	//else {
		popWindow.focus();
	//	popWindow.location = winURL;
	//}
}
function SelectAll(mark)
{ 
  for (i = 0; i < document.forms['port'].elements.length; i++)
   {
    var item = document.forms['port'].elements[i];
    if (item.name == "odd[]")
     {
      item.checked = mark;
     };
   }
}
function bbb (hit) {
         return '<b>'+hit+'</b>';
}
function allert (hit) {
         return '<font color="green">'+hit+'</font>';
}
function non_allert (hit) {
         return '<font color="red">'+hit+'</font>';
}
function center (hit) {
         return '<center>'+hit+'</center>';
}
function from_radio(obj) {
         var ret=0;
	for (var i=0; i< obj.length; i++) {
            if(obj[i].checked)  {
                                                ret=obj[i].value;
            }
            
        }
        return ret;
}
function from_checkbox(obj) {

            if(obj.checked)  ret=obj.value;
            else  ret='';
        return ret;
}
function kurs (a) {
	var dec=document.kurs.kurs.value;
	if (dec>0 && a>=0) {
		if (from_radio(document.kurs.turn)=='on') {
			b=a*dec;
		}
		else {
			b=a/dec;
		}
		return '=' + bbb(allert(RoundX(b)));
	}
	else return '=';
}
