if(navigator.appName == 'Netscape') {
	var netscape = true
} else {
	var netscape = false
}

function imgClick(linkType, href, target, section, menuTop, menuSub) {
	if(linkType == 1) {
		if(target == 'popup') {
			window.open(href, '', 'resizable=1,height=200,width=200');
		} else {
			navigate(section, menuTop, menuSub);
		}
	} else if(linkType == 2) {
		window.open(href);
	} else if(linkType == 3) {
		if(target == '_blank') {
			window.open(href);
		} else if(target == '_self' || target == '') {
			window.location.href = href;
		} else if(target == 'popup') {
			window.open(href, '', 'resizable=1,height=200,width=200');
		}
	}
}

function imgMouseOver() {
	document.body.style.cursor = 'pointer'; 
}

function imgMouseOut() {
	document.body.style.cursor = 'default'; 
}

function navigate(selectedSection, selectedTop, selectedSub) {
	/*if(netscape) {
		parent.document.getElementById('mainFrame').style.height=0;
		parent.document.getElementById('mainFrameLoading').style.display = 'block';
		parent.document.getElementById('menuFrame').style.height=0;
		parent.document.getElementById('menuFrameLoading').style.display = 'block';	
	} else {
		parent.document.all.mainFrame.style.height=0;
		parent.document.all.mainFrameLoading.style.display = 'block';
		parent.document.all.menuFrame.style.height=0;
		parent.document.all.menuFrameLoading.style.display = 'block';					
	}
	top.scroll(0,0);*/
	
	parent.menuFrame.location.href = '/menu.asp?selectedSection=' + selectedSection + '&selectedTop=' + selectedTop + '&selectedSub=' + selectedSub
}

// Function to resize popup window for pictures.
function fitPic() { 
	if(netscape) {
		w = window.innerWidth;
		h = window.innerHeight;
	} else {
		w = document.body.clientWidth;
		h = document.body.clientHeight;
	}

	w = document.images[0].width - w; 
	h = document.images[0].height - h; 
	window.resizeBy(w, h); 
	self.focus(); 
}

function showMap(xCoord, yCoord) {
	window.open('/sections/kartor/pages/Kartor/tatort/show_karta.asp?x=' + xCoord + '&y=' + yCoord, '', 'width=730,height=530,top=100,left=100,resizable=0');
}
