// JavaScript Document
/************************************************************
Flying Rhino Restaurant java-scripts are here
Last updated: 5.26.2008
This page and codes created by Ferenc Vasady-Kovacs
Feel free to use any code on this page
Code is commented with direction
Please display a credit to Ferenc@Smore.Net for any code borrowed from this site
*************************************************************/

function myalert()	{
	alert('this works');
}

//begin multibrowser
	/* //remove comments if you wish to actively id browsers
	browser = navigator.appName;
	browserNum = parseInt(navigator.appVersion);
	alert("browser: " + browser);
	*/
	//call for functions in the head of everypage or code will not work.
	function my_multibrowser() {
		if (document.all)
		{// Internet Explorer
			layerRef = "document.all['";
			endLayerRef = "']";
			styleRef = ".style";
		}
		else if (document.layers){
			// Netscape 4.x
			layerRef = "document.layers['";
			endLayerRef = "']";
			styleRef = "";
		}
		else if (document.getElementById) {
		// Netscape 6
			layerRef = "document.getElementById('";
			styleRef = ".style";
			endLayerRef = "')";
		}
	}
//end multibrowser



//Two slideshows, one with image, one without.
	//set image viewer width
		var myViewerWidth = 310;
		var myPageWidth = 680;
		
		function floatmyslide () {
			if (document.all) {
				document.all.myfloatslide.style.pixelTop = document.body.scrollTop + 50;
			}
			else if (document.layers) {
				document.myfloatslide.top = window.pageYOffset + 50;
			}
			else if (document.getElementById) {
				document.getElementById('myfloatslide').style.top = (window.pageYOffset + 50) + 'px';
			}	
		}				
						
		function floatButton () {
			floatmyslide();
			floatmyslide2();
			initButton();
		}
		//center float
					
		function initButton () {
		  if (myViewerWidth<myPageWidth) {
			if (document.all) {
				document.all.myfloatslide.style.pixelLeft = (document.body.clientWidth - document.all.myfloatslide.offsetWidth)/2;
				document.all.myfloatslide2.style.pixelLeft = (document.body.clientWidth - document.all.myfloatslide2.offsetWidth)/2;
				
			}
			else if (document.layers) {
				document.myfloatslide.left =( window.innerWidth - document.myfloatslide.clip.width -300)/2;
				document.myfloatslide2.left =( window.innerWidth - document.myfloatslide2.clip.width -300)/2;
			}
			else if (document.getElementById) {
				document.getElementById('myfloatslide').style.left = (window.innerWidth - 850 )/2 + 'px';
				document.getElementById('myfloatslide2').style.left = (window.innerWidth - 850 )/2 + 'px';
			}
		  }
		  else {
			if (document.all) {
				document.all.myfloatslide.style.pixelLeft = 10;
				document.all.myfloatslide2.style.pixelLeft = 10;
				
			}
			else if (document.layers) {
				document.myfloatslide.left =10;
				document.myfloatslide2.left =10;
			}
			else if (document.getElementById) {
				document.getElementById('myfloatslide').style.left = 10;
				document.getElementById('myfloatslide2').style.left = 10;
			}
		  }
		}
//Mouseover slideshow with fade by Ferenc
	var mydescription = 'blah,blah';
	function changepic(mypicture,mydescnum) {
		closemyviewer2();
		floatButton ();
		if (mydescnum != 'same')	{
			mydescription = mydescnum;
		}
		else	{
			
		}
		if (document.layers) {
			document.myviewer.src= mypicture;
			document.myfloatslide.visibility = 'show';
			document.mydescpara.innerHTML = mydescription;
		}
		if (document.getElementById) {
			document.myviewer.src= mypicture;
			document.getElementById('myfloatslide').style.visibility = 'visible';
			document.getElementById('mydescpara').innerHTML = mydescription;
		}
		if (document.all) {
			document.all.myfloatslide.style.visibility = 'visible';
			document.all.mydescpara.innerHTML = mydescription;
			document.images.myviewer.style.filter="blendTrans(duration=1)";
			document.images.myviewer.style.filter="blendTrans(duration=1)";
			document.images.myviewer.filters.blendTrans.Apply();
			document.images.myviewer.src = mypicture;
			document.images.myviewer.filters.blendTrans.Play();
		}
	}
//shrink image viewer
	function shrinkmyviewer()	{
		if (document.myviewer.width>150)	{
			document.myviewer.width = (2 * (document.myviewer.width/3));
			document.myviewer2.width = document.myviewer.width;
			myViewerWidth = document.myviewer.width;
			if (document.myviewer.width>280)	{
			eval(layerRef + 'myfloatslide' + endLayerRef + styleRef + '.width =' + (document.myviewer.width+10));
			eval(layerRef + 'myfloatslide2' + endLayerRef + styleRef + '.width =' + (document.myviewer2.width+10));
				//document.all.myfloatslide.style.width = (document.myviewer.width+10);
			}
			else	{
			eval(layerRef + 'myfloatslide' + endLayerRef + styleRef + '.width = 280' );
			eval(layerRef + 'myfloatslide2' + endLayerRef + styleRef + '.width = 280' );
				//document.all.myfloatslide.style.width = 280;
			}
		}
		initButton ();
	}
