var message="RIGHT MOUSE CLICK DISABLED";
function RightMouseClickDisabled(e) {
   if(((navigator.appName=="Microsoft Internet Explorer")&&(event.button > 1))||((navigator.appName=="Netscape")&&(e.which > 1))){
	   //alert(message);
	   //return false;
   } else hidemenu;
}
document.onmousedown = RightMouseClickDisabled;
////////////////////////////////////////////// Pop-it menu- By Dynamic Drive ///////////////////////////////////////////////////
//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1
var ns6=document.getElementById&&!document.all
var ns4=document.layers

var menuTop=150

function showmenu(e,which){
	if (!document.all&&!document.getElementById&&!document.layers)
		return
	clearhidemenu()
	menuobj=ie4? document.all.popmenu : ns6? document.getElementById("popmenu") : ns4? document.popmenu : ""
	menuobj.thestyle=(ie4||ns6)? menuobj.style : menuobj
	if (ie4||ns6)
		menuobj.innerHTML=which
	else{
		menuobj.document.write('<layer name=gui bgColor=#E6E6E6 width=165 onmouseover="clearhidemenu()" onmouseout="hidemenu()">'+which+'</layer>')
		menuobj.document.close()
	}
	menuobj.contentwidth=(ie4||ns6)? menuobj.offsetWidth : menuobj.document.gui.document.width
	menuobj.contentheight=(ie4||ns6)? menuobj.offsetHeight : menuobj.document.gui.document.height
	eventX=ie4? event.clientX : ns6? e.clientX : e.x
	eventY=ie4? event.clientY : ns6? e.clientY : e.y
	
	//Find out how close the mouse is to the corner of the window
	var rightedge=ie4? document.body.clientWidth-eventX : window.innerWidth-eventX
	var bottomedge=ie4? document.body.clientHeight-eventY : window.innerHeight-eventY
	
	//if the horizontal distance isn't enough to accomodate the width of the context menu
	if (rightedge<menuobj.contentwidth)
	//move the horizontal position of the menu to the left by it's width
		menuobj.thestyle.left=ie4? document.body.scrollLeft+eventX-menuobj.contentwidth : ns6? window.pageXOffset+eventX-menuobj.contentwidth : eventX-menuobj.contentwidth
	else
	//position the horizontal position of the menu where the mouse was clicked
		menuobj.thestyle.left=ie4? document.body.scrollLeft+eventX : ns6? window.pageXOffset+eventX : eventX
	
	//same concept with the vertical position
	if (bottomedge<menuobj.contentheight)
		menuobj.thestyle.top=ie4? document.body.scrollTop+eventY-menuobj.contentheight : ns6? window.pageYOffset+eventY-menuobj.contentheight : eventY-menuobj.contentheight
	else
		menuobj.thestyle.top=menuTop	
//		menuobj.thestyle.top=ie4? document.body.scrollTop+event.clientY+20 : ns6? window.pageYOffset+eventY+20 : eventY+20
	menuobj.thestyle.visibility="visible"
	return false
}

function contains_ns6(a, b) {
	//Determines if 1 element in contained in another- by Brainjar.com
	if (b==null) return false;
	while (b.parentNode)
		if ((b = b.parentNode) == a)
			return true;
	return false;
}

function hidemenu(){
	if (window.menuobj)
		menuobj.thestyle.visibility=(ie4||ns6)? "hidden" : "hide"
}

function dynamichide(e){
	if (ie4&&!menuobj.contains(e.toElement))
		hidemenu()
	else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
		hidemenu()
}

function delayhidemenu(){
	if (ie4||ns6||ns4)
		delayhide=setTimeout("hidemenu()",500)
}

function clearhidemenu(){
	if (window.delayhide)
		clearTimeout(delayhide)
}

function highlightmenu(e,state){
	if (document.all)
			source_el=event.srcElement
	else if (document.getElementById)
		source_el=e.target
	if (source_el.className=="menuitems"){
		source_el.id=(state=="on")? "mouseoverstyle" : ""
	} else{
		while(source_el.id!="popmenu"){
			source_el=document.getElementById? source_el.parentNode : source_el.parentElement
			if (source_el.className=="menuitems"){
				source_el.id=(state=="on")? "mouseoverstyle" : ""
			}
		}
	}
}

