// 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
}

// Email Hiders
function MailBlankBox() {
    var name = "spotted";
    var host = "blank-box";
				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";
  }
 if (RightNow.getHours() >= 12 && RightNow.getHours() < 18){
  var phase = "afternoon";
  }
 if (RightNow.getHours() >= 18 && RightNow.getHours() < 24){
  var phase = "evening";
  }
 document.write(" Good " + phase + "!");
 }

// Add to Favorites
// The following block goes in the <body> section of the page
/* <script language="JavaScript"> <!-- hide script
if (document.all)
document.write('<a href="javascript:add2favs()">IE5+ - Bookmark this site</a>')
// --></script> */

function add2favs(){
 var favsite="http://www.blank-box.com"
 var favdesc="BlankBox Art"
 if (document.all)
  window.external.AddFavorite(favsite,favdesc)
 }

// Add to NS6 Sidebar
// The following block goes in the <body> section of the page
/* <a href="javascript:addNS6sidebar()">NS6 - Add to Sidebar</a> */
function addNS6sidebar() { 
 if (window.sidebar&&window.sidebar.addPanel)
  window.sidebar.addPanel("BlankBox Art","http://www.blank-box.com/","");
 else 
  alert("You need NS 6 to use this particular feature.")
 } 

// Verify form information

function NoBlanks(form) {
 if (form.contactname.value == "") {
  alert("Please enter your name.");
  form.contactname.focus();
  return (false);
  }
 if (form.email.value == "") {
  alert("Please enter an email address.");
  form.email.focus();
  return (false);
  }
 if (form.comments.value == "") {
  alert("Please fill in the body of the message.");
  form.comments.focus();
  return (false);
  }
 return (true);
 }
	
	function NoBlanksNotify(form) {
 if (form.email.value == "") {
  alert("Please enter an email address in the form field provided.");
  form.email.focus();
  return (false);
  }
 return (true);
 }

/* Open small window */
/* Pass the pagename to the function via the linkid variable in the anchor tag:
   i.e., <a href="javascript:OpenWin('somepage.html')">Apples</a> */
//function OpenWin(linkid) {
// NewWin=window.open (linkid,"newwin",config="width=400,height=450,location=no,status=no,directories=no,toolbar=no,scrollbars=no,menubar=no,resizable=no,top=30,left=30");
// NewWin.focus()
//}

function LoadUp() {
	document.form1.username.focus();
}

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);
}