//larger images
	function zoommyviewer()	{
		document.myviewer.width = (document.myviewer.width*1.5);
		document.myviewer2.width = document.myviewer.width;
		myViewerWidth = document.myviewer.width;
		initButton ();						
	}
	function closemyviewer(){
		if (document.layers) {
			document.myfloatslide.visibility = 'hidden';
		}
		else if (document.getElementById) {
			document.getElementById('myfloatslide').style.visibility = 'hidden';
		}
		else {
			document.all.myfloatslide.style.visibility = 'hidden';
		}
	}
	
//set text viewer width
	var myViewerWidth2 = 310;
	function floatmyslide2 () {
		if (document.all) {
			document.all.myfloatslide2.style.pixelTop = document.body.scrollTop + 50;
		}
		else if (document.layers) {
			document.myfloatslide2.top = window.pageYOffset + 50;
		}
		else if (document.getElementById) {
			document.getElementById('myfloatslide2').style.top = (window.pageYOffset + 50) + 'px';
		}	
	}				
						
//Mouseover slideshow no image by Ferenc
	function changenopic(mydescnum) {
		closemyviewer ();
		floatButton ();
		mydescription = ('<img width="300" height="1" border="0" name="myviewer2" src="images/flying_rhinoinvisible.gif"><br>'+ mydescnum);						
		if (document.layers) {
			document.myfloatslide2.visibility = 'show';
			document.mydescpara2.innerHTML = mydescription;
		}
		if (document.getElementById) {
			document.getElementById('myfloatslide2').style.visibility = 'visible';
			document.getElementById('mydescpara2').innerHTML = mydescription;
		}
		if (document.all) {
			document.all.myfloatslide2.style.visibility = 'visible';
			document.all.mydescpara2.innerHTML = mydescription;
		}
	}
//close the text viewer
	function closemyviewer2(){
		if (document.layers) {
			document.myfloatslide2.visibility = 'hidden';
		}
		else if (document.getElementById) {
			document.getElementById('myfloatslide2').style.visibility = 'hidden';
		}
		else {
			document.all.myfloatslide2.style.visibility = 'hidden';
		}
	}
	
//Fading slideshow
	<!-- Original:  CodeLifter.com (support@codelifter.com) -->
	<!-- Web Site:  http://www.codelifter.com -->
	<!-- rewritten by Ferenc 'to suit my needs'
	<!-- This script and many more are available free online at -->
	<!-- The JavaScript Source!! http://javascript.internet.com -->
	<!-- Begin
	// Set slideShowSpeed (milliseconds)
	var slideShowSpeed = 5000;
	// Duration of crossfade (seconds)
	var crossFadeDuration = 2;
	// Specify the image files
	/*From below this line to above next marked line needs to be pasted below </body> but above </html> in page desired for slideshow.  Add or subtract additional pictures to Pic[#] array for less or more images.  Change images for different images.  There has to be an image marked name="SlideShow" within the image tag for this to work.
	<script language="javascript">
		<!--//
		var Pic = new Array();
		// to add more images, just continue
		// the pattern, adding to the array below
		
		Pic[0] = 'images/rhino_largenu.gif'
		Pic[1] = 'images/slidenew/image1.jpg'
		Pic[2] = 'images/slidenew/image2.jpg'
		Pic[3] = 'images/slidenew/image3.jpg'
		Pic[4] = 'images/slidenew/image4.jpg'
		Pic[5] = 'images/slidenew/image5.jpg'
		Pic[6] = 'images/slidenew/image6.jpg'
		Pic[7] = 'images/slidenew/image7.jpg'
		Pic[8] = 'images/slidenew/image8.jpg'
		Pic[9] = 'images/slidenew/image9.jpg'
		
		// do not edit anything below this line
		var t;
		var j = 0;
		var p = Pic.length;
		var preLoad = new Array();
		for (i = 0; i < p; i++) {
		preLoad[i] = new Image();
		preLoad[i].src = Pic[i];
		}
		runSlideShow();
		//-->
	</script>
	Copy above this line until first occurence of including <script language="javascript">*/
	function runSlideShow() {
	if (document.all) {
	document.images.SlideShow.style.filter="blendTrans(duration=2)";
	document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
	document.images.SlideShow.filters.blendTrans.Apply();
	}
	document.images.SlideShow.src = preLoad[j].src;
	if (document.all) {
	document.images.SlideShow.filters.blendTrans.Play();
	}
	j = j + 1;
	if (j > (p - 1)) j = 0;
	t = setTimeout('runSlideShow()', slideShowSpeed);
	}

//Check submission form for values before sending
//This code is only used on the submission form page and can be referenced but will need extensive modification to work on other pages
	function mysubmitchecker(mailform) {
		var myname= mailform.Name.value;
		var myemail=mailform.email.value;
		var myaddress=mailform.Address.value;
		var myphone=mailform.Phone.value;
		var myalert="";
		if((myname=="")||(myname=="First MI Last")) {
			myalert="I need to know what to call you. "
		}
		if((myemail=="")&&(myaddress=="")&&(myphone=="")) {
			myalert=(myalert + "I need some method of contacting you. ");
		}
		if(myalert=="") {
			return true;
		}
		alert(myalert);
		return false;
	}		
