<!--

// MACROMEDIA FUNCTIONS
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.0
  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 && document.getElementById) x=document.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];}
}

function MM_showHideLayers() { //v3.0A Modified for NN6 Compatibility
	var i,p,v,obj,args=MM_showHideLayers.arguments;
	if (document.getElementById) {
		for (i=0; i<(args.length-2); i+=3) { 
			obj=tmt_findObj(args[i]);v=args[i+2];
   			v=(v=='show')?'visible':(v='hide')?'hidden':v;
	   		if (obj) {
				obj.style.visibility=v;
				if (args[i+1]!='') obj.style.left=args[i+1];
			}
		}
	} else {
		for (i=0; i<(args.length-2); i+=3)
		  	if ((obj=MM_findObj(args[i]))!=null) { 
				v=args[i+2];
    			if (obj.style) { 
					obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; 
				}
    	obj.visibility=v; 
		}
	}
}

function tmt_findObj(n){
	var x,t; if((n.indexOf("?"))>0&&parent.frames.length){t=n.split("?");
	x=eval("parent.frames['"+t[1]+"'].document.getElementById('"+t[0]+"')");
	}else{x=document.getElementById(n)}return x;
}

function MM_openLink(theURL) {
  window.location.href=theURL
}

//
/* ======================================================================
FUNCTION: 	showDate

VERSION:		0.9

AUTHOR:			Levent N. Nevzat | email: levent@.nevzat.co.uk | website: www.nevzat.co.uk

INPUT:			mydatDate (date) : any valid date

						mystrDateTime (string) : containing details below
          
            w    = abbreviated weekday (e.g. Mon)
            ww   = weekday (e.g. Monday)
            d    = day of the month (e.g. 1)
            dd   = 2-digit day of the month (e.g. 01)
						ddd  = long day of the month (e.g. 1st)
						m    = month of the year (e.g. 1)
						mm   = 2-digit month of the year (e.g. 01)
						mmm  = abbreviated month name (e.g. Jan)
						mmmm = month name (e.g. January)
						yy   = 2-digit year (e.g. 01)
						yyyy = 4-digit year (e.g. 2001)
						
RETURNS:		Converts a date into a specific format of your choice

EXAMPLE:		showDate(date, 'ww ddd mmmm yyyy') equals 'Monday 1st January 2001'

PLATFORMS:	Netscape Navigator 4.0 and higher,
			  		Microsoft Internet Explorer 4.0 and higher,

DESC:							
====================================================================== */

function showDate(mydatDate, mystrDate) {
	// Set the variables
	var astrTypesOfDate = ['w', 'ww', 'd', 'dd', 'ddd', 'm', 'mm', 'mmm', 'mmmm', 'yy', 'yyyy']
	var mydatdt = mydatDate;  // Date to be converted
	var newdt = '';
	var myblnIsPrevExactPartMatch = false;
	var myblnIsPrevSubstrPartMatch = false;
	var myblnIsExactPartMatch = false;
	var myblnIsSubstrPartMatch = false;
	var mystrStart = 0
	var mystrEnd = 0
	var mystrPart = '';
	var mystrToAdd = '';
	var myblnIsAdded = false;

	
	for (count=1; count < mystrDate.length+1; count++) {	// loops through each character in the date string
		myblnIsAdded = false;
		mystrEnd = count	// shows the cursor position within the date string
		mystrPart = mystrDate.slice(mystrStart, mystrEnd);	// identifies the string part to analyse
		myblnIsPrevExactPartMatch = myblnIsExactPartMatch;	// identifies whether the previous string part was an exact or partial match
		myblnIsPrevSubstrPartMatch = myblnIsSubstrPartMatch;

		for (i=0; i < astrTypesOfDate.length; i++) {	// loops through the date types for exact match of string part
			if (mystrPart == astrTypesOfDate[i]) {
				myblnIsExactPartMatch = true;
				break;
			}
			else {
				myblnIsExactPartMatch = false;
			}
		}
		
		for (i=0; i < astrTypesOfDate.length; i++) {	// loops through the date types for partial match of string part
			mystrTemp = astrTypesOfDate[i];
			if (mystrPart == astrTypesOfDate[i].substr(0, mystrPart.length)) {
				myblnIsSubstrPartMatch = true;
				break;
			}
			else {
				myblnIsSubstrPartMatch = false;
			}
		}

		if (myblnIsExactPartMatch == false && myblnIsSubstrPartMatch == false) {	// check for exact or partial match
			if ((myblnIsPrevExactPartMatch == false && myblnIsPrevSubstrPartMatch == false) || mystrEnd == mystrDate.length) {	// check for exact or partial match or end of date string
				newdt = newdt + mystrPart;	// add string part to the mew date string
				myblnIsAdded = true;
				mystrStart = mystrEnd;	// reset the start point within the date string
			}
			else if (myblnIsPrevExactPartMatch == false && myblnIsPrevSubstrPartMatch == true){	// check for previous partial match
				mystrTempPart = mystrPart;
				for (z=mystrTempPart.length; z>0; z--) {	// loop back through the string part
					for (y=0; y < astrTypesOfDate.length; y++) {	// find the largest date type and add the rest of the string part
						if (mystrTempPart.slice(0, z) == astrTypesOfDate[y]) {
							mystrToAdd = convertDate(mydatdt, mystrTempPart.slice(0, z)) + mystrTempPart.slice(z, mystrTempPart.length);
							newdt = newdt + mystrToAdd;
							myblnIsAdded = true;
							mystrStart = mystrEnd;
							break;
						}
					}
				}
			}
			else {	// check for match, convert date type, add to new date string
				newdt = newdt + convertDate(mydatdt, mystrPart.slice(0, mystrPart.length-1)) + mystrPart.slice(mystrPart.length-1, mystrPart.length);
				myblnIsAdded = true;
				mystrStart = mystrEnd;
			}
		}
		else if (myblnIsExactPartMatch == true && myblnIsSubstrPartMatch == true && mystrEnd == mystrDate.length) {	// check for exact match and end of date string, convert and add to new date string
			newdt = newdt + convertDate(mydatdt, mystrPart.slice(0, mystrPart.length));
			myblnIsAdded = true;
			mystrStart = mystrEnd;
		}
		else if (myblnIsExactPartMatch == false && myblnIsSubstrPartMatch == true && mystrEnd == mystrDate.length) {	// check for partial match, find longest match, and add match and remainder
			mystrTempPart = mystrPart;
			for (z=mystrTempPart.length; z>0; z--) {
				for (y=0; y < astrTypesOfDate.length; y++) {
					if (mystrTempPart.slice(0, z) == astrTypesOfDate[y]) {
						mystrToAdd = convertDate(mydatdt, mystrTempPart.slice(0, z)) + mystrTempPart.slice(z, mystrTempPart.length);
						newdt = newdt + mystrToAdd;
						myblnIsAdded = true;
						mystrStart = mystrEnd;
						break;
					}
				}
			}
			if (myblnIsAdded == false) {	// if no match, add all the remaining string part
				newdt = newdt + mystrTempPart;
			}
		}
	}

	mystrdt = newdt;
	document.write (mystrdt);
}



