/* author: Tom McElhinney 

 Creation date: 11/08/2002 */

<!-- Hide script from old browsers
	document.WM = new Object();
	document.WM.menu = new Object();
	document.WM.menu.dropdown = new Array();
function WM_initializeToolbar()
{ 
    var i;
    if (document.all)
    {
	for(i = 0; i < document.all('container').all.length; i++)
		{
	    if ((document.all('container').all[i].className == 'header') ||
		    (document.all('container').all[i].className == 'links'))
		    {
			document.WM.menu.dropdown[document.WM.menu.dropdown.length]
			= document.all('container').all[i];
			}
		}
    } 
    else if (document.getElementsByTagName && document.getElementById)
    {
		var contained =
		document.getElementById('container').getElementsByTagName('div');
		for(i = 0; i < contained.length; i++)
		{
			if ((contained[i].getAttribute('class') == 'header') ||
				(contained[i].getAttribute('class') == 'links'))
				{
				document.WM.menu.dropdown[document.WM.menu.dropdown.length]
				= contained[i];
				}
		}
    }
}
function WM_collapse(item, button)
{	
    if(document.WM.menu.dropdown.length){
		if (document.WM.menu.dropdown[item + 1].style.display == 'none')
		{	
			document.WM.menu.dropdown[item + 1].style.display = '';
			document.images[document.WM.menu.dropdown[item].id + 'Img'].src = '../images/open.gif';

		} 
		else 
		{	
			document.WM.menu.dropdown[item + 1].style.display = 'none';
	    	document.images[document.WM.menu.dropdown[item].id + 'Img'].src = '../images/closed.gif';
		}
	}
    switch (button)
		{
		case 'Home':
		///		window.top.GeneralData.location =  "../ContentFiles/ChristmasParty.htm";
		///		window.top.GeneralData.location =  "../ContentFiles/EndOfSeason.htm";
				window.top.GeneralData.location =  "../ContentFiles/welcome.htm";
				break;
		case 'Schedule':
			window.top.GeneralData.location =  "http://65.182.102.102/wicklowsac/AspFiles/DiveSchedule.asp";
				break;
		case 'CFT Club Links':
			window.top.GeneralData.location =  "../Asp%20Files/Links.asp?Type=CFT";
				break;
		case 'BSAC Club Links':
			window.top.GeneralData.location =  "../Asp%20Files/Links.asp?Type=BSAC";
				break;
		default:
		break;
		}
}
function WM_imageSwap(daImage, daSrc)
{
	var objStr,obj;
	if(document.images)
	{
    // Check to see whether you are using a name, number, or object
		if (typeof(daImage) == 'string') 
		{
		// This whole objStr nonesense is here solely to gain compatability
		// with ie3 for the mac.
		objStr = 'document.' + daImage;
		obj = eval(objStr);
		obj.src = daSrc;
		} 
		else if ((typeof(daImage) == 'object') && daImage && daImage.src) 
		{
		daImage.src = daSrc;
		}
	}
}
var user;
var domain;
var suffix;
var title
function jemail(user, domain, suffix, title)
	{
	document.write('<a  href="' + 'mailto:' + user + '@' + domain + '.' + suffix + '">' + 
	               '<FONT face=Verdana,Arial,Helvetica color=navy size=1>' +
					title+'</a>');
	}
function j2email(user, domain, suffix)
	{
	document.write('<a  href="' + 'mailto:' + user + '@' + domain + '.' + suffix + '">' + 
	               '<FONT face=Verdana,Arial,Helvetica color=navy size=1>' );
	}

function mailobfuscator(coded, title)
{

		cipher = "aZbYcXdWeVfUgThSiRjQkPlOmNnMoLpKqJrIsHtGuFvEwDxCyBzA1234567890"
		shift=coded.length
		link=""
		for (i=0; i<coded.length; i++){
			if (cipher.indexOf(coded.charAt(i))==-1){
				ltr=coded.charAt(i)
				link+=(ltr)
			}
			else {     
				ltr = (cipher.indexOf(coded.charAt(i))-shift+cipher.length) % cipher.length
				link+=(cipher.charAt(ltr))
			}				
    }
			document.write("<a class=maillinks href='mailto:"+link+"?subject=email from Club Website'>" +title+ "</a>")

}


function checknew(updatenew, createdate, expiryperiod, suffix) {
var datecreated = new Date(createdate);
var curdate = new Date();
var pic = "new.gif";
if (((curdate.getDate()>= 1) && (curdate.getDate()<= 5)) && (updatenew == "Auto" || updatenew == "auto"))
	{
	var expirydate = new Date();
	expirydate.setDate(6);
	}
else
	if (updatenew == "Auto")
		{
		var expirydate = new Date(createdate);
		expirydate.setDate(datecreated.getDate());
		}    
	else
		{
		var expirydate = new Date(createdate);
		expirydate.setDate(expirydate.getDate() + expiryperiod);
		}
switch (updatenew)
{
case "Update":
case "update":
case "Auto":
case "auto":
	if (typeof(suffix) == "undefined")
		{
		pic = "../images/updated1.gif";
		}    
	else
		{
		pic = "../images/updated" + suffix + ".gif";
		}
	break;
case "New":
case "new":
	pic = "../images/new.gif";
	break;
case "":
   break;
default:
break;
}
if (expirydate > curdate) 
	{
	document.write("<img height = '15' width ='50'src=" + pic + 	">");
	}
}




function  Lastupdate(LastUpdated) {
  var modDate = new Date(LastUpdated)
  var modYear = modDate.getYear()
  var months= new Array("January", "Febraury", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
  var monthNow = months[modDate.getMonth()];
  if(modYear<1000) modYear+=1900
      
  document.write("<p class=date>Last updated on <br>" + modDate.getDate() + " " +
                                        monthNow + ", " +
                                        (modYear+"").substring(0,4)+ ".</P> ")

}

function  CopyrightYear() {
  var modDate = new Date()
  var modYear = modDate.getYear()
  var months= new Array("January", "Febraury", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
  var monthNow = months[modDate.getMonth()];
  if(modYear<1000) modYear+=1900
      
  document.write((modYear+"").substring(0,4)+ ".</P> ")

}

// End the hiding -->