function getvars() {
	xdir=document.login.username.value;
	xpassword=document.login.password.value;
}
function setvars() {
	document.login.username.value=xdir;
	document.login.password.value=xpassword;
}

////////////////////////////////////////////// SCROLL PICS ///////////////////////////////////////////////////

var sliderwidth="500px"  //Specify the slider's width (in pixels)

var sliderheight="125px"  //Specify the slider's height

var slidespeed=2  //Specify the slider's slide speed (larger is faster 1-10)

slidebgcolor="white"  //configure background color:

leftrightslide=''
var finalslide=''
var copyspeed=slidespeed
var iedom=document.all||document.getElementById
if (iedom)
	document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px"></span>')
var actualwidth=''
var cross_slide, ns_slide
var lefttime;

function fillup(slideArr){
	if (lefttime!='') clearInterval(lefttime);
	leftrightslide='<nobr>'+slideArr.join(" ")+'</nobr>'
	if (iedom){
		cross_slide=document.getElementById? document.getElementById("test2") : document.all.test2
		cross_slide2=document.getElementById? document.getElementById("test3") : document.all.test3
		cross_slide.innerHTML=cross_slide2.innerHTML=leftrightslide
		document.getElementById('temp').innerHTML = leftrightslide; 
		actualwidth=document.all? cross_slide.offsetWidth : document.getElementById("temp").offsetWidth
		cross_slide.style.left=0
		cross_slide2.style.left=actualwidth+4+"px"
	} else if (document.layers) {
		ns_slide=document.ns_slidemenu.document.ns_slidemenu2
		ns_slide2=document.ns_slidemenu.document.ns_slidemenu3
		ns_slide.document.write(leftrightslide)
		ns_slide.document.close()
		actualwidth=ns_slide.document.width
		ns_slide.left=0
		ns_slide2.left=actualwidth+4
		ns_slide2.document.write(leftrightslide)
		ns_slide2.document.close()
	}
	lefttime=setInterval("slideleft()",30)
}

function slideleft(){
	if (iedom){
		if (parseInt(cross_slide.style.left)>(actualwidth*(-1)+8))
			cross_slide.style.left=parseInt(cross_slide.style.left)-copyspeed+"px"
		else
				cross_slide.style.left=parseInt(cross_slide2.style.left)+actualwidth+3+"px"
		if (parseInt(cross_slide2.style.left)>(actualwidth*(-1)+8))
			cross_slide2.style.left=parseInt(cross_slide2.style.left)-copyspeed+"px"
		else
		cross_slide2.style.left=parseInt(cross_slide.style.left)+actualwidth+3+"px"
	} else if (document.layers) {
		if (ns_slide.left>(actualwidth*(-1)+8))
			ns_slide.left-=copyspeed
		else
			ns_slide.left=ns_slide2.left+actualwidth+2
		
		if (ns_slide2.left>(actualwidth*(-1)+8))
			ns_slide2.left-=copyspeed
		else
			ns_slide2.left=ns_slide.left+actualwidth+2
	}
}

if (iedom||document.layers){
	with (document){
		write('<table  align=center border="0" cellspacing="0" cellpadding="0" style="xtext-align:center;"><tr><td >')
		if (iedom){
			write('<div style="position:relative;width:'+sliderwidth+';height:'+sliderheight+';overflow:hidden">')
			write('<div class="slider" style="position:absolute;width:'+sliderwidth+';height:'+sliderheight+';background-color:'+slidebgcolor+'" onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed">')
			write('<div class="xslider" id="test2" style="position:absolute;left:0px;top:0px"></div>')
			write('<div class="xslider" id="test3" style="position:absolute;left:-1000px;top:0px"></div>')
			write('</div></div>')
		}else if (document.layers){
			write('<ilayer width='+sliderwidth+' height='+sliderheight+' name="ns_slidemenu" bgColor='+slidebgcolor+'>')
			write('<layer name="ns_slidemenu2" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>')
			write('<layer name="ns_slidemenu3" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>')
			write('</ilayer>')
		}
		write('</td></tr></table>')
	}
}

///////////////////////////////////////////////// SHOW THUMBS ////////////////////////////////////////////////////////////

