// Modified version of the ultimate client sniff by these guys:
// http://webreference.com/tools/browser/javascript.html
var agt=navigator.userAgent.toLowerCase();
var appVer = navigator.appVersion.toLowerCase();
var is_minor = parseFloat(appVer);
var is_major = parseInt(is_minor);
var iePos  = appVer.indexOf('msie');
if (iePos !=-1) {
 is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)))
 is_major = parseInt(is_minor);
}
var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
var is_mac    = (agt.indexOf("mac")!=-1);
var is_ie   = (iePos!=-1);
var is_ie4   = (is_ie && is_major == 4);
var is_ie4up = (is_ie && is_minor >= 4);
var is_ie5   = (is_ie && is_major == 5);
var is_ie5up = (is_ie && is_minor >= 5);
var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
 && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
 && (agt.indexOf('webtv')==-1));
var is_nav4up = (is_nav && (is_major >= 4));
// http://www.moock.org/webdesign/flash/detection/moockfpi/
var flash5Installed = false;
var showFlash = false;
if(is_ie && is_win){
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('showFlash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
	document.write('</SCR' + 'IPT\> \n'); // break up end tag so it doesn't end our script
}

// E-mail Hiders
function eme() {
    var name = "webmaster";
    var host = "homefrontstudios";
				var ext = ".com";
    var delim = "\@";
				var br = "<br>";
    var href = "mailto:";
    var text = "\<a href='" + href + name + delim + host + ext + "'>" + name + delim + br + host + br + ext + "</a>";
document.write(text);
}

// wide display (without line breaks)
function eme_w() {
    var name = "webmaster";
    var host = "homefrontstudios";
				var ext = ".com";
    var delim = "\@";
    var href = "mailto:";
    var text = "\<a href='" + href + name + delim + host + ext + "'>" + name + delim + host + ext + "</a>";
document.write(text);
}
// Greeting specific to portion of the day
function SayHi() {
RightNow = new Date();
 if (RightNow.getHours() >=0 && RightNow.getHours() < 12){
  var phase = "morning";
		var x = 154;
		var alttxt = "Good morning!";
  }
 if (RightNow.getHours() >= 12 && RightNow.getHours() < 18){
  var phase = "noon";
		var x = 141;
		var alttxt = "Good afternoon!";
  }
 if (RightNow.getHours() >= 18 && RightNow.getHours() < 21){
  var phase = "evening";
		var x = 123;
		var alttxt = "Good evening!";
  }
 if (RightNow.getHours() >= 21 && RightNow.getHours() < 24){
  var phase = "night";
		var x = 143;
		var alttxt = "Good evening!";
  }
 document.write("<img src='graphics/" + phase + ".gif' width='" + x + "' height='40' alt='" + alttxt + "' border='0'>");
 }
 
function NoBlanks(form) {
 if (form.unm.value == "") {
  alert("Please supply a name.");
  form.unm.focus();
  return (false);
  }
 if (form.uml.value == "") {
  alert("Please supply an email address.");
  form.uml.focus();
  return (false);
  }
 if (form.subject.value == "") {
  alert("Please supply a subject for the message.");
  form.subject.focus();
  return (false);
  }
 if (form.body.value == "") {
  alert("Please fill in the body of the message.");
  form.body.focus();
  return (false);
  }
 return (true);
 }

function GetTitle(pgnm) {
/* var pgtitle= new Array(14) 
 pgtitle[0]="design", "shtml"; 
 pgtitle[1]="dev.shtml"; 
 pgtitle[2]="consult.shtml"; 
 pgtitle[3]="admin.shtml"; 
 pgtitle[4]="maint.shtml"; 
 pgtitle[5]="host.shtml"; 
 pgtitle[6]="promote.shtml"; 
 pgtitle[7]="portfolio.shtml"; 
 pgtitle[8]="tut.shtml"; 
 pgtitle[9]="free.shtml"; 
 pgtitle[10]="sw.shtml"; 
 pgtitle[11]="about.shtml"; 
 pgtitle[12]="eme.asp"; 
 pgtitle[13]="thx.asp"; 
*/
document.write ("<img src='graphics/" + pgnm + ".gif' width='335' height='40' alt='' border='0'>");
}

function openWin(winUrl)	{
	argc = arguments.length;
	h = (argc > 1) ? arguments[1] : 600;
	w = (argc > 2) ? arguments[2] : 450;
	returnVal = (argc > 3) ? arguments[3] : 1;
	scrollbars = (argc > 4) ? arguments[4] : 1;
	if (is_major >= 4)
	{
		x4 = 100;
		y4 = 80;
		window.open(winUrl, 'sym', 'height='+h+',width='+w+',scrollbars='+scrollbars+',resizable=0,menubar=0,toolbar0,status=0,location=0,directories=0,left=' + x4 + ',top=' + y4 + '');
		if(returnVal) {
			return false;
		}
	}
	else
	{
		window.open(winUrl, 'sym', 'height='+h+',width='+w+',scrollbars='+scrollbars+',resizable=0,menubar=0,toolbar=0,status=0,location=0,directories=0,left=150,top=80');
		sym.focus;
		if(returnVal) {
			return false;
		}
	}
}

// Copyright Date
function GetThisYear() {
 var CurDate = new Date();
 var ThisYear = CurDate.getYear();
 document.write(ThisYear);
 }
