/* * * * * * * * * * * * * * *
* konstfack global js libary
* pascal@pascal.nu / 2004-04-29
* * * * * * * * * * * * * * * */

var myPopupWin;
/* * * * * * * * * * * *
* openWindow('/konstfack/bild.gif', 'bigImage', 'width=300,height=400,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0')
* leave "name" blank to open new window 
*/
function openWindow(url, name, windowFeatures) {
	if (windowFeatures == null || windowFeatures == ""){
		windowFeatures = "toolbar=1,location=1,directories=1,status=1,menuBar=1,scrollBars=1,resizable=1";
	}
	myPopupWin = window.open(url, name, windowFeatures);
	myPopupWin.focus(); // Retake focus if window is already open	
}

// refresh menu and article
function openPolopolyUrl(menuUrl, artUrl) {
	if (menuUrl != null && menuUrl != '') {
		top.frames['menu'].location.href = menuUrl;
	}
       	if (artUrl != null && artUrl != '' ) {
		top.frames['main'].location.href = artUrl;
    	} else {
		top.frames['main'].location.href = "/konstfack/html/empty.html";
	}
}



function gotoW(Url) {
	top.location.href = Url;
}

function showAltText(str){
	var txt = document.createTextNode(str);
	var elem = document.getElementById('alttext');
	var elemChild = elem.firstChild;
	//if child is null, append
	if (elem.firstChild != null){
		elem.replaceChild(txt, elemChild);
	} else {
		elem.appendChild(txt);
	}
}