function show_thumbs( slideArr ) {
	var thumbs=slideArr.join(" ")+footer
	thumbs=thumbs.replace(/vspace=0 hspace=0/g,"vspace=12 hspace=12  ");
	if (navigator.userAgent.indexOf("Opera")!=-1 && document.getElementById) type="OP"; 
	if (document.all) type="IE"; 
	if (document.layers) type="NN"; 
	if (!document.all && document.getElementById) type="MO"; 
	
	if (type=="IE") {
		document.all.show_thumbs.innerHTML=thumbs
	}
	if (type=="NN") {
		document.show_thumbs.innerHTML=thumbs
	}
	if (type=="MO" || type=="OP") {
		document.getElementById('show_thumbs').innerHTML = thumbs; 
	}
	show_content('show_thumbs')
}

///////////////////////////////////////////////// SHOW PHOTO ////////////////////////////////////////////////////////////

function showPhoto(src,slideArrName) {
	if (navigator.userAgent.indexOf("Opera")!=-1 && document.getElementById) type="OP"; 
	if (document.all) type="IE"; 
	if (document.layers) type="NN"; 
	if (!document.all && document.getElementById) type="MO"; 
	var visible=src=="" ? type=="NN" ? "hide" : "hidden" : "visible";
	if (src!="") show_content("")
	if (src=="") src="images/blank.gif";
	if (type=="IE") {
	  document.images["photo"].src = src
	  document.images["photo"].alt = slideArrName
		eval("document.all.showphoto.style.visibility=visible");
	}
	if (type=="NN") {
		document.imgDiv.document.images["photo"].src = src
		eval("document.showphoto.visibility=visible");
	}
	if (type=="MO" || type=="OP") {
		  document.getElementById("photo").src = src
		  document.getElementById("photo").alt = slideArrName
    	eval("document.getElementById('showphoto').style.visibility=visible");
	}
} 
	
function alpha(obj, opacity, finishopacity, style ) {
	obj.style.filter=" Alpha(Opacity=" + opacity + ", FinishOpacity=" + finishopacity + ", Style=" + style + " )  ;";
}


/////////////////////////////////////////////////////// SCROLL TEXT ///////////////////////////////////////////////////////////


var sliderTimeout=null;

function startScroller(txt){
	showPhoto("")
	if (document.all) {
		ieslider.innerHTML= txt
	} else if (document.getElementById) {
		document.getElementById("slider").style.visibility="show"
		ns6marquee(document.getElementById('slider'), txt)
	} else if(document.layers) {
		document.slider1.visibility="show"
		ns4marquee(document.slider1.document.slider2, txt)
	}
}
function ns4marquee(whichlayer, txt){
	ns4layer=eval(whichlayer)
	ns4layer.document.write(txt)
	ns4layer.document.close()
	sizeup=ns4layer.document.height
	ns4layer.top-=sizeup
	ns4slide()
}
function ns4slide(){
	if (ns4layer.top>=sizeup*(-1)){
		ns4layer.top-=sspeed
		if (sliderTimeout!=null) clearTimeout(sliderTimeout)
		sliderTimeout=setTimeout("ns4slide()",100)
	}else{
		ns4layer.top=sheight
		ns4slide()
	}
}
function ns6marquee(whichdiv, txt){
	ns6div=eval(whichdiv)
	ns6div.innerHTML=txt
	ns6div.style.top=sheight
	sizeup=sheight
	ns6slide()
}
function ns6slide(){
	if (parseInt(ns6div.style.top)>=sizeup*(-1)){
		ns6div.style.top=parseInt(ns6div.style.top)-sspeed
		if (sliderTimeout!=null) clearTimeout(sliderTimeout)
		sliderTimeout=setTimeout("ns6slide()",100)
	}else{
		ns6div.style.top=sheight
		ns6slide()
	}
}
function writeTextSlider() {
	if (document.all){ 
		document.writeln('<marquee id="ieslider" scrollAmount=' + sspeed + ' width=' + swidth +' height=' + sheight + ' direction=up style="background-color:white;border:solid 1px black;margin:5px; ">')
		ieslider.onmouseover=new Function("ieslider.scrollAmount=0")
		ieslider.onmouseout=new Function("if (document.readyState=='complete') ieslider.scrollAmount=" + sspeed)
		document.writeln('</marquee>')
	}
	if (document.getElementById && !document.all){ // netscape 4
		document.write('<span style=" width:' + swidth +'; height:' + sheight + ';" ');
		document.write('<ilayer width=' + swidth +' height=' + sheight + ' name="slider1" bgcolor="black" visibility=hide>');
		document.write('<layer name="slider2" onMouseover="sspeed=0;" onMouseout="sspeed=2">');
		document.write('</layer>');
		document.write('</ilayer>');
		document.write('<div style="margin:5px;border:solid 1px black; position:relative;overflow:hidden;width:' + swidth +';height:' + sheight + ';clip:rect(0 ' + (swidth+3) +' ' + (sheight+2) + ' 0);ba" onMouseover="sspeed=0;" onMouseout="sspeed=' + sspeed + '">')
		document.write('<div id="slider" style="position:relative;width:&{swidth}; ">')
		document.write('</div></div></span>')
	}
}

