window.onload = SID_Code_startup;
SID_Code = 'sid'; 

// loops through forms and links and adds sub-id
function SID_Code_startup() 
{
	if (typeof( window[ 'SID_Code' ] ) != 'undefined') {
		
		// links
		for (i=0; i<document.links.length; i++) 
		{
			if (document.links[i].className != 'ignore') 
			{
				if (((document.links[i].href).indexOf("javascript:")) == -1) 
				{
					document.links[i].href = MakeSubID(document.links[i].href, SID_Code);
				}
			}
		}
		
		// forms
		for (i=0; i<document.forms.length; i++) 
		{
			document.forms[i].action = MakeSubID(document.forms[i].action, SID_Code);
		}
		
	}
}

// add sub-id to urls *correctly*
function MakeSubID(target_url, track_name) 
{ 
	var split = target_url.split("?"); 
	
	track_add = (split.length>1) ? '&' : '?';
	track_add = target_url+track_add+track_name+'=';
	
	var query = window.parent.location.search.substring(1); 
	var vars = query.split("&"); 
	for (var i=0;i<vars.length;i++) 
	{ 
		var pair = vars[i].split("="); 
		if (pair[0] == track_name) { track_add = track_add + pair[1]; } 
	}
	
	target_url = track_add;
	
	return target_url;
}


// Legacy function
function AddSubID(link, name) 
{ 
	link.href = MakeSubID(link.href, name);
}

// Bookmark site
function bookmark(url, sitename)
{
  ns="Netscape and FireFox users, use CTRL+D to bookmark this site."
  if ((navigator.appName=='Microsoft Internet Explorer') &&
    (parseInt(navigator.appVersion)>=4))
  {
    window.external.AddFavorite(url, sitename);
  }
  else if (navigator.appName=='Netscape')
  {
    alert(ns);
  }
}

function ShowDate()
{
	<!--
	// ==============================================
	// Copyright 2003 by jsCode.com
	// Source: jsCode.com
	// Author: etLux
	// Free for all; but please leave in the header.
	// ==============================================
	
	// Set the font color, face, size, and style...
	
	// Acceptable TheFontFace values are those you
	// normally use in HTML, for instance:
	//     Arial
	//     TimesRoman
	//     Courier
	
	// Acceptable TheFontColor values are any #RRGGBB
	// same as HTML. Remember to use the # sign and
	// enclose in quotes.  Typical values:
	//     #FF0000 is red
	//     #00FF00 is green
	//     #0000FF is blue
	
	// Acceptable TheFontSize values are 2-7.
	
	// Acceptable TheFontStyle values are (exactly!):
	//     plain
	//     bold
	//     italic
	//     bolditalic
	
	var TheFontFace  = "Ariel";
	var TheFontColor = "#000000";
	var TheFontSize  = "2";
	var TheFontStyle = "plain"; 
	
	// Set the separator between the date elements;
	// usually use either - or /.
	
	var TheSeparator = "/";
	
	// Show or do not show the day of the week; set
	// yes to show, no not to show.
	
	var ShowDay ="no";
	
	// Do Not Edit Below This Line
	// ==============================================
	
	var Days = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
	var TheDate = new Date();
	
	var TheWeekDay = TheDate.getDay();
	var Day ="";
	if (ShowDay == "yes"){
		Day = Days[TheWeekDay];
		Day += " ";}
	
	var TheMonth = TheDate.getMonth() + 1;
	if (TheMonth < 10) TheMonth = "0" + TheMonth;
	
	var TheMonthDay = TheDate.getDate();
	if (TheMonthDay < 10) TheMonthDay = "0" + TheMonthDay;
	
	var TheYear = TheDate.getYear();
	if (TheYear < 1000) TheYear += 1900;
	
	var FontTagLeft  = "";
	var FontTagRight = "";
	
	if (TheFontStyle == "bold"){
		FontTagLeft = "<b>";
		FontTagRight ="</b>";}
		
	if (TheFontStyle == "italic"){
		FontTagLeft = "<i>";
		FontTagRight ="</i>";}
		
	if (TheFontStyle == "bolditalic"){
		FontTagLeft = "<b><i>"; 
		FontTagRight = "</i></b>";}    
	
	var D = "";
	//D += "<font color='"+TheFontColor+"' face='"+TheFontFace+"' size='"+TheFontSize+"'>";
	D += FontTagLeft+Day+TheMonth+TheSeparator+TheMonthDay+TheSeparator+TheYear+FontTagRight;
	//D += "</font>";
	
	document.write(D);
}

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_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_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.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];}
}