/* **********************************************************************************************
*************************************************************************************************
											       **
Author = 		ICS Web Development - www.users.hunterlink.net.au/~ddwkl/introcom/     ** 	
Email =	 	     	Introcom@hunterlink.net.au					       **	
Created =		 								       **	
Page =		 									       **	
Last Updated =	 									       **
Copyright 		ICS 2001							       **	
											       **	
*************************************************************************************************
********************************************************************************************** */





  
var wait = 120 		//sleep time until next letter (milliseconds)
var message = new Array()
message[0] = "Welcome to DW & AR McNeice..."
message[1] = "Dedicated to Enhancing & Protecting your Wealth... "
message[2] = "Specialists in Finacial & Insurance Planning... "
message[3] = "Investment Strategies Tailored to your Individual Needs... "



var msgs = 3 		//Number of message (0 is first)

var temp = ""		//Do not modify these... (recommended)
var curmsg = 0
var a = 0
var counter = 0

function typew()
{
a = a + 1
check()
window.status = message[curmsg].substring(0, a)
if(a == message[curmsg].length + 5)
{
curmsg = curmsg + 1
a = 0
}
if(curmsg > msgs)
{
curmsg = 0 }
counter = setTimeout("typew()", wait)
}
function check()
{
if(a <= message[curmsg].length)
{
if(message[curmsg].substring(a, a + 1) == "")
{
a = a + 1
check()
}
}
}
// typew(); 




  
  
  
  // Time & Date Functions
  // ***********************************************************************************
  // Function to display current Date : day/date/month/year
   
  function Current()
   {
     
   var current = new Date();
   
   var day = current.getDay();
   var month = current.getMonth();
   var year = current.getYear();
   var date = current.getDate();
  
   
   // Set day of week to a String
   
   if(day == 0)
   day = "Sunday";
   
   else if(day == 1)
   day = "Monday";
   
   else if(day == 2)
   day = "Tuesday";
   
   else if(day == 3)
   day = "Wednesday";
   
   else if(day == 4)
   day = "Thursday";
   
   else if(day == 5)
   day = "Friday";
   
   else if(day == 6)
   day = "Saturday";
   
   
   
   // Set month to a String
   
   if(month == 0)
   month = "January";
   
   
   else if(month == 1)
   month = "Febuary";
   
   else if(month == 2)
   month = "March";
   
   else if(month == 3)
   month = "April";
   
   else if(month == 4)
   month = "May";
   
   else if(month == 5)
   month = "June";
   
   else if(month == 6)
   month = "July";
   
   else if(month == 7)
   month = "August";
   
   else if(month == 8)
   month = "September";
   
   else if(month == 9)
   month = "October";
   
   else if(month == 10)
   month = "November";
   
   else if(month == 11)
   month = "December";
   
 
	
   // Output current Date   
   
   document.writeln("<FONT SIZE=\"2\" COLOR=\"#000000\">" + day + " " + " "+ date + " " + month + " " + year + "</FONT>" );   
       
   }
  
  
  // ***********************************************************************************
  // Function to create a Clock 
  
  
  
   function Clock()
    {
          var time = new Date()
          var hour = time.getHours()
          var minute = time.getMinutes()
          var second = time.getSeconds()
          var temp = "" + ((hour > 12) ? hour - 12 : hour)
          temp += ((minute < 10) ? ":0" : ":") + minute
          temp += ((second < 10) ? ":0" : ":") + second
          temp += (hour >= 12) ? " P.M." : " A.M."
          document.clockForm.digits.value = temp
          id = setTimeout("Clock()",1000)
    } 
  
    //    <FORM NAME="clockForm">
    //    <INPUT TYPE="text" NAME="digits" SIZE=12 VALUE="">
    //    </FORM>




// ******************************************************************************************
// Page lock (no right click access)

function lock(e) 
  {
  if (navigator.appName == 'Netscape' &&
  (e.which == 3 || e.which == 2))
  {
    alert("Sorry this page contains Copyrighted material. \n Please Email a request.");
    return false;
  }
  
  else if (navigator.appName == 'Microsoft Internet Explorer' &&
  (event.button == 2 || event.button == 3)) 
  {
    alert("Sorry this page contains Copyrighted material. \n Please Email a request.");
    return false;
  }
  return true;
  }

/*
document.onmousedown=lock;
document.onmouseup=lock;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=lock;
window.onmouseup=lock;
*/



