// Copyright Acro Media Inc. 1998-2006, www.acromediainc.com

var copyrightYear = {
	init: function(){
		if(document.getElementById('insertYear')) document.getElementById('insertYear').innerHTML = new Date().getFullYear();
	}
}

var externalLinks = {
	init: function(){
		if (!document.getElementsByTagName) return;
		var anchors = document.getElementsByTagName("a");
		for (var i=0; i<anchors.length; i++) {
			if (anchors[i].getAttribute("href") && anchors[i].getAttribute("rel") == "external") anchors[i].target = "_blank";
		}
	}
}


//Checks to see if safari is on, boolean
var detect = navigator.userAgent.toLowerCase();
var safStatus,thestring;
function checkSafari(){	
	if (checkIt('safari')) safStatus = true;
	else safStatus = false;
	function checkIt(string){
		place = detect.indexOf(string) + 1;
		return place;
	}
}

window.onload = function (){
	checkSafari();
	copyrightYear.init();
	externalLinks.init();
	SBDrawCart.init();
	SBDrawMenu();
	setSounds.init();
}

var setSounds = {
	soundfile : "sound1.mp3",
	init : function(){
		if(document.getElementById("SBJSMenu")){
			var a = document.getElementById("SBJSMenu").getElementsByTagName("a");
			for(var i =0; i < a.length; i++){
				a[i].onmouseover = setSounds.play;
			}
		}
	},
	play : function(){
		if (document.all && document.getElementById && document.getElementById("soundeffect")){
			document.getElementById("soundeffect").src = "";
			document.getElementById("soundeffect").src = setSounds.soundfile;
		}
	}
}