// Copyright 2001 Web Emerse LLC, Version: 1.2 	12/06/2001

//------------------- DREAMWEAVER  -----------------------------------------------------------
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

MM_reloadPage(true);

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_setTextOfLayer(objName,x,newText) { //v3.0
  if ((obj=MM_findObj(objName))!=null) with (obj)
    if (navigator.appName=='Netscape') {}
    else innerHTML = unescape(newText);
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//-------------------- Other -----------------------------------------------------------

//Applies a given watermark to the page
function waterMark(theImageURL)
{
	if (document.all||document.getElementById)
		document.body.style.background="url('" + theImageURL + "') white center no-repeat fixed";		
}

//Constructs a simple array
function makeArray()
{
  for (i = 0; i<makeArray.arguments.length; i++)
    this[i + 1] = makeArray.arguments[i];
}

//Displays the date for the main page
function displayDate()
{
	d = new Date();
	
	var days = new makeArray('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
  var months = new makeArray('January','February','March','April','May','June','July','August','September','October','November','December');
	
	dateText = days[d.getDay() + 1] + " " + months[d.getMonth() + 1] + " " + d.getDate() + ", " + d.getFullYear();
	
	minuteValue = d.getMinutes();
	if (minuteValue < 10)
	    minuteValue = "0" + minuteValue
	hourValue = d.getHours();
	if (hourValue < 12)
	{
	    greeting = "Good Morning!";
	    timeText = " at " + hourValue + ":" + minuteValue + " AM";
	}
	else if (hourValue == 12)
	{
	    greeting = "Good Afternoon!";
	    timeText = " at " + hourValue + ":" + minuteValue + " PM";
	}
	else if (hourValue < 17)
	{
	    greeting = "Good Afternoon!";
	    timeText = " at " + (hourValue-12) + ":" + minuteValue + " PM";
	}
	else
	{
	    greeting = "Good Evening!";
	    timeText = " at " + (hourValue-12) + ":" + minuteValue + " PM";
	}
	document.open();
	document.write(greeting + " It's " + dateText);	
	document.write("");
}

//Opens a centered window
var centeredWindow = null;
function OpenCenteredWindow(mypage,myname,w,h,scroll)
{
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable';
	centeredWindow = window.open(mypage,myname,settings);
}

//Initialize the Site Maps First Intro
var flashIntro = null;
function initializeSiteMapFirstIntro()
{
	widthmargins = 50;
	heightmargins = 100;
	w = screen.width;
	h = screen.height;
	if(w > 640 + widthmargins)
		w = screen.width - widthmargins;
	if(h > 480)
		h = screen.height - heightmargins;

	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	
	top.window.moveTo(LeftPosition, TopPosition);
	if (document.all) 
	{
		top.window.resizeTo(w,h);
	}
	else if (document.layers||document.getElementById) 
	{
		top.window.outerHeight = h;
		top.window.outerWidth = w;
	}	
	
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,resizable=yes,toolbar=no';
	centeredWindow = window.open("http://www.web-emerse.com/flashpage.htm","flashpage",settings);	
}

//Maximizes a the window
function Maximize()
{
	top.window.moveTo(0,0);
	if (document.all) 
	{
		top.window.resizeTo(screen.availWidth,screen.availHeight);
	}
	else if (document.layers||document.getElementById) 
	{
		if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth)
		{
			top.window.outerHeight = screen.availHeight;
			top.window.outerWidth = screen.availWidth;
		}
	}
}


//Breaks our website out of being wrapped within another!
if (window!= top)
top.location.href=location.href



