this.ver    = navigator.appVersion
this.agent  = navigator.userAgent
this.dom    = document.getElementById?1:0
this.opera5 = this.agent.indexOf("Opera 5")>-1
this.IE5    = (this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;
this.IE6    = (this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
this.IE4    = (document.all && !this.dom && !this.opera5)?1:0;
this.IE     = this.IE4||this.IE5||this.IE6
this.isMac    = this.agent.indexOf("Mac")>-1
this.NS6    = (this.dom && parseInt(this.ver) >= 5) ?1:0;
this.NS4    = (document.layers && !this.dom)?1:0;
this.bw     = (this.IE6 || this.IE5 || this.IE4 || this.NS4 || this.NS6 || this.opera5)
// Workaround fuer IE 5 unter Mac
if (isMac && IE6) {
	dom = false;
	IE4 = true;
}

if (NS6) {
	document.write('<link rel="STYLESHEET" type="text/css" href="/css/styles_nn_rel.css">');
} else {
	document.write('<link rel="STYLESHEET" type="text/css" href="/css/styles_rel.css">');
}


/*******************************************/
/* übernommen aus dem bestehenden Auftritt */
/*******************************************/


function openRef(url, anker){
	newUrl = url.substring((url.lastIndexOf("/")+1), url.length);
	newUrl = newUrl.replace(/.jsp/,"_popup.html");
	newUrl = newUrl.replace(/#/,"");
	newUrl = newUrl + '#' + anker;
	openRefPopUp = window.open(newUrl, "references", "width=400,height=300,scrollbars=1");
	openRefPopUp.focus();
}

function openRefLoc(url, anker){
//	newUrl = url.substring((url.lastIndexOf("/")+1), url.length);
//	newUrl = newUrl.replace(/.jsp/,"_popup.html");
//	newUrl = newUrl.replace(/#/,"");
	newUrl = "../ref_popup.html#" + anker;
	openRefPopUp = window.open(newUrl, "references", "width=400,height=300,scrollbars=1");
	openRefPopUp.focus();
}

function popPrinter(url) {
	var loc = url.substring((url.lastIndexOf("/")+1),(url.length));
	var loc = loc.replace(/#/,"");
	var loc = loc + "?printable=yes";
	var printer=window.open(loc,"printer","width=641,height=485,menubar=yes,status=no,scrollbars=yes,scrollable=yes,toolbar=yes,resizable=yes,location=no");
	printer.focus();
	printer.print();
}

function open_calc(){
	var rechner=window.open("das_calculator/calculator.html","rechner","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=500,height=450");
	rechner.focus();
}

function open_lit_service(){
	var rechner=window.open("/germany/pro/lit_frame.html","lit_service","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=640,height=480");
	rechner.focus();
}

function open_info(){
	var info=window.open("das_cal_info.html","info","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=520,height=600");
	info.focus();
}
	
function openQuestPopUp(URL){
		quest=window.open("/en/choose.jsp?redir=" + URL, "quest","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=350,height=330");
		quest.focus();
}	

function openDisclaimerPopUp(URL){
		Disclaimer=window.open(URL, "Disclaimer","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=350,height=330");
		Disclaimer.focus();
}

function gotoChannel(channel,lang){
	if (channel == "patient"){
		opener.location.href = "/" + lang + "/pat/index.jsp";
	} else if (channel == "physician"){
		opener.location.href = "/" + lang + "/pro/index.jsp";
	}
	self.close();
}

function openGlossary(anker){
	url = "/en/glossary.jsp#" + anker;
	glossary=window.open(url, "glossary", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=600,height=450")
	glossary.focus();
}
function openGlossaryES(anker){
	url = "/spain/pro/glossary.jsp#" + anker;
	glossary=window.open(url, "glossary", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=600,height=450")
	glossary.focus();
}
function openPatGlossary(anker){
	url = "/en/pat/glossary.jsp#" + anker;
	patglossary=window.open(url, "patglossary", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=600,height=450")
	patglossary.focus();
}
function openPatGlossaryES(){
	url = "/spain/pat/glossary.jsp"
	patglossary=window.open(url, "patglossary", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=600,height=450")
	patglossary.focus();
}
function openPopUp(url){
	formpopup=window.open(url, "formpopup", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=600,height=450")
	formpopup.focus();
}
function openPopUpRequest(url){
	formpopup=window.open(url, "formpopup", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=400,height=600")
	formpopup.focus();
}

function privacyPolicy(url){
	formpopup=window.open(url, "privacypolicy", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=600,height=450")
	formpopup.focus();
}

/* ==================================================================================================*/
/* call script :  openAVPopUp( 'path_to_file', height_of_movie , width_of_movie [,xpos, ypos] ) =====*/
/* if position of pup-up is not declared (xpos, ypos), window will appear centered ==================*/	
/* ==================================================================================================*/	

function openAVPopUp( AVloc, AVheight, AVwidth, xpos, ypos){
	
	var WINloc = "/download_popup.jsp?AVloc=" + AVloc + "&AVheight=" + AVheight + "&AVwidth=" + AVwidth;
	var WINwidth = eval(AVwidth+0); // feel free to add some Background around embedded file
	var WINheight = eval(AVheight+50); // added 50px for Pop-Up Header/Logo
	
	if( !xpos ){xpos = (screen.availWidth-(AVwidth+10))/2;}
	if( !ypos ){ypos = (screen.availHeight-(AVheight+30))/2;}
	
	AVpopup=window.open( WINloc , "AVpopup", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=" + WINwidth + ",height=" + WINheight + ",screenX=" + xpos + ",screenY=" + ypos + ",left=" + xpos + ",top=" + ypos + '"');
	AVpopup.focus();
}

function openPopUpWindow(url,popupheight,popupwidth,scroll){
	specs="height="+popupheight+",width="+popupwidth+"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars="+scroll+",resizable=0";
	popup=window.open(url,"popupwindow",specs);
}


/****************************************************/
/*** Suchfunktionen *********************************/
/****************************************************/



var defaultEmptyOK = false;
// whitespace characters
var whitespace = " \t\n\r";

function checkString (theField, emptyOK) {
        // Next line is needed on NN3 to avoid "undefined is not a number" error
    // in equality comparison below.
    if (checkString.arguments.length == 1) emptyOK = defaultEmptyOK;
    if ((emptyOK == true) && (isEmpty(theField.value))) return true;
    if (isWhitespace(theField.value)) {
                return false;
    } else return true;
}

function isEmpty(s)
{
    return ((s == null) || (s.length == 0))
}

function isWhitespace (s) {
        var i;

    // Is s empty?
    if (isEmpty(s)) return true;

    // Search through string's characters one by one
    // until we find a non-whitespace character.
    // When we do, return false; if we don't, return true.

    for (i = 0; i < s.length; i++)
    {
        // Check that current character isn't whitespace.
        var c = s.charAt(i);

        if (whitespace.indexOf(c) == -1) return false;
    }

    // All characters are whitespace.
    return true;
}

function submitSearch()
{
    if(document.searchBox.searchScope[0].checked){
        if(validSearchForm()) {
            document.searchBox.method = 'POST';
            document.searchBox.target = '_self';
            if(document.searchBox.language.value == 'en'){
				document.searchBox.action = '/en/pro/search/searchresult.jsp';
			}else if(document.searchBox.language.value == 'de'){
				document.searchBox.action = '/germany/pro/search/searchresult.jsp';
			}else if(document.searchBox.language.value == 'nl'){
				document.searchBox.action = '/netherlands/pro/search/searchresult.jsp';
			}else if(document.searchBox.language.value == 'fr'){
				document.searchBox.action = '/france/pro/search/searchresult.jsp';
			}else if(document.searchBox.language.value == 'it'){
				document.searchBox.action = '/italy/pro/search/searchresult.jsp';
			}else if(document.searchBox.language.value == 'es'){
				document.searchBox.action = '/spain/pro/search/searchresult.jsp';
			}else if(document.searchBox.language.value == 'dk'){
				document.searchBox.action = '/denmark/pro/search/searchresult.jsp';
			}else if(document.searchBox.language.value == 'fi'){
				document.searchBox.action = '/finland/pro/search/searchresult.jsp';
			}else if(document.searchBox.language.value == 'se'){
				document.searchBox.action = '/sweden/pro/search/searchresult.jsp';
			}else if(document.searchBox.language.value == 'no'){
				document.searchBox.action = '/norway/pro/search/searchresult.jsp';
			}else {
				document.searchBox.action = '/en/pro/search/searchresult.jsp';
			}
			
            document.searchBox.submit();
        }
   }else{
                //submit to Google scholar
                document.searchBox.action = 'http://www.google.com/scholar';
                document.searchBox.method = 'GET';
                document.searchBox.target = '_blank';
                document.searchBox.submit();
   }
}

function validSearchForm()
{
    var searchArg;

    searchArg = document.searchBox.q;
    if(!checkString(searchArg)){
        alert("Please input search argument");
        searchArg.select();
        return false;
    }
    searchArg.value = searchArg.value.toLowerCase();
    return true;
}
//-->

