/*
 *  	JavaScrip Web Functions
 *  	For www.natsoft.biz
 *	By Jay Fraser	
 *	Last Updated: October 2003
 *	File name: natsoft.js
 */

function popOutPHOTO(url,target,mh,w)
{
var h;
if (screen.availWidth < '800') {h=440;}  
else if (screen.availWidth == '800') {h=550;} 
else if (screen.availWidth > '800') {h=650;}
else {h=400;}
if (mh!='') if (h>mh) h=mh;

popout = window.open('','popout','scrollbars=yes,directories=no,location=no,status=no,toolbar=no,resizable=yes,height=' + h + ',width=' + w +'');	
ndoc=popout.document;
str = "<HTML><HEAD><TITLE>Brandon Lee Photography | "+url+"</TITLE>";
str += "<LINK REL=\"stylesheet\" HREF=\"blee.css\" TYPE=\"TEXT/CSS\">";
str += "</HEAD><BODY BGCOLOR=\"#222222\" TEXT=\"#ffffff\">";
str += "<CENTER><A HREF=\"#\" ONCLICK=\"window.close()\"><IMG CLASS=\"photo\" SRC=\""+url+"\" ALT=\""+url+"\"></A></CENTER>";
str += "<BR><FORM><CENTER>";
str += "<INPUT TYPE=\"button\" VALUE=\"Close Window\" ONCLICK=\"window.close()\">";
str += "</FORM></CENTER></BODY></HTML>";
ndoc.write(str);
ndoc.close;
self.aNoteWin = popout;

}

function popOutMH(url,target,mh,w)
{
var h;
if (screen.availWidth < '800') {h=400;}  //script not used here
else if (screen.availWidth == '800') {h=500;} //modify to requirements
else if (screen.availWidth > '800') {h=650;}
else {h=400;}
if (mh!='') if (h>mh) h=mh;

window.open(url,target,'scrollbars=yes,directories=no,location=no,status=no,toolbar=no,resizable=yes,height=' + h + ',width=' + w +'');	
}


function messageOn(menuId,opt)
{
var message;
if (opt=="Profile") {message = "View the Natsoft Company Profile.";}
if (opt=="News") {message = "Back to the the latest news.";}
if (opt=="Services") {message = "Find out how Natsoft can help you.";}
if (opt=="Contact") {message = "Contact Information & Methods.";}
if (opt=="Race Results") {message = "Visit our own race results archive.";}
if (opt=="Support") {message = "Various support topics and downloads.";}
	
	if (document.all)
		{
			document.all(menuId).style.visibility = "visible";
			x=document.all.message;
			x.innerHTML = message;	
		}
	if (document.getElementById)
		{
			x = document.getElementById(menuId);
			x.style.visibility = 'visible';
			x.innerHTML = message;	
		
		}
}


function messageOff(menuId)
{
	if (document.all)
		{
			document.all(menuId).style.visibility = "hidden";
		}

	if (document.getElementById)
		{
			x = document.getElementById(menuId);
			x.style.visibility = 'hidden';}
}

function menuOn(menuId)
{
	if (document.all)
		{
			document.all(menuId).style.visibility = "visible";
		}
	if (document.getElementById)
		{
			x = document.getElementById(menuId);
				x.style.visibility = 'visible';
		
		}
}


function menuOff(menuId)
{
	if (document.all)
		{
			document.all(menuId).style.visibility = "hidden";
		}

	if (document.getElementById)
		{
			x = document.getElementById(menuId);
				x.style.visibility = 'hidden';}
		
}


function sizeGallery()
{
if (screen.availWidth < '800') {h=300;}  //script not used here
else if (screen.availWidth == '800') {h=350;} //modify to requirements
else if (screen.availWidth > '800') {h=400;}
document.write('<DIV STYLE="margin-left:3pt;margin-top:3pt;height:'+h+';width:175;overflow:auto;border:1px solid #000000">');
}

function sizeNews()
{
if (screen.availWidth < '800') {h=300;}  //script not used here
else if (screen.availWidth == '800') {h=300;} //modify to requirements
else if (screen.availWidth > '800') {h=300;}
document.write('<DIV STYLE="margin-left:3pt;margin-top:3pt;height:'+h+';width:350;overflow:auto;border: 2px solid #003399">');
}

function printDate()
{
var greet,gm,ga,ge,time,date,month,day,now,year,dateEnd;
now=new Date();
year=now.getYear()
if (year < 199) {year += 1900;}
day=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
month=new Array("January","February","March","April","May","June","July","August","September","October","November","December");

if (now.getDate()==1 || now.getDate()==21 || now.getDate()==31) 
		{dateEnd="st";}
else if (now.getDate()==2 || now.getDate()==22) 
		{dateEnd="nd";}
else if (now.getDate()==3 || now.getDate()==23) 
		{dateEnd="rd";}
else {dateEnd="th";}


time=now.getHours(); 
if ((time <= 0) && (time>= 19)) {greet="Good Evening";}
if ((time <= 13) && (time>= 1)) {greet="Good Morning";}
if ((time <= 18) && (time>= 13)) {greet="Good Afternoon";}

day="<nobr>" + day[now.getDay()] + "</nobr>";
date="<nobr>" + month[now.getMonth()] +" " + now.getDate() + "" + dateEnd + "</nobr>";
document.write(''+day+'');
document.write('<BR>');
document.write(''+date+' '+year+'');
}



function tassatLink()
{
var url="http://www.natsoft.com.au/tassat/index.html"
document.write('<A HREF="'+url+'" TARGET="_blank"');
document.write(' ALT=" Visit Climbing Tasmania">');
}

function closeWindowButton()
{
document.write("<FORM>");
document.write("<INPUT TYPE=BUTTON VALUE=Close onClick=window.close();>");
document.write("</FORM>");
}
