function testJavaEnabled()
{
    if (navigator.javaEnabled()){
        return true;
    }else{
        return false;
    }
}

function ChooseCssStylesheet(){
    var testJava = testJavaEnabled()
    var screenSize = "neobisnuit"
    if(testJava == true){
        screenSize = screen.width + "x" + screen.height
        switch(screenSize) {
            case "640x480":
            case "800x600":
            case "1024x768":
            case "1152x864":
                cssales = 1
                break
            case "1280x768":
            case "1280x800":
            case "1280x960":
            case "1280x1024":
            case "1600x1200":
            case "1600x1280":
                cssales = 2
                break
            default:
                cssales = 1
        }
        return cssales
    }else{
        alert("Java Disabled")
    }
}

function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}

function showPopupWindow(url, win_name, dim_w, dim_h, pos_x, pos_y, options)
{
    var optiuni='';
    var wnd;

    // Ex. showPopupWindow('test.html', 'nb', '200', '100', '', '', 'resizable, status, scrollbars=0, location, toolbar');

    if (url && url!='' && url!='undefined') {
        if (win_name=='' || win_name=='undefined') {
            win_name = '_blank';
        }
        if (dim_w) {
            optiuni += 'width='+ dim_w +',';
        }
        if (dim_h) {
            optiuni += 'height='+dim_h+',';
        }
        if (options) {
            optiuni += options;
        }
        wnd = window.open(url, win_name, optiuni);
    } else {
        // if url is empty
        return false;
    }
    if (pos_x || pos_y) {
        if (pos_x=='undefined') {
            pos_x='';
        }
        if (pos_y=='undefined')    {
            pos_y='';
        }
        wnd.moveTo(pos_x, pos_y);
    }
    wnd.focus();
}