function findBrowser() {
	var browser; 
	if (navigator.appName == 'Netscape' && document.layers != null) {
		browser = "ns";
	} else if (document.all != null) {
		browser = "ie"
	} else if (navigator.appName == 'Netscape' && document.layers == null && navigator.appVersion.substring(0,1) > 4) {
		browser = "ns6";
	} 
	return browser;
}

function getRef(id) {
	if (findBrowser() == "ns") {
		return document.layers[id];
	} else if (findBrowser() == "ie") {
		return document.all[id];
	} else if (findBrowser() == "ns6") {
		return document.getElementById(id);
	}
}

function changeColor(id,color) {
	if (findBrowser() == "ns") {
		getRef(id).bgcolor = color;
	}
	else if (findBrowser() == "ie" || findBrowser() == "ns6") {
		getRef(id).style.backgroundColor = color;
	}	
}

function changeClass(id,newClass) {
	getRef(id).className = newClass;
}

function changeImage(id,imageUrl) {
	document.images[id].src = imageUrl;
}

function changeLocation(mn1,mn2,mn3,sid,aid,pid,pmn1) {
	if (pid == "" || pid == null) {
		pid = "0";
	}
	if (pmn1 == "" || pmn1 == null) {
		pmn1 = "0";
	}
	if (aid != "" && aid != null) {
		document.location.href = "default.asp?mn1="+mn1+"&mn2="+mn2+"&mn3="+mn3+"&sid="+sid+"&pid="+pid+"&pmn1="+pmn1+"#"+aid;
	} else {
		document.location.href = "default.asp?mn1="+mn1+"&mn2="+mn2+"&mn3="+mn3+"&sid="+sid+"&pid="+pid+"&pmn1="+pmn1;
	}
}

function changeURL(URL) {
	document.location.href = URL;
}

function changeTopURL(URL) {
	parent.location.href = URL;
}

function openWindow(URL) {
	window.open(URL);
}

function showhide(layer_ref) { 
	var state = "";
	
	if (document.all) { //IS IE 4 or 5 (or 6 beta) 
		state = getRef(layer_ref).style.display;
	} 
	
	if (document.layers) { //IS NETSCAPE 4 or below 
		state = document.layers[layer_ref].display; 
	} 
	
	if (document.getElementById &&!document.all) { 
		hza = document.getElementById(layer_ref); 
		state = hza.style.display; 
	}
	
	if (state == 'block') { 
		state = 'none'; 
	} else { 
		state = 'block'; 
	} 
	
	if (document.all) { //IS IE 4 or 5 (or 6 beta) 
		eval( "document.all." + layer_ref + ".style.display = state");
	} 
	
	if (document.layers) { //IS NETSCAPE 4 or below 
		document.layers[layer_ref].display = state; 
	} 
	
	if (document.getElementById &&!document.all) { 
		hza = document.getElementById(layer_ref); 
		hza.style.display = state; 
	} 
}

function rotateImage(intIndex) {
	if(!arr_Images.length) return
	var int_Index;
	if (intIndex == -1) {
		intCurrent++;
		int_Index = intCurrent;
		if (int_Index >= arr_Images.length) {
			int_Index = 0;
			intCurrent = 0;
		}
	} else {
		int_Index = intIndex;
	}
	if (findBrowser() == "ie") {
		document.getElementById(strIDName).filters[0].apply();
	}
	document.images[strIDName].src = arr_Images[int_Index].src;
	if (findBrowser() == "ie") {
		document.getElementById(strIDName).filters[0].play();
	}
}

function ViewSpecific(intIndex) {
	clearInterval(itvChange);
	setTimeout('rotateImage(' + intIndex + ');', 50);
	intCurrent = intIndex;
}

function StartStandardInterval() {
	itvChange = setInterval('rotateImage(-1)', 5000);
}

function Preload(arr_Image) {	
	if(!arr_Image.length) return
	for(i=0; i< arr_Image.length; i++) {
		var obj_Image = new Image();
		obj_Image.src = arr_Image[i];
		arr_Image[i] = obj_Image;
	}
}

function viewImage(imageURL,billedeheight,billedewidth) {
	var myNewWindow = window.open('popup_image.asp?imgurl='+imageURL,'viewimage','height='+billedeheight+', width='+billedewidth+', resizable=yes, scrollbars=no');
	myNewWindow.resizeTo(billedewidth,billedeheight)
	myNewWindow.moveTo((window.screen.availWidth -  billedewidth) / 2, (window.screen.availHeight - billedeheight) / 2);
	myNewWindow.focus();
}

/*
<span style='cursor:pointer;' onmouseup="openImage('');"></span>
*/




















