<!--
//******************************************************************************
//	Goldjobs Limited.
//	JavaScript Code Library.  Plastercine Limited.
//
//	Created:	Unknown
//	Author:		Plastercine Limited
//
//	Modified:	Munsifali Rashid, Plastercine Limited
//	Modified:	26 November 2001
//	Modified:	Added header information
//				Modified changeImage function slightly
//******************************************************************************
function toggle( strDivIdName ) {
	//alert('!' + strDivIdName + ' ' + document.getElementById( strDivIdName ) );
	if ( document.getElementById( strDivIdName ) ) {
		// turn off all the tab li a styles
		var hide 	= document.getElementById( strDivIdName ).style;
		var state	= hide.display;
		
		if (hide.display =="block"){
			hide.display = "none";
		} else {
			hide.display = "block";
		}
		return true;
	} else {
		return false;
	}
}


// Basic browser Check
var brVer	=	parseInt(navigator.appVersion);
var isIE	=	(navigator.appName == "Microsoft Internet Explorer");
var isIE4	=	(isIE && brVer >= 4)
var isNS	=	(navigator.appName == "Netscape");
var isNS6	=	(navigator.userAgent.indexOf("Gecko") > 0) ? 1 : 0;

// Function to get month name
// Munsifali Rashid.  Plastercine Limited. 28 October 2001.
function getMonthName()	{
	var monthNames		=	new Array();
		monthNames[1]	=	"January";
		monthNames[2]	=	"February";
		monthNames[3]	=	"March";
		monthNames[4]	=	"April";
		monthNames[5]	=	"May";
		monthNames[6]	=	"June";
		monthNames[7]	=	"July";
		monthNames[8]	=	"August";
		monthNames[9]	=	"September";
		monthNames[10]	=	"October";
		monthNames[11]	=	"November";
		monthNames[12]	=	"December";
	var oDate	=	new Date();
	var oMonth	=	oDate.getMonth()+1;
	return (monthNames[oMonth]);
}

// Change the URL using a select dropdown box
function changeURL(frmSelect) {
	var gotoURL	=	frmSelect.options[frmSelect.options.selectedIndex].value;
	if (gotoURL.length > 0) parent.location.href = gotoURL;
}

// Make the value in dropdown B the same as dropdown A
function makeSame(frmSelectA, frmSelectB) {
	frmSelectB.value = frmSelectA[frmSelectA.options.selectedIndex].value;
}

// Open a new window
function openWindow(url, name, width, height) {
	window.open(url, name, 'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=auto,resizable=0,width='+width+',height=' + height);
	return false;
}

// Pop up site credits
function siteCredits()	{ 
	window.open('http://www.plastercine.com/siteCredits/siteCredits.asp','sitecredits','width=250,height=180');
}

function bounce(winObj)	{
	var thisWindow;
	thisWindow = winObj;
	window.open('http://www.plastercine.com/','new','width=800,height=600');
	//thisWindow.close;
}


// Function pops up advert if 'popup' is true
// If 'closeOption' is true, shows a 'close permanently' option beneath advert
// Thomas Moore,  Plastercine Ltd. September 2001.
function checkPopup(popup,closeOption,serverName) {
	if (popup) {
		if (closeOption) {
			serverName	=	"http://" + serverName + "/popupFiles/popup.asp?option=hide";
			openWindow(serverName,'silverjobs', 260, 128)
		}
		else {
			serverName	=	"http://" + serverName + "/popupFiles/popup.asp";
			openWindow(serverName,'silverjobs', 260, 128)
		}
	}
}


// Function to close popup window automatically after iSeconds
// Thomas Moore,  Plastercine Ltd. September 2001.
function popupTimer(iSeconds) {
	setTimeout("popupTimer('" + iSeconds + "');", 100);
	dNow		= new Date();
	dWatch		= dNow.getTime() - dStarted.getTime();
	dClock		= Math.round(dWatch/1000);
	if (dClock == iSeconds) window.parent.close();
}


// Function to dynamically change an image, using the ID from a select drop down box.
// Can also put the URL associated with the selected image into a text input.
// Munsifali Rashid.  Plastercine Limited.  September 2001.
function changeImage(selName, bannerImg, altImg, arrayURLs, elemURLinput)	{
	var bannerImage = document[bannerImg];
	var newImageID = selName[selName.selectedIndex];
	if (newImageID.value > 0) {													// If we have an image ID
		bannerImage.src = '/images/getImage.asp?id=' + newImageID.value;		// Pull the new image from the DB
	} else {																	// Otherwise,
		bannerImage.src = altImg;												// Use alt img (specified)
	}

	if (arrayURLs) {															// If we have an array of URLS
		var sImageURL	=	arrayURLs[newImageID.index-1];						// Get the value
		if (sImageURL) if (elemURLinput) elemURLinput.value = sImageURL;		// If we have a form element to change, and it exists, and we have an image url, then put the image URL in
	}
}

// Function to start countdown clock, on page load in client area
// Munsifali Rashid.  Plastercine Limited.  September 2001.
function startClock()	{
	dWatch		= 0;															// Reset our timer
	dStarted	= new Date();													// Get date & time NOW
}

// Function to update clock each second, and show alert three minutes before session timeout, to warn user.
// Munsifali Rashid.  Plastercine Limited.  September 2001.
function updateClock(iTimeOutAlert) {
	setTimeout("updateClock('" + iTimeOutAlert + "');", 100);								// Set timeout on this function, to update clock
	dNow		= new Date();																// Get the date&time of NOW
	dWatch		= dNow.getTime() - dStarted.getTime();										// Calculate how many milliseconds have elapsed between the start time and now
	dClock		= Math.round(dWatch/1000);													// Divide by 1000, to convert the value into seconds
	if (dClock == iTimeOutAlert) alert("Warning!\n\nYour session will time out in THREE(3) minutes.\nPlease save any information now, to avoid\nlosing it when this session ends.");
	if (document.frmTimer)	{																// If there is a form called "frmTimer" -- This is used for debugging!
		document.frmTimer.clock.value		= dClock;										// Timer (Seconds counting forward)
		document.frmTimer.timeout.value		= iTimeOutAlert;								// Time out value (Session timeout - 8 minutes, in seconds)
		document.frmTimer.timeleft.value	= iTimeOutAlert - dClock;						// Countdown timer, Seconds.  When this value hits zero, warning will be shown
		document.frmTimer.timeleft2.value	= Math.ceil((iTimeOutAlert/60) - (dClock/60));	// Countdown timer, Minutes.  Calculated from above.
	}
}


// Function to select all options in a form element. Used on "Select your profile" page
// Munsifali Rashid.  Plastercine Limited. 2001
function selectAll(elem)	{
	var theElem		= frmSearch[elem];
	if (theElem.type == "select-multiple") {
		for (var i=0; i < theElem.length-1; i++) theElem.options[i].selected = true;	// Select all options in a multiple select
	}
	else {
		for (var i=0; i < theElem.length; i++) theElem[i].checked = true;				// Select all check boxes
	}
}

// Function used on homepage for partners.
function PTmouseOver(obj) {
	obj.style.backgroundColor = "#fffacd"; 
	obj.style.cursor = "pointer";
}
function PTmouseOut(obj) {
	obj.style.backgroundColor = "#ffffff";
	obj.style.cursor = "default";
}

//--> 