// ****************************************************

// ******************************************************************************************
// Popup Window (takes URL, TITLE, WIDTH, HEIGHT and SCROLLABLE as variable inputs)


function Popup(var_url, var_title, var_width, var_height, scroll) 
  {
 
  	var_string_options = "\"toolbar=no,status=no,menubar=no,location=no,directories=no,scrollbars="+scroll+",width=" + var_width + ",height=" + var_height + "\"" ;
  	
  	window.open(var_url, var_title, var_string_options);

  	
  	
  }
 

function popup(popupfile,winwidth,winheight)
{
open(popupfile,"PopupWindow","resizable=no,width=" + winwidth + ",height=" + winheight + ",scrollbars=yes");
}
 
  
// ****************************************************
// Function to handle the dropdown selection boxes
// must change TARGET in this function

// onChange="javascript:Selector('myform','myselect')"
	
	function Selector(whichform,whichselector)
  	{
  	  
  	  var index= eval("document." + whichform + "." + whichselector + ".selectedIndex");
  	  var url = eval("document." + whichform + "." + whichselector + ".options[index].value");
  	  top.mainframe.location.href = url;
  	
	}



// ****************************************************
// Function to change status and default status
// must change welcome Message

//  onMouseOver="setStatus('BLAH'); return true" 

	function setStatus(message)
	{
		window.defaultStatus = "Welcome to ???????????"
		window.status = message;
	}	
	
	

// ****************************************************
// Error message


	
function error(mystring)
{
alert(mystring);
} 	



// ****************************************************
// Change picture function
// Used for holliday banner


	
function rotate()
{
	var gif_array = new Array(6);
	gif_array[0] = "hol_welcome2.gif";
	gif_array[1] = "hol_newyear.gif";
	gif_array[2] = "hol_xmas.gif";
	gif_array[3] = "hol_anzac.gif";
	gif_array[4] = "hol_val.gif";
	gif_array[5] = "hol_easter.gif";
	gif_array[6] = "hol_ausday.gif";
	
	
	
	var alt_array = new Array(6);
	alt_array[0] = "Welcome to ADCS";
	alt_array[1] = "Happy New Year";
	alt_array[2] = "Merry Christmas";
	alt_array[3] = "Lest We Forget";
	alt_array[4] = "Happy Valentinze Day";
	alt_array[5] = "Happy Easter";
	alt_array[6] = "Happy Australia Day";
	
	
	
	var today = new Date();
	var month = today.getMonth();
	var day = today.getDate();
	var temp = null;
	var yr = today.getFullYear();
	
	
	var dminus = null;
    	var dplus = null;
    	var d = null;
    	var m = null;
    	
    	
	
	if(yr == 2003)
	{
	d = 20;
	m = 3;
	dminus = d - 4;
        dplus = d + 4;
	}
	else if(yr == 2004)
	{
	d = 11;
	m = 3;
	dminus = d - 4;
        dplus = d + 4;	

	}
	else if(yr == 2005)
	{
	d = 27;
	m = 2;
	dminus = d - 4;
        dplus = d + 4;			
	}
	else if(yr == 2006)
	{
	d = 16;
	m = 3;
	dminus = d - 4;
        dplus = d + 4;		
	}
	else if(yr == 2007)
	{
	d =  8;
	m = 3;
	dminus = d - 4;
        dplus = d + 4;	
	}	
	else
	{
	m = null;
	}

	
	
	
	if (month == 0 && ( day >=1 && day <= 5))
	{
	temp = 1;
	}
	else if (month == 11 && (day >=15 && day <= 30))
	{
	temp = 2;	
	}	
	else if (month == 3 && ( day >=24 && day <= 26))
	{
	temp = 3;
	}
  	else if (month == 0 && ( day >=25 && day <= 27))
  	{
  	temp = 6;
	}
	else if (month == 1 && ( day >=13 && day <= 15))
  	{
  	temp = 4;
	}
	else if (month == m && ( day >= dminus && day <= dplus))
	{
  	temp = 5;
  	}
  	else
  	{
  	temp = 0; 
  	}
  	
  	
  	
  	var pic = gif_array[temp];
  	var tex = alt_array[temp];


        document.write("<IMG SRC=\" ");
        document.write(pic);
        document.write(" \" BORDER=\"0\" HEIGHT=\"60\" WIDTH=\"468\" ALT=\"" + tex + "\">");
      
 } 