// popup för tycktillformulär
function tyckTillPopup(strArtikelTitel, d_id, a_id){
	if(d_id == null){
		d_id = "";
	}
	if(a_id == null){
		a_id = "";
	}	
	window.open("/customer/jsp/se/user_comments/form.jsp?t=" + strArtikelTitel + "&d=" + d_id+ "&a=" + a_id,"form0","toolbar=0,menubar=0,location=0,directories=0,status=0,resizable=1,scrollbars=0,HEIGHT=350,WIDTH=480");
}


// popup för träningsprogram 
function tp_cpopup(strlabel, surveycode){
	window.open("entersurveyadvice.jsp?label=" + strlabel + "&surveycode=" + surveycode,"form1","toolbar=0,menubar=0,location=0,directories=0,status=0,resizable=1,scrollbars=1,HEIGHT=540,WIDTH=612");
}

// popup för att öppna en Polopoly sida 
//function polopoly_popup(depid,artid,wid,hig){
//	window.open("/Crosslink.jsp?d="+depid+"&a="+artid,'','toolbar=0,menubar=0,location=0,directories=0,status=0,resizable=1,scrollbars=1,width='+wid+',height='+hig);
//}

// popup för att öppna en Polopoly sida
function polopoly_popup(depid,artid,wid,hig){
	window.open("/admin/dispatch.jsp?d="+depid+"&a="+artid,'','toolbar=0,menubar=0,location=0,directories=0,status=0,resizable=1,scrollbars=1,width='+wid+',height='+hig);
}

// popup för viewquestionsresult
function general_popup(myurl,wid,hig){
	window.open(myurl,'','toolbar=0,menubar=0,location=0,directories=0,status=0,resizable=1,scrollbars=1,width='+wid+',height='+hig);
}

// popup för ordlista
function ordlista_popup(){
	window.open("/customer/jsp/se/kostmotion/ordlista.jsp","ordlista","toolbar=0,menubar=0,location=0,directories=0,status=0,resizable=1,scrollbars=1,HEIGHT=540,WIDTH=611");
}

// popup för tips
function tips_popup(strArtikelTitel, d_id, a_id){
	window.open("/customer/jsp/se/spread_the_word/form.jsp?t=" + strArtikelTitel + "&d=" + d_id+ "&a=" + a_id,"form2","toolbar=0,menubar=0,location=0,directories=0,status=0,resizable=1,scrollbars=0,HEIGHT=460,WIDTH=400");
}

// flash popup
function openflash(page,wid,hig){
	window.open(page,'','toolbar=no,menubar=no,location=no,directories=no,scrollbars=no,status=no,resizeable=no,width='+wid+',height='+hig+',top=100,left=100')
}

// Global printfunktion
function printThis() { 
	parent.content.focus(); 
	var NN = (navigator.appName.substring(0,8) == "Netscape");
	var MOZ = (navigator.appName.substring(0,8) == "Netscape");
	var IE = (navigator.appName.substring(0,9) == "Microsoft"); 
	if(NN) VERSION = ((navigator.appVersion.indexOf("4.") != -1)); 
	if(MOZ) VERSION = ((navigator.appVersion.indexOf("6.") != -1)); 
	if(IE) VERSION = ((navigator.appVersion.indexOf("5.") != -1)); 
	//alert("NN:" + NN + "IE:" + IE + "MOZ:" + MOZ);
	//alert("VERSION:" + VERSION);
	if(((NN || IE) && VERSION) || (MOZ == true)){ // IE5, NN4 & NN6 
		parent.content.focus(); 
	    ID=window.setTimeout("top.content.print();",100); 
		//ID=window.setTimeout("top.content.print();",1500); 
	} 
	else if(IE && !VERSION){ // IE4
    	var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
	    parent.content.document.body.insertAdjacentHTML('BeforeEnd', WebBrowser); 
	    parent.content.focus(); 
	    ID=window.setTimeout('parent.content.WebBrowser1.ExecWB(6, 2);',100); 
	} 
	else{
		alert("Tryck ctrl+p för att skriva ut"); 
	} 
} 

// printfunktion för popup
function printThisPopup(){
	if (window.print) { // NS4, IE5, NN6
		window.print();
	} 
	else { // IE4
    	var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
	    window.document.body.insertAdjacentHTML('BeforeEnd', WebBrowser); 
	    window.focus(); 
	    ID=window.setTimeout('window.WebBrowser1.ExecWB(6, 2);',100);
	}
}
