/* TURN ON OR OFF AS NEEDED */


/*

==========================
IMAGE SWAPPING ON ROLLOVER
==========================

if (document.images) {
	ph_upstairs = new Image
	ph_upstairs.src = "i/ph_upstairs.jpg"
}
else { 
	ph_upstairs = ""

	document.photo = "" 
}


REQURIES THIS CODE IN XHTML

1. ASSIGN NAME VARIABLE TO IMAGE TO SWAP OUT (PHOTO HERE)
<img src="i/ph_river.jpg" width="470" height="351" border="0" name="photo" alt="the samoset retreat photo gallery" />

2. ASSIGN MOUSEOVER AND SOURCE TO THE THUMBNAIL IMAGE
<img src="i/ph_upstairs_th.jpg" width="63" height="47" border="0" alt="upstairs" class="th" onmouseover="document.photo.src=ph_upstairs.src" />

*/


/*
========================
SHIPPING SAME AS BILLING
========================

function FillShipping(f) {
if(f.same.checked == true) {
    f.sNm.value = f.bNm.value;
    f.sCn.value = f.bCn.value;
	f.sAd.value = f.bAd.value;
	f.sCt.value = f.bCt.value;
	f.sSt.value = f.bSt.value;
	f.sZc.value = f.bZc.value;
	f.sCy.value = f.bCy.value;
	f.sEm.value = f.bEm.value;
	f.sPh.value = f.bPh.value;
	f.sFn.value = f.bFn.value; 
    }
}

REQUIRES THIS CODE IN THE XHTML

<input type="checkbox" name="same" id="same_address" onclick="FillShipping(this.form)" /> Check if shipping address is the same as billing address

The values above sNm / bNm correspond to the name value of the input form element.  They can be changes as needed.

*/


/*
============================
EXTERNAL LINKS IN NEW WINDOW
============================

// this script adds class="external" to external links so you can style it to include the external icon



this.blankwin = function(){
	var hostname = window.location.hostname;
	hostname = hostname.replace("www.","").toLowerCase();
	var a = document.getElementsByTagName("a");	
	this.check = function(obj){
		var href = obj.href.toLowerCase();
		return (href.indexOf("http://")!=-1 && href.indexOf(hostname)==-1) ? true : false;				
	};
	this.set = function(obj){
		obj.target = "_blank";
		obj.className = "external";
	};	
	for (var i=0;i<a.length;i++){
		if(check(a[i])) set(a[i]);
	};		
};

// script initiates on page load. 

this.addEvent = function(obj,type,fn){
	if(obj.attachEvent){
		obj['e'+type+fn] = fn;
		obj[type+fn] = function(){obj['e'+type+fn](window.event );}
		obj.attachEvent('on'+type, obj[type+fn]);
	} else {
		obj.addEventListener(type,fn,false);
	};
};
addEvent(window,"load",blankwin);

*/


/*
===================
DROPDOWN NAVIGATION
===================


function getNewPage(form) {
	var f = form.urlList;
	var selectedUrl = f.options[f.selectedIndex].value;
	return location.href = selectedUrl;
}

*/
