var isnMonths=new isnArray("January","February","March","April","May","June","July","August","September","October","November","December");
var isnDays= new isnArray("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");
isnDays[0]="Sunday";
today=new Date();
function isnArray() 
{
	argnr=isnArray.arguments.length

	for (var i=0;i<argnr;i++) 
	{
		this[i+1] = isnArray.arguments[i];
	}
}

function ShowDate()
{
	var TheYear = today.getYear();

	if (TheYear >= 100 && TheYear <= 1999)
	{
		TheYear=TheYear + 1900;
	}
	else
	{
		TheYear=TheYear;
	}
	document.write("<font class=10VB size=2 face=verdana,arial,helvetica color=#a0a0a0><b>" +isnDays[today.getDay()]+"<img src='mfeimage/dot.gif' hspace=2 height=1><br>"+isnMonths[today.getMonth()+1]+" "+today.getDate()+"<img src='pimage/dot.gif' hspace=2 height=1><br>"+TheYear+"<img src='pimage/dot.gif' hspace=2 height=1></b>");
}

function ShowCookie()
{
	readCookie();
}
function readCookie() 
{
	if (document.cookie == "") 
	{
		writeCookie();
        alertMessage();
	} 
	else 
	{
		var the_cookie = document.cookie;
		the_cookie = unescape(the_cookie);
		the_cookie_split = the_cookie.split(";");
		for (loop=0;loop<the_cookie_split.length;loop++) 
		{
			var part_of_split = the_cookie_split[loop];
			var find_name = part_of_split.indexOf("nfti_date")
			if (find_name!=-1) 
			{
				break;
			} // Close if
		} // Close for
		if (find_name==-1) 
		{
			writeCookie();
		} 
		else 
		{
			var date_split = part_of_split.split("=");
			var last = date_split[1];
			last=fixTheDate(last);
			document.write("<font class=9V size=2 face=verdana,arial,helvetica color=#000000><b>Welcome</b> Your last visit was on: "+last+"</font>");
			writeCookie();
		} // Close if (find_name==-1)
	}
} // Close function readCookie()


function writeCookie() 
{
	var today = new Date();
	var the_date = new Date("December 31, 2023");
	var the_cookie_date = the_date.toGMTString();
	var the_cookie = "nfti_date="+escape(today);
	var the_cookie = the_cookie + ";expires=" + the_cookie_date;
	document.cookie=the_cookie
}

function alertMessage()
{
	document.write("<font class=9V size=2 face=verdana,arial,helvetica color=#000000><b>Welcome</b> This is your first visit here.</font>");
}

function fixTheDate(date) 
{
	var split = date.split(" ");
	var fix_the_time = split[3].split(":")
	var hours = fix_the_time[0]
	if (hours>=12) 
	{
		var ampm="PM"
	} 
	else 
	{
		var ampm="AM"
	}
	if (hours > 12) 
	{
		hours = hours-12
	}
	var new_time = hours+":"+fix_the_time[1]+" "+ampm
	var new_date = split[0]+" "+split[1]+", "+split[2]+" at "+new_time+", "+split[5]
	return new_date;
}


var startopacity = 40; // Set this variable between 1 and 100 as the standard opacity

function fadeIt(obj,direct)
{ 
	if(window.timer) 
	{
		clearInterval(timer);
	} 
	tobj=obj; drct=direct; 
	timer=setInterval("flowfilter(tobj,drct);",5); 
}

function flowfilter(thing,dct)
{
	if(dct==1) 
	{ 
		if (thing.filters.alpha.opacity<100) 
		{ 
			thing.filters.alpha.opacity+=5; 
		} 
		else 
		{ 
			clearInterval(timer); 
		} 
	}
	if(dct==2) 
	{ 
		if (thing.filters.alpha.opacity>startopacity) 
		{ 
			thing.filters.alpha.opacity-=5; 
		} 
		else 
		{ 
			clearInterval(timer);
		}
	}
}


startday = new Date();
clockStart = startday.getTime();

