/*
function PopHelp(help_id){   
  var s1 ="http://www.latentlight.com/help.asp?help_id="  + help_id
  var s2= "toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes,width=350,height=250"
  popup = window.open(s1,"help",s2)
  }
function Help(){   
  var s1 ="http://www.latentlight.com/help.asp" 
  var s2= "toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes,width=350,height=250"
  popup = window.open(s1,"help",s2)
  }
*/

function txtBox(obj, str, action) {
	if(action == 'on') {
		if(obj.value==str)
			obj.value = '';
	} else {
		if(obj.value=='')
			obj.value=str
	}	
}

var type = "IE";	//Variable used to hold the browser name

BrowserSniffer();

function BrowserSniffer() {
	if (navigator.userAgent.indexOf("Opera")!=-1 && document.getElementById) type="OP";		//Opera
	else if (document.all) type="IE";														//Internet Explorer e.g. IE4 upwards
	else if (document.layers) type="NN";													//Netscape Communicator 4
	else if (!document.all && document.getElementById) type="MO";							//Mozila e.g. Netscape 6 upwards
	else type = "IE";		//I assume it will not get here
}

function setText(id, str) {
	if (type=="IE") {
		document.all[id].innerHTML = str;
	}
	if (type=="NN") { 
		document.layers[id].document.open();
		document.layers[id].document.write(str);
		document.layers[id].document.close();
	}
	if (type=="MO" || type=="OP") {
		document.getElementById(id).innerHTML = str;
	}
}

function hidedivs() {
	if (type=="IE") {
		document.all.details.style.display   ='none';
		document.all.venue.style.display     ='none';
		document.all.itinerary.style.display ='none';
		document.all.tutors.style.display    ='none';
		document.all.gallery.style.display   ='none';
	}
	if (type=="NN") {
		document.details.display   ='none';
		document.venue.display     ='none';
		document.itinerary.display ='none';
		document.tutors.display    ='none';
		document.gallery.display   ='none';
	}
	if (type=="MO" || type=="OP") {
		document.getElementById('details').style.display   ='none';
		document.getElementById('venue').style.display     ='none';
		document.getElementById('itinerary').style.display ='none';
		document.getElementById('tutors').style.display    ='none';
		document.getElementById('gallery').style.display   ='none';
	}
	hidelocaldivs();
}

function showdiv(id, action, itstr){
	if (itstr=='') {
		hidedivs();
		if (type=="IE") 
			document.all[id].style.display=action;
		if (type=="NN") 
			eval("document." + id + ".display='" + action + "'");
		if (type=="MO" || type=="OP") 
			document.getElementById(id).style.display=action
	}
	else {
		var strArr = itstr.split(',');
		//alert(itstr);
		for(var i=0;i<strArr.length;i++) {
			if (type=="IE") 
				document.all[strArr[i]].style.display='none';
			if (type=="NN") 
				eval("document." + strArr[i] + ".display='none'");
			if (type=="MO" || type=="OP") 
				document.getElementById(strArr[i]).style.display='none';
		}
		if (type=="IE") 
			document.all[id].style.display=action;
		if (type=="NN") 
			eval("document." + id + ".display='" + action + "'");
		if (type=="MO" || type=="OP") 
			document.getElementById(id).style.display=action
	}
}
function setwidth() {
	if (type=="IE") {
		if(document.getElementById('headerp') !== null) {
			var bodwidth = document.all.headerp.offsetWidth;
			newwidth = bodwidth - 252 - 6
			newwidth += 'px';
			document.all.rightprodcol.style.width=newwidth;
		}
	}
	if (type=="NN") {
		//nothing for netscape
	}
	if (type=="MO" || type=="OP") {
		if(document.getElementById('headerp') !== null) {
			var bodwidth = document.getElementById('headerp').offsetWidth;
			newwidth = bodwidth - 252 - 4
			newwidth += 'px';
			document.getElementById('rightprodcol').style.width=newwidth;
		}
	}
}
function setcol() {
	if (type=="IE") {
		var bodwidth = document.all.bod.offsetWidth;
		newwidth = bodwidth - 250 
		newwidth += 'px';
		document.all.rightcolumn.style.width=newwidth;
	}
	if (type=="NN") {
		//nothing for netscape
	}
	if (type=="MO" || type=="OP") {
		var bodwidth = document.getElementById('bod').offsetWidth;
		newwidth = bodwidth - 210 
		newwidth += 'px';
		document.getElementById('rightcolumn').style.width=newwidth;
	}
}
function note(obj) {
	var ind = obj.options.selectedIndex;
	if(obj.options[ind].value == '')
		obj.options[ind-1].selected = true;
}

var clickmessage="This image is copyright WildArena.com."

function disableclick(e) {
	if (document.all) {
		if (event.button==2||event.button==3) {
			if (event.srcElement.tagName=="IMG"){
			alert(clickmessage);
			return false;
			}
		}
	} else if (document.layers) {
		if (e.which == 3) {
			alert(clickmessage);
			return false;
		}
	} else if (document.getElementById){
		if (e.which==3&&e.target.tagName=="IMG"){
			alert(clickmessage)
			return false
		}
	}
}

function associateimages(){
	for(i=0;i<document.images.length;i++)
		document.images[i].onmousedown=disableclick;
}

if (document.all)
	document.onmousedown=disableclick
else if (document.getElementById)
	document.onmouseup=disableclick
else if (document.layers)
	associateimages()
else {
    document.onmousedown=disableclick
}

