// Copyright 2000-2004, DataCom of Duluth
        
// Setup
home_on=new Image(136,56);
home_on.src="/images/menu/home_on.jpg";
home_off=new Image(136,56);
home_off.src="/images/menu/home_off.jpg";

tradition_on=new Image(136,56);
tradition_on.src="/images/menu/tradition_on.jpg";
tradition_off=new Image(136,56);
tradition_off.src="/images/menu/tradition_off.jpg";

ingredients_on=new Image(136,56);
ingredients_on.src="/images/menu/ingredients_on.jpg";
ingredients_off=new Image(136,56);
ingredients_off.src="/images/menu/ingredients_off.jpg";

locations_on=new Image(136,56);
locations_on.src="/images/menu/locations_on.jpg";
locations_off=new Image(136,56);
locations_off.src="/images/menu/locations_off.jpg";

menus_on=new Image(136,56);
menus_on.src="/images/menu/menus_on.jpg";
menus_off=new Image(136,56);
menus_off.src="/images/menu/menus_off.jpg";

lovers_on=new Image(136,56);
lovers_on.src="/images/menu/lovers_on.jpg";
lovers_off=new Image(136,56);
lovers_off.src="/images/menu/lovers_off.jpg";

extra_on=new Image(136,56);
extra_on.src="/images/menu/extra_on.jpg";
extra_off=new Image(136,56);
extra_off.src="/images/menu/extra_off.jpg";

talk_on=new Image(136,56);
talk_on.src="/images/menu/talk_on.jpg";
talk_off=new Image(136,56);
talk_off.src="/images/menu/talk_off.jpg";

info_on=new Image(320,22);
info_on.src="/images/menu/info_on.gif";
info_off=new Image(320,22);
info_off.src="/images/menu/info_off.gif";

balance_on=new Image(320,22);
balance_on.src="/images/menu/balance_on.gif";
balance_off=new Image(320,22);
balance_off.src="/images/menu/balance_off.gif";

// Roll Over Buttons
function turnOn(imgName) {
	if(document.cookie.split("=")[1]!=document[imgName].name) {
		document[imgName].src=eval(imgName + "_on.src");
	}
}

function turnOff(imgName) {
	if(document.cookie.split("=")[1]!=document[imgName].name) {
		document[imgName].src=eval(imgName + "_off.src");
	}
}

//Open Files
function openFile(theFile) {
    window.open (theFile);
}

function openFileA(theFile, theWindow, theBar, theSize, theWidth, theHeight) {
    window.open (theFile, theWindow,"status=no,location=no,toolbars="+theBar+",menubar="+theBar+",directories=no,scrollbars=yes,resizable="+theSize+",width="+theWidth+",height="+theHeight);
}

// Open The Picture File
function openPic(iFile) {
	samPic=new Image();
	samPic.src=iFile;
	checkSize(iFile);
}

// Checks The Size - Because It Matters
function checkSize(iFile) {
	if((samPic.width!=0)&&(samPic.height!=0)) {
		displayPic(iFile);
	} else {
		reTest="checkSize('"+iFile+"')";
		doAgain=setTimeout(reTest,50);
	}
}

// Write The Image File
function displayPic(iFile) {
	iFw=samPic.width+20;
	iFh=samPic.height+60;
	nwSetup="width="+iFw+"px,height="+iFh+"px";
	newWindow=window.open(iFile, "picWin", "toolbar=no,location=no,scrollbars=no,resizable=no,"+nwSetup);
   	if (newWindow && !newWindow.closed) {
	newWindow.resizeTo(iFw+20,iFh+100);
	}
	newWindow.document.open();
	newWindow.document.write("<html>");
	newWindow.document.write("<head>");
	newWindow.document.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">");
	newWindow.document.write("<!-- Copyright 2000-2007, DataCom/OTA, Inc. -->");
	newWindow.document.write("<title>mysammys.com</title>");
	newWindow.document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"/gallery.css\">");
	newWindow.document.write("</head>");
	newWindow.document.write("<body>");
	newWindow.document.write("<center>");
	newWindow.document.write("<img src=\""+iFile+"\"><br><br>");
	newWindow.document.write("<p style=\"text-align:center; font-size:8pt;\"><a href=\"javascript:window.close()\">[CLOSE WINDOW]</a>");
	newWindow.document.write("</center>");
	newWindow.document.write("</body>");
	newWindow.document.write("</html>");
	newWindow.document.close();
	newWindow.focus();
}

