
// Scripts for index.htm

// Add to favourites code
	
	function bookmarksite(title,url){
	if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
	else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
	} 
	else if(document.all)// ie
	window.external.AddFavorite(url, title);
	}

	
// Script for recipes.htm	

function loadXMLDoc(xmlfile){
var xmldoc

if(window.XMLHttpRequest)
{
xmldoc = new window.XMLHttpRequest();

xmldoc.open("GET",xmlfile,false);
xmldoc.send("");
return (xmldoc.responseXML);
}
else if(window.ActiveXObject)
{
xmldoc = new ActiveXObject("Microsoft.XMLDOM");
xmldoc.async = false;
xmldoc.load(xmlfile);
return (xmldoc);
} else
{
alert("XML loading not supported.");
return (null);
}
}
	
	function displayRecipe(fname)
	{
	document.getElementById("zone").innerHTML = "";
	xml=loadXMLDoc(fname);
	xsl=loadXMLDoc("recipe.xsl");
	// code for IE
	if (window.ActiveXObject)
	{
	ex=xml.transformNode(xsl);
	document.getElementById("zone").innerHTML=ex;
	}
	// code for Mozilla, Firefox, Opera, etc.
	else if (document.implementation
	&& document.implementation.createDocument)
	{
	xsltProcessor=new XSLTProcessor();
	xsltProcessor.importStylesheet(xsl);
	resultDocument = xsltProcessor.transformToFragment(xml,document);
	document.getElementById("zone").appendChild(resultDocument);
	}
	window.scroll(0,0);
	}
	
// Scripts for slideshow.htm
	//Original:  Ricocheting (ricocheting@hotmail.com)
	//Web Site:  http://www.ricocheting.com
	
		
		var rotate_delay = 5000; // delay in milliseconds (5000 = 5 secs)
		current = 0;
		function next() {
		if (document.slideform.slide[current+1]) {
		document.images.show.src = document.slideform.slide[current+1].value;
		document.slideform.slide.selectedIndex = ++current;
		}
		else first();
		}
		function previous() {
		if (current-1 >= 0) {
		document.images.show.src = document.slideform.slide[current-1].value;
		document.slideform.slide.selectedIndex = --current;
		}
		else last();
		}
		function first() {
		current = 0;
		document.images.show.src = document.slideform.slide[0].value;
		document.slideform.slide.selectedIndex = 0;
		}
		function last() {
		current = document.slideform.slide.length-1;
		document.images.show.src = document.slideform.slide[current].value;
		document.slideform.slide.selectedIndex = current;
		}
		function ap(text) {
		document.slideform.slidebutton.value = (text == "Stop") ? "Start" : "Stop";
		rotate();
		}
		function change() {
		current = document.slideform.slide.selectedIndex;
		document.images.show.src = document.slideform.slide[current].value;
		}
		function rotate() {
		if (document.slideform.slidebutton.value == "Stop") {
		current = (current == document.slideform.slide.length-1) ? 0 : current+1;
		document.images.show.src = document.slideform.slide[current].value;
		document.slideform.slide.selectedIndex = current;
		window.setTimeout("rotate()", rotate_delay);
		}
		}

// changes main heading font on index for winter
function changeclass(){

			var today = new Date;

						
			if 
				(today.getMonth() >= 10 && today.getDate() >= 15 ||
			 	today.getMonth() <= 1 && today.getDate() <= 15){


				document.getElementById("MainTitle").className="style3";
				}
				else
				{
				document.getElementById("MainTitle").className="style2";
				}
		
				
			
		}

// Window opener for Dog pictures

function newWindow(mPic){
    
              	PicWindow = window.open(mPic, 'PicWin', 'width=640,height=420')
                    
               	PicWindow.focus()
                    }
