
function OpenWindow(URL,Width,Height,WinTitle)
{
	if(WinTitle == null){
		WinTitle="Ord";
	}
	newWin=window.open(URL,WinTitle,'toolbar=0,scrollbars=no,status=no,resize=no,width='+Width+',height='+Height);
	newWin.focus();
}
function OpenWindow_scroll(URL,Width,Height,WinTitle)
{
	if (WinTitle == null){
		WinTitle="Ord";
	}
	newWin=window.open(URL,WinTitle,'toolbar=0,scrollbars=yes,status=no,resize=no,width='+Width+',height='+Height);
	newWin.focus();
}
function OpenWindow_scroll_resizable(URL,Width,Height,WinTitle)
{
	if (WinTitle == null){
		WinTitle="Ord";
	}
	newWin=window.open(URL,WinTitle,'toolbar=0,scrollbars=yes,status=no,resizable=yes,width='+Width+',height='+Height);
	newWin.focus();
}


function showInMainWin(theUrl){
	if (window.opener){
		if(window.opener.closed){
			window.open(theUrl);
		}else{
			window.opener.location.href=theUrl;
		}
	}else{
		window.open(theUrl);	
	}
}

//Det här scriptet öppnar en popup och stänger samtidigt ner befintliga popuper
//start
openWins = new Array();
curWin = 0;
function close_all(){
	for(i=0; i<openWins.length; i++) if (openWins[i] && !openWins[i].closed) openWins[i].close();
}

function url_open(openurl,width,height){
	openWins[curWin++] = photoWindow = window.open(openurl,curWin,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,topmargin=0,left=500,top=150,width='+width+',height='+height);
}
//end
//en variant av ovanstående funktion men nu kan man bestämma var varje fönster ska vara placerade
function url_open(openurl,width,height,left,top){
	openWins[curWin++] = photoWindow = window.open(openurl,curWin,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,topmargin=0,width='+width+',height='+height+',left='+left+',top='+top);
}
 