// -----------------------------------------------------------------------

function convertDate(mydatDate, mystrTypeOfDate) {
	// Set the variables
	var dt = mydatDate;  // Date to be converted
	var y = '';   // Year to be displayed
	var m = '';   // Month to be displayed
	var d = '';   // Day to be displayed
	var w = '';   // Weekday to be displayed

	switch (mystrTypeOfDate) {
		case 'yyyy':	// Convert the year
			y = dt.getYear();
			if (y < 2000) y += 1900; // complient w/ netscape & iexplorer
			break;
		case 'yy':
			y = dt.getYear();
			if (y < 2000) y += 1900;
			y = y.toString();
			y = y.substring(2,4);	// use the last 2 characters
			break;
		case 'm':
			m = dt.getMonth() +1;
			break;
		case 'mm':
			m = dt.getMonth() +1;
			if (m < 10) m = '0' + m;	// convert to 2-digits
			break;
		case 'mmm':
			m = dt.getMonth() +1;
      switch (m) {	// convert month no. to short month name
				case 1:  m = 'Jan'; break;
				case 2:  m = 'Feb'; break;
				case 3:  m = 'Mar'; break;
				case 4:  m = 'Apr'; break;
				case 5:  m = 'May'; break;
				case 6:  m = 'Jun'; break;
				case 7:  m = 'Jul'; break;
				case 8:  m = 'Aug'; break;
				case 9:  m = 'Sep'; break;
				case 10: m = 'Oct'; break;
				case 11: m = 'Nov'; break;
				case 12: m = 'Dec'; break;
      }
			break;
		case 'mmmm':
			m = dt.getMonth() +1;
      switch (m) {	// convert month no. to month name
				case 1:  m = 'January'; break;
				case 2:  m = 'February'; break;
				case 3:  m = 'March'; break;
				case 4:  m = 'April'; break;
				case 5:  m = 'May'; break;
				case 6:  m = 'June'; break;
				case 7:  m = 'July'; break;
				case 8:  m = 'August'; break;
				case 9:  m = 'September'; break;
				case 10: m = 'October'; break;
				case 11: m = 'November'; break;
				case 12: m = 'December'; break;
      }
			break;
		case 'd':
			d = dt.getDate();
			break;
		case 'dd':
			d = dt.getDate();
			if (d < 10) d = '0' + d; // convert day of month no to 2-digits
			break;
		case 'ddd':
			d = dt.getDate();	// adds correct ending to day of month no
      if ((d==1) || (d==21) || (d==31)) {d += 'st'}
			else if ((d==2) || (d==22)) {d += 'nd'}
			else if ((d==3) || (d==23)) {d += 'rd'}
			else {d += 'th'}
			break;
		case 'w':
			w = dt.getDay();
			switch (w) { // show day of week in short format
				case 0: w = 'Sun'; break;
				case 1: w = 'Mon'; break;
				case 2: w = 'Tue'; break;
				case 3: w = 'Wed'; break;
				case 4: w = 'Thu'; break;
				case 5: w = 'Fri'; break;
				case 6: w = 'Sat'; break;
			}
			break;
		case 'ww':
			w = dt.getDay();
			switch (w) { // show day of week
				case 0: w = 'Sunday'; break;
				case 1: w = 'Monday'; break;
				case 2: w = 'Tuesday'; break;
				case 3: w = 'Wednesday'; break;
				case 4: w = 'Thursday'; break;
				case 5: w = 'Friday'; break;
				case 6: w = 'Saturday'; break;
			}
			break;
	}

	dt = y + m + d + w;
	return dt;
}







//-->
