//Funksjon for å opne vindauge for å legge til bokmerke / lage PDF fil
function openBookmarkWindow(theURL){
	var height,width,scrollbars,resizable,left,top;
	height = 250; //460;
	width = 440; //750;
	scrollbars = 0;
	resizable = 1;		
	left = 500;
	top = 500;		
	var myMMWindow = open(theURL,'myMMWindow','screenX=0,screenY=0,top=' + top + ',left=' + left + ',status=0,scrollbars=' + scrollbars + ',height=' + height + ',width=' + width + ',resizable=' + resizable);		
	myMMWindow.focus();
	myMMWindow.resizeTo(width,height);
}
//Funksjon for å åpne PDF fil
function openPDFWindow(theURL){
    var height,width,scrollbars,resizable;
	height = 100; //512; //477; // 438 // 420; //383;
	width = 100; //630;
	scrollbars = 0;
	resizable = 1;		

	var pdfWindow = open(theURL,'pdfWindow','screenX=0,screenY=0,top=0,left=0,status=0,scrollbars=' + scrollbars + ',height=' + height + ',width=' + width + ',resizable=' + resizable);		
	//pdfWindow.focus();
	//pdfWindow.resizeTo(width,height);
}

//Funksjon for å åpne VIS multimedia fil med referanser
function openShowMMWindow(theURL){
	var height,width,scrollbars,resizable,left,top;
	height = 765;
	width = 620;
	scrollbars = 0;
	resizable = 1;		
	left = 430;
	top = 0;		
	var myMMWindow = open(theURL,'mailWindow','screenX=0,screenY=0,top=' + top + ',left=' + left + ',status=0,scrollbars=' + scrollbars + ',height=' + height + ',width=' + width + ',resizable=' + resizable);		
	mailWindow.focus();
	mailWindow.resizeTo(width,height);
}
//Funksjon for å opne link vindauge ved skriving av artiklar
function openURLWindow(theURL){
	var height,width,scrollbars,resizable,left,top;
	height = 180;
	width = 400;
	scrollbars = 0;
	resizable = 0;		
	left = 520;
	top = 240;		
	screenX = 520;
	screenY = 240;
	var url_window = open(theURL,'url_window','screenX=' + screenX + ',screenY=' + screenY + ',top=' + top + ',left=' + left + ',status=0,scrollbars=' + scrollbars + ',height=' + height + ',width=' + width + ',resizable=' + resizable);		
	url_window.focus();
	url_window.resizeTo(width,height);
}
//Funksjon for å opne link vindauge ved skriving av artiklar
function openPreviewWindow(theURL){
	var height,width,scrollbars,resizable,left,top;
	height = 100;
	width = 700;
	scrollbars = 1;
	resizable = 1;		
	left = 520;
	top = 240;		
	screenX = 520;
	screenY = 240;
	var url_window = open(theURL,'url_window','screenX=0,screenY=0,top=' + top + ',left=' + left + ',status=0,scrollbars=' + scrollbars + ',height=' + height + ',width=' + width + ',resizable=' + resizable);		
	url_window.focus();
	url_window.resizeTo(width,height);
}
//Funksjon for å opne vindauge for forhåndsvisning av artikkel
function openPreviewWindow(theURL){
	var height,width,scrollbars,resizable,left,top;
	height = 700;
	width = 695;  //670;
	scrollbars = 1;
	resizable = 0;		
	left = 0;
	top = 0;		
	var myMMWindow = open(theURL,'myMMWindow','screenX=0,screenY=0,top=' + top + ',left=' + left + ',status=0,scrollbars=' + scrollbars + ',height=' + height + ',width=' + width + ',resizable=' + resizable);		
	myMMWindow.focus();
	myMMWindow.resizeTo(width,height);
}

//Funksjon for å opne vindauge for registrering av MM 
function openMMWindow(theURL){
	var height,width,scrollbars,resizable;
	height = 512; //477; // 438 // 420; //383;
	width = 630;
	scrollbars = 0;
	resizable = 1;		

	var myMMWindow = open(theURL,'myMMWindow','screenX=0,screenY=0,top=0,left=0,status=0,scrollbars=' + scrollbars + ',height=' + height + ',width=' + width + ',resizable=' + resizable);		
	myMMWindow.focus();
	myMMWindow.resizeTo(width,height);
}

//Funksjon for å opne vindauge for registrering av artikkel 
function openARTIKKELWindow(theURL){
	var height,width,scrollbars,resizable;
	height = 595;
	width = 850;
	scrollbars = 0;
	resizable = 0;		

	var myARTIKKELWindow = open(theURL,'myARTIKKELWindow','screenX=0,screenY=0,top=0,left=0,status=0,scrollbars=' + scrollbars + ',height=' + height + ',width=' + width + ',resizable=' + resizable);		
	myARTIKKELWindow.focus();
	myARTIKKELWindow.resizeTo(width,height);
}

//Funksjon for å opne databasevindauge
function openDBWindow(db,theURL){
	var height,width,scrollbars,resizable;
	
	if (db == 'dbarticle'){
		height = 580;
		width = 827;
		scrollbars = 0;
		resizable = 0;
	}else if (db == 'dbarticle_multimedia'){
		height = 420;
		width = 600;
		scrollbars = 0;
		resizable = 0;	
	}else if (db == 'dbusers'){
		height = 355;   //285;
		width = 495;    //453;
		scrollbars = 0;
		resizable = 0;	
	}else if (db == 'dbworkgroup'){
		height = 580;
		width = 827;
		scrollbars = 0;
		resizable = 0;	
	}	
	var myDBWin = open(theURL,'myHelperWin','screenX=0,screenY=0,top=0,left=0,status=0,scrollbars=' + scrollbars + ',height=' + height + ',width=' + width + ',resizable=' + resizable);		
	myDBWin.focus();
	myDBWin.resizeTo(width,height);
	
	//window.showModalDialog(theURL,'myHelperWin','dialogHeight: 200px; dialogWidth: 250px; edge: Sunken; center: Yes; help: No; resizable: No; status: No;')
}

function sendToClipboard(theString) {
    if ( window.clipboardData && clipboardData.setData ) {
        clipboardData.setData("Text", theString);
        alert('Lenke til URL-en er plassert på utklippstavla');
        //alert('<%=common.getLangStr("article_template", "sendToClipboardOK")%>');
    } else {
	    alert('Denne funksjonaliteten støttast ikkje av din nettleser. Internet Explorer kreves.');
        //alert('<%=common.getLangStr("article_template", "sendToClipboardError")%>');
    }
}




