
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 printer=window.open(url,"printer","width=641,height=485,menubar=yes,status=no,scrollbars=yes,scrollable=yes,toolbar=yes,resizable=yes,location=no");
	printer.focus();
}

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/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 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/global/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);
}