function initStopwatch() 
{ 
	var myTime = new Date(); 
	var timeNow = myTime.getTime();  
	var timeDiff = timeNow - clockStart; 
	this.diffSecs = timeDiff/1000; 
	return(this.diffSecs); 
} 

function getSecs() 
{ 
	var mySecs = initStopwatch(); 
	var mySecs1 = ""+mySecs; 
	mySecs1= mySecs1.substring(0,mySecs1.indexOf(".")) + " secs.";
	window.setTimeout('getSecs()',1000); 
}

function gateKeeper() 
{
	var password = prompt("Password required:", "")
	var location=password + ".htm";
	this.location.href = location;
}

function makevisible(cur,which)
{
	if (which==0)
		cur.filters.alpha.opacity=100
	else
		cur.filters.alpha.opacity=80
}
function makevis(cur,which)
{
	if (which==0)
		cur.filters.alpha.opacity=100
	else
		cur.filters.alpha.opacity=90
}
function makevis50(cur,which)
{
	if (which==0)
		cur.filters.alpha.opacity=100
	else
		cur.filters.alpha.opacity=50
}

function fadeupdown(cur,which,what)
{
	if (which==0)
		cur.filters.alpha.opacity=what
	else
		cur.filters.alpha.opacity=what
}
function makeinvert(cur,which)
{
	if (which==0)
		cur.filters.invert.enabled=0
	else
		cur.filters.invert.enabled=1
}
function makeflipvert(cur,which)
{
	if (which==0)
		cur.filters.flipv.enabled=0
	else
		cur.filters.flipv.enabled=1
}
function PopupWindow(theurl,windowname,xsize,ysize,showscrollbars,isresieable) 
{
	// vars for browser detect
	var x = (document.layers) ? e.pageX : event.clientX
	var y = (document.layers) ? e.pageY : event.clientY
	var bName=navigator.appName;
	var bVer=parseInt(navigator.appVersion);
	// open the popup window. stick a timestamp to foil caching. Some versions of Netscape do not automatically load
    // the page specified by the URL paramter of wondow.open(). As such, we create the window empty, then explicitly load
	// the page with the location object
	var now = new Date();
	var popupURL = theurl;
	var popupName = windowname;
  	var justpopup = window.open("", popupName,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars='+showscrollbars+',resizable='+isresieable+',width='+xsize+',height='+ysize);
	justpopup.location = popupURL;
}
var popup;

function PopupAndDown(theurl,windowname,xsize,ysize,showscrollbars,isresieable) 
{
	// vars for browser detect
	var x = (document.layers) ? e.pageX : event.clientX;
	var y = (document.layers) ? e.pageY : event.clientY;
	var bName=navigator.appName;
	var bVer=parseInt(navigator.appVersion);
	// open the popup window. stick a timestamp to foil caching. Some versions of Netscape do not automatically load
    // the page specified by the URL paramter of wondow.open(). As such, we create the window empty, then explicitly load
	// the page with the location object
	var now = new Date();
	var popupURL = theurl;
	var popupName = windowname;
  	popup = window.open(popupURL, popupName,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars='+showscrollbars+',resizable='+isresieable+',width='+xsize+',height='+ysize+' left='+x+' top='+y);
//	popup.location = popupURL;
}

function CloseIt()
{
	popup.close()
}

function right() 
{
	if (document.all &&	(event.button == 1)) 
	{
		setCone();
		return false;
	}
	return true;
}

xPos=10
a=5
cone="off"
function setCone()
{
	if (document.all)
	{
		if (cone=="off")
		{
			cone="on";
			xx=setInterval("moveCone()",31);
		}
		else 
			cone="off", clearInterval(xx)
	}
}
function moveCone () 
{
	if (cone=="on")
	{
		xPos+=a
		if (xPos==60)
		{
			a=a*(-1)
		}
		if (xPos==(10))
			a=a*(-1)
		mfeclickandbuy.filters.light.movelight(0,xPos,70,5,1);
	}
}

function setlight() 
{
	if (document.all)
	{
		mfeclickandbuy.filters.light.addcone(33,150,0,0,70,255,255,155,255,8)
	   	mfeclickandbuy.filters.light.addAmbient(255,255,255,128)
	}
}
