document.write('')

agt=navigator.userAgent.toLowerCase()

ie=(document.all) ? 1:0
ie4=(agt.indexOf('msie 4')!=-1) ? 1:0
ie5=(agt.indexOf('msie 5')!=-1) ? 1:0
ie55=(agt.indexOf("msie 5.5")!=-1) ? 1:0
ie6=(agt.indexOf("msie 6")!=-1) ? 1:0
ie = ie4 || ie5 || ie55 || ie6
ns=(document.layers && parseInt(navigator.appVersion)>=4) ? 1:0
best=(document.getElementById) ? 1:0
opera=(agt.indexOf("opera")!=-1) ? 1:0
gecko=(agt.indexOf("gecko")!=-1) ? 1:0

win=( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) )
mac=(agt.indexOf("mac")!=-1);
imgs=(document.images) ? 1:0

//check form
function check_form(obj){
    for (i=0;i<obj.length;i++){
        if (obj[i].value == ''){alert('Все поля обязательны для заполнения!');return false}
    }
}

function auth_redirect(obj){
    eval('location.href = "http://'+obj[0].value+':'+obj[1].value+'@bs.ivox.ru:8080/main/"')
}

//menu
function preload(){
    icons_menu = new Array()
    for (i=1;i<6;i++){
        icons_menu[i] = new Image()
        icons_menu[i].src = 'images/menu_icons_'+i+'_on.gif'
    }
}

function img_change(id,where){
    eval(where+'_tmp = new Image()')
    eval(where+'_tmp.src = '+where+'_menu['+id+'].src')
    eval(where+'_menu['+id+'].src = document.images.menu_'+where+'_'+id+'.src')
    eval('document.images.menu_'+where+'_'+id+'.src = '+where+'_tmp.src')
}

function brw_size(what) {
if (ns || gecko) {
    width = innerWidth
    height = innerHeight
} else {
    width = document.body.clientWidth
    height = document.body.clientHeight
}
if (what == "w") return width
if (what == "h") return height
}

function show_news(thelayer_hide,thelayer_show){
    if(ie){ eval(thelayer_hide+'.style.display="none"')
            eval(thelayer_show+'.style.display="block"')}
	if(gecko || best){  eval('document.getElementById("'+thelayer_hide+'").style.display="none"')
                        eval('document.getElementById("'+thelayer_show+'").style.display="block"')}
    if(ns){ eval('document.'+thelayer_hide+'.display="none"')
            eval('document.'+thelayer_show+'.display="block"')}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}