//Show movie
function playMov(mFile)
{
	newWindow=window.open (mFile,"newWindow","width=340,height=315,scrollbars=no,resizable=no");
	newWindow.document.open();
	newWindow.document.write("<html>");
	newWindow.document.write("<head>");
	newWindow.document.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">");
	newWindow.document.write("<!-- Copyright 2000-2007, DataCom/OTA, Inc. -->");
	newWindow.document.write("<title>mysammys.com</title>");
	newWindow.document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"/gallery.css\">");
	newWindow.document.writeln("</head>");
	newWindow.document.writeln("<body>");
	newWindow.document.writeln("<EMBED SRC=\""+mFile+"\" WIDTH=320 HEIGHT=255 AUTOPLAY=true CONTROLLER=true LOOP=false PLUGINSPAGE=\"http://www.apple.com/quicktime/\">");
	newWindow.document.writeln("<br><br><center>");
	newWindow.document.writeln("<a href=\"javascript:window.close()\"><font size=\"1\">CLOSE</font></a>");
	newWindow.document.writeln("</body>");
	newWindow.document.writeln("</html>");
	newWindow.document.close();
}

function postFile(strURL, strQuery) {
    var xmlHttpReq = false;
    var self = this;
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepage(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(eval(strQuery)());
	document.getElementById("formLayer").innerHTML = "<p><br/>Sending . . . </p>";
}

function love() {
    var form = document.forms['samlove'];
    var fn = form.FirstName.value;
    var ln = form.LastName.value;
    var em = form.Email.value;
    var cn = form.City.value;
    var sn = form.State.value;
    var zc = form.Zip.value;
	var ys = form.Story.value;
    qstr = 'FirstName=' + escape(fn) + '&LastName=' + escape(ln) + '&Email=' + escape(em) + '&City=' + escape(cn) + '&State=' + escape(sn) + '&Zip=' + escape(zc) + '&Story=' + escape(ys);
    return qstr;
}

function talk() {
    var form = document.forms['talk'];
    var lo = form.Location.value;
    var fn = form.Name.value;
    var em = form.Email.value;
    var tp = form.Phone.value;
	var yc = form.Comments.value;
    qstr = 'Location=' + escape(lo) + '&Name=' + escape(fn) + '&Email=' + escape(em) + '&Phone=' + escape(tp) + '&Comments=' + escape(yc);
    return qstr;
}

function survey() {
    var form = document.forms['survey'];
    var na = form.Name.value;
    var lo = form.Location.value;
	var qu = "";
	for (i=0; i<form.Quality.length; i++)
		if (form.Quality[i].checked) {
			var qu = form.Quality[i].value;
		}
	var fr = "";
	for (i=0; i<form.Friendliness.length; i++)
		if (form.Friendliness[i].checked) {
			var fr = form.Friendliness[i].value;
		}
	var ea = "";
	for (i=0; i<form.Ease.length; i++)
		if (form.Ease[i].checked) {
			var ea = form.Ease[i].value;
		}
	var vr = "";
	for (i=0; i<form.Varity.length; i++)
		if (form.Varity[i].checked) {
			var vr = form.Varity[i].value;
		}
	var va = "";
	for (i=0; i<form.Value.length; i++)
		if (form.Value[i].checked) {
			var va = form.Value[i].value;
		}
	var oa = "";
	for (i=0; i<form.OrderAgain.length; i++)
		if (form.OrderAgain[i].checked) {
			var oa = form.OrderAgain[i].value;
		}
    var or = form.Ordered.value;
    var em = form.Email.value;
	var of = "";
	for (i=0; i<form.Often.length; i++)
		if (form.Often[i].checked) {
			var of = form.Often[i].value;
		}
	var yc = form.Comments.value;
    qstr = 'Name=' + escape(na) + '&Location=' + escape(lo) + '&Quality=' + escape(qu) + '&Friendliness=' + escape(fr) + '&Ease=' + escape(ea) + '&Varity=' + escape(vr) + '&Value=' + escape(va) + '&OrderAgain=' + escape(oa) + '&Ordered=' + escape(or) + '&Email=' + escape(em) + '&Often=' + escape(of) + '&Comments=' + escape(yc);
    return qstr;
}

function updatepage(str){
    document.getElementById("formLayer").innerHTML = str;
}

function getFile(theFile, theDiv) {
	var pageRequest = false;
	
	if (window.XMLHttpRequest)pageRequest = new XMLHttpRequest();
    else if (window.ActiveXObject)pageRequest = new ActiveXObject("Microsoft.XMLHTTP");
    else return false;
	
    pageRequest.open('GET', theFile, true);
    pageRequest.onreadystatechange = function() {
        if (pageRequest.readyState == 4) {
			document.getElementById(theDiv).innerHTML = pageRequest.responseText;
		}
    }
    pageRequest.send(null);
}