/////////////////////////////////////////////////////////// show_content //////////////////////////////////////////////////////

function show_content(id) {
	if (navigator.userAgent.indexOf("Opera")!=-1 && document.getElementById) type="OP"; 
	if (document.all) type="IE"; 
	if (document.layers) type="NN"; 
	if (!document.all && document.getElementById) type="MO"; 
	if (id!="") showPhoto("")
	action = id=='' ? 'hidden' : 'visible';
	id=id=='' ? 'show_history' : id;
	if (type=="IE") {
		eval("document.all.show_splash.style.visibility='hidden'");
		eval("document.all.show_history.style.visibility='hidden'");
		eval("document.all.show_awards.style.visibility='hidden'");
		eval("document.all.show_links.style.visibility='hidden'");
		eval("document.all.show_hints.style.visibility='hidden'");
		eval("document.all.show_prices.style.visibility='hidden'");
		eval("document.all.show_contact.style.visibility='hidden'");
		eval("document.all.show_dales_gallery.style.visibility='hidden'");
		eval("document.all.show_thumbs.style.visibility='hidden'");
		eval("document.all." + id + ".style.visibility='" + action + "'");}
	if (type=="NN") {
		eval("document.show_splash.visibility='hide'");
		eval("document.show_history.visibility='hide'");
		eval("document.show_awards.visibility='hide'");
		eval("document.show_links.visibility='hide'");
		eval("document.show_hints.visibility='hide'");
		eval("document.show_prices.visibility='hide'");
		eval("document.show_contact.visibility='hide'");
		eval("document.show_dales_gallery.visibility='hide'");
		eval("document.show_thumbs.visibility='hide'");
		eval("document." + id + ".visibility='" + action=='hidden' ? 'hide' : 'show' + "'");}
	if (type=="MO" || type=="OP") {
  	eval("document.getElementById('show_splash').style.visibility='hidden'");
  	eval("document.getElementById('show_history').style.visibility='hidden'");
  	eval("document.getElementById('show_awards').style.visibility='hidden'");
  	eval("document.getElementById('show_links').style.visibility='hidden'");
  	eval("document.getElementById('show_hints').style.visibility='hidden'");
  	eval("document.getElementById('show_prices').style.visibility='hidden'");
  	eval("document.getElementById('show_contact').style.visibility='hidden'");
  	eval("document.getElementById('show_dales_gallery').style.visibility='hidden'");
  	eval("document.getElementById('show_thumbs').style.visibility='hidden'");
  	eval("document.getElementById('" + id + "').style.visibility='" + action + "'");
  }
}  
function showtip(show,msg) {
	if (navigator.userAgent.indexOf("Opera")!=-1 && document.getElementById) type="OP"; 
	if (document.all) type="IE"; 
	if (document.layers) type="NN"; 
	if (!document.all && document.getElementById) type="MO"; 
	msg= msg ? "Click this photo to display all the thumbnails in this gallery" : "Click this thumbnail to display an enlargment"
	if (type=="IE") {
		document.all.tip.innerHTML=msg;
		eval("document.all.tip.style.visibility='" + (show ?  "visible" : "hidden" ) +"'" );
	}	
	if (type=="NN") {
		document.layers["tip"].document.open();
		document.layers["tip"].document.write(msg);
		document.layers["tip"].document.close();
		eval("document.tip.visibility='" + (show ?  "show" : "hide" ) +"'" );
	}	
	if (type=="MO" || type=="OP") {
		document.getElementById('tip').innerHTML = str;
  	eval("document.getElementById('tip').style.visibility='" + (show ?  "visible" : "hidden" ) +"'" );
  }
}