//Funksjon for å opne vindauge for brukar oppdatering
function openUsersWindow(theURL){
	var height,width,scrollbars,resizable,left,top,screenX,screenY;
	height = 637; // 355;   //285;
	width = 578; //567;    //453;
	scrollbars = 0;
	resizable = 1;	
	left = 310;
	top = 230;		
	screenX = 400;
	screenY = 200;
	var users_window = open(theURL,'users_window','screenX=' + screenX + ',screenY=' + screenY + ',top=' + top + ',left=' + left + ',status=0,scrollbars=' + scrollbars + ',height=' + height + ',width=' + width + ',resizable=' + resizable);		
	users_window.focus();
	users_window.resizeTo(width,height);
}//Funksjon for å opne vindauge for digitalisering
function openDigitizeWindow(theURL){
	var height,width,scrollbars,resizable,left,top,screenX,screenY;
	height = 500; //460;
	width = 400; //750;
	scrollbars = 0;
	resizable = 1;		
	left = 520;
	top = 240;		
	screenX = 520;
	screenY = 240;
	var digitize_window = open(theURL,'digitize_window','screenX=' + screenX + ',screenY=' + screenY + ',top=' + top + ',left=' + left + ',status=0,scrollbars=' + scrollbars + ',height=' + height + ',width=' + width + ',resizable=' + resizable);		
	digitize_window.focus();
	digitize_window.resizeTo(width,height);
}
//Funksjon for å opne vindauge for registrering av MM frå produkt
function openHTMLEditorWindow(theURL){
	var height,width,scrollbars,resizable,left,top;
	height = 540; //460;
	width = 800; //750;
	scrollbars = 1;
	resizable = 1;		
	left = 250;
	top = 28;		
	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 VIS multimedia fil med referanser
function openStrippedMap(theURL){
	var height,width,scrollbars,resizable,left,top;
	height = 500;
	width = 400;
	scrollbars = 0;
	resizable = 1;		
	left = 520;
	top = 0;		
	var strippemap = open(theURL,'strippemap','screenX=0,screenY=0,top=' + top + ',left=' + left + ',status=0,scrollbars=' + scrollbars + ',height=' + height + ',width=' + width + ',resizable=' + resizable);		
	strippemap.focus();
	strippemap.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 å åpne COMMENT - kommenart til artikkel
function openCommentWindow(theURL){
	var height,width,scrollbars,resizable,left,top;
	height = 344;
	width = 706;
	scrollbars = 0;
	resizable = 1;		
	left = 390;
	top = 0;		
	var myMMWindow = open(theURL,'commentWindow','screenX=0,screenY=0,top=' + top + ',left=' + left + ',status=0,scrollbars=' + scrollbars + ',height=' + height + ',width=' + width + ',resizable=' + resizable);		
	commentWindow.focus();
	commentWindow.resizeTo(width,height);
}
//Funksjon for å åpne MAILAFRIEND - tips ein ven
function openMailAFriendWindow(theURL){
	var height,width,scrollbars,resizable,left,top;
	height = 344;
	width = 706;
	scrollbars = 0;
	resizable = 1;		
	left = 390;
	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 å hente artikler. Link til ein anna artikkel
function openGetItemWindow(theURL){
	var height,width,scrollbars,resizable,left,top;
	height = 600;
	width = 400;
	scrollbars = 1;
	resizable = 1;		
	left = 400;
	top = 28;		
	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 openURLWindow(theURL){
	var height,width,scrollbars,resizable,left,top;
	height = 180;
	width = 400;
	scrollbars = 0;
	resizable = 1;		
	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 = 730;  //695;  //670;
	scrollbars = 1;
	resizable = 1;		
	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 konvertering av koordinater
function openConvertCoordWindow(theURL){
	var height,width,scrollbars,resizable,left,top;
	height = 360;
	width = 435;
	scrollbars = 0;
	resizable = 1;		
	left = 300;
	top = 28;		
	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 = 785;  //477; // 438 // 420; //383;
	width = 865;  // 558;
	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 = 1;		

	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 = 720; //580;
		width = 827;
		scrollbars = 0;
	    resizable = 1;		
	}else if (db == 'dbarticle_multimedia'){
		height = 420;
		width = 600;
		scrollbars = 0;
		resizable = 1;	
	}else if (db == 'dbusers'){
		height = 355;   //285;
		width = 567;    //453;
		scrollbars = 0;
		resizable = 1;	
	}else if (db == 'dbworkgroup'){
		height = 580;
		width = 827;
		scrollbars = 0;
		resizable = 1;	
	}	
	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")%>');
    }
}



