/*	sIFR (Scalable Inman Flash Replacement) Version 2.0 RC1
	Copyright 2004 Mike Davidson, Shaun Inman, Tomas Jogin and Mark Wubben

	This software is licensed under the CC-GNU LGPL <http://creativecommons.org/licenses/LGPL/2.1/>
*/

var hasFlash = function(){
	var nRequiredVersion = 6;

	if(navigator.appVersion.indexOf("MSIE") != -1 && navigator.appVersion.indexOf("Windows") > -1){
		document.write('<script language="VBScript"\> \n');
		document.write('on error resume next \n');
		document.write('hasFlash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & ' + nRequiredVersion + '))) \n');
		document.write('<'+'/script\> \n');
		/*	If executed, the VBScript above checks for Flash and sets the hasFlash variable.
			If VBScript is not supported it's value will still be undefined, so we'll run it though another test
			This will make sure even Opera identified as IE will be tested */
		if(window.hasFlash != null){
			return window.hasFlash;
		};
	};

	if(navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){
		var flashDescription = (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description;
		var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
		return flashVersion >= nRequiredVersion;
	};

	return false;
}();

String.prototype.normalize = function(){
	return this.replace(/\s+/g, " ");
};

/* IE 5.0 does not support the push method, so here goes */
if(Array.prototype.push == null){
	Array.prototype.push = function(item){
		this[this.length] = item;
		return this.length;
	};
};

/*	Implement function.apply for browsers which don't support it natively
	Courtesy of Aaron Boodman - http://youngpup.net */
if (!Function.prototype.apply){
	Function.prototype.apply = function(oScope, args) {
		var sarg = [];
		var rtrn, call;

		if (!oScope) oScope = window;
		if (!args) args = [];

		for (var i = 0; i < args.length; i++) {
			sarg[i] = "args["+i+"]";
		};

		call = "oScope.__applyTemp__(" + sarg.join(",") + ");";

		oScope.__applyTemp__ = this;
		rtrn = eval(call);
		oScope.__applyTemp__ = null;
		return rtrn;
	};
};

/*	The following code parses CSS selectors.
	This script however is not the right place to explain it,
	please visit the documentation for more information. */
var parseSelector = function(){
	var reParseSelector = /^([^#\.>\`]*)(#|\.|\>|\`)(.+)$/;
	function parseSelector(sSelector, oParentNode, sMode){
		sSelector = sSelector.replace(" ", "`");
		var selector = sSelector.match(reParseSelector);
		var node, listNodes, listSubNodes, subselector;
		var listReturn = [];

		if(selector == null){ selector = [sSelector, sSelector]	};
		if(selector[1] == ""){ selector[1] = "*" };
		if(sMode == null){ sMode = "`" };

		switch(selector[2]){
			case "#":
				subselector = selector[3].match(reParseSelector);
				if(subselector == null){ subselector = [null, selector[3]] };
				node = 	document.getElementById(subselector[1]);
				if(node == null || (selector[1] != "*" && node.nodeName.toLowerCase() != selector[1].toLowerCase())){
					return listReturn;
				};
				if(subselector.length == 2){
					listReturn.push(node);
					return listReturn;
				};
				return parseSelector(subselector[3], node, "#");
			case ".":
				if(sMode == "`"){
					listNodes = getElementsByTagName(oParentNode, selector[1]);
				} else {
					listNodes = oParentNode.childNodes;
				};

				for(var i = 0; i < listNodes.length; i++){
					node = listNodes[i];
					if(node.nodeType != 1){
						continue;
					};

					subselector = selector[3].match(reParseSelector);
					if(subselector != null){
						if(node.className.match("\\b" + subselector[1] + "\\b") == null){
							continue;
						};
						listSubNodes = parseSelector(subselector[3], node, subselector[2]);
						listReturn = listReturn.concat(listSubNodes);
					} else if(node.className.match("\\b" + selector[3] + "\\b") != null){
						listReturn.push(node);
					};
				};
				return listReturn;
			case ">":
				if(sMode == "`"){
					listNodes = getElementsByTagName(oParentNode, selector[1]);
				} else {
					listNodes = oParentNode.childNodes;
				};
				for(var i = 0; i < listNodes.length; i++){
					node = listNodes[i];
					if(node.nodeType != 1){
						continue;
					};
					if(node.nodeName.toLowerCase() != selector[1].toLowerCase()){
						continue;
					};
					listSubNodes = parseSelector(selector[3], node, ">");
					listReturn = listReturn.concat(listSubNodes);
				};
				return listReturn;
			case "`":
				listNodes = getElementsByTagName(oParentNode, selector[1]);
				for(var i = 0; i < listNodes.length; i++){
					node = listNodes[i];
					listSubNodes = parseSelector(selector[3], node, "`");
					listReturn = listReturn.concat(listSubNodes);
				};
				return listReturn;
			default:
				listNodes = getElementsByTagName(oParentNode, selector[0]);
				for(var i = 0; i < listNodes.length; i++){
					listReturn.push(listNodes[i]);
				};
				return listReturn;
		};
	};

	function getElementsByTagName(oParentNode, sTagName){
		/*	IE5.x does not support document.getElementsByTagName("*")
			therefore we're resorting to element.all */
		if(sTagName == "*" && oParentNode.all != null){
			return oParentNode.all;
		};
		return oParentNode.getElementsByTagName(sTagName);
	};

	return parseSelector;
}();

/*	Executes an anonymous function which returns the function sIFR (defined inside the function).
	You can replace elements using sIFR.replaceElement()
	All other variables and methods you see are private. If you want to understand how this works you should
	learn more about the variable-scope in JavaScript. */
var sIFR = function(){
	if(window.hasFlash == false || !document.createElement || !document.getElementById){ return function(){return false} };

	/* Providing a hook for you to hide certain elements if Flash has been detected */
	if(document.documentElement){
		document.documentElement.className = document.documentElement.className.normalize() + (document.documentElement.className == "" ? "" : " ") + "sIFR-hasFlash";
	};

	/* Opera and Mozilla require a namespace when creating elements in an XML page */
	var sNameSpaceURI = "http://www.w3.org/1999/xhtml";
	var UA = function(){
		var sUA = navigator.userAgent.toLowerCase();
		var oReturn =  {
			bIsKHTML: sUA.indexOf('safari') > -1 || sUA.indexOf('konqueror') > -1 || sUA.indexOf('omniweb') > -1,
			bIsOpera : sUA.indexOf('opera') > -1,
			bIsGecko : navigator.product != null && navigator.product.toLowerCase() == 'gecko',
			bIsXML : document.contentType != null && document.contentType.indexOf('xml') > -1
		};
		oReturn.bIsIE = sUA.indexOf('msie') > -1 && ! oReturn.bIsOpera && !oReturn.bIsKHTML && !oReturn.bIsGecko;
		return oReturn;
	}();

	var bIsInitialized = false;
	var stackReplaceElementArguments = [];

	function fetchContent(oNode, oNewNode, sCase){
		var sContent = "";
		var oSearch = oNode.firstChild;
		var oRemove, oRemovedNode, oTarget;

		while(oSearch){
			if(oSearch.nodeType == 3){
				switch(sCase){
					case "lower":
						sContent += oSearch.nodeValue.toLowerCase();
						break;
					case "upper":
						sContent += oSearch.nodeValue.toUpperCase();
						break;
					default:
						sContent += oSearch.nodeValue;
				};
			} else if(oSearch.nodeType == 1){
				if(oSearch.nodeName.toLowerCase() == "a"){
					if(oSearch.getAttribute("target")){
						oTarget = oSearch.getAttribute("target");
					} else {
						oTarget = "";
					};
					sContent += '<a href="' + oSearch.getAttribute("href") + '" target="' + oTarget + '">';
				};
				if(oSearch.hasChildNodes){
					sContent += fetchContent(oSearch, null, sCase);
				};
				if(oSearch.nodeName.toLowerCase() == "a"){
					sContent += "</a>";
				};
			};
			oRemove = oSearch;
			oSearch = oSearch.nextSibling;
			if(oNewNode != null){
				oRemovedNode = oRemove.parentNode.removeChild(oRemove);
				oNewNode.appendChild(oRemovedNode);
			};
		};
		return sContent;
	};

	function createElement(sTagName){
		if(document.createElementNS){
			return document.createElementNS(sNameSpaceURI, sTagName);
		} else {
			return document.createElement(sTagName);
		};
	};

	function createObjectParameter(nodeObject, sName, sValue){
		var node = createElement("param");
		node.setAttribute("name", sName);
		node.setAttribute("value", sValue);
		nodeObject.appendChild(node);
	};

	function replaceElement(sSelector, sFlashSrc, sColor, sLinkColor, sHoverColor, sBgColor, nPaddingTop, nPaddingRight, nPaddingBottom, nPaddingLeft, sFlashVars, sCase){
		if(!mayReplace()){
			return stackReplaceElementArguments.push(arguments);
		};

		if(sFlashVars != null){
			sFlashVars = "&" + sFlashVars.normalize();
		} else {
			sFlashVars = "";
		};

		var sWmode = (sBgColor == "transparent") ? "transparent" : "opaque";
		var node, sWidth, sHeight, sMargin, sPadding, sText, sVars, nodeAlternate, nodeFlash;
		var listNodes = parseSelector(sSelector, document);
		if(listNodes.length == 0){ return false };

		for(var i = 0; i < listNodes.length; i++){
			node = listNodes[i];

			/* Prevents elements from being replaced multiple times. */
			if(node.className.match(/\bsIFR\-replaced\b/) != null){ continue; };

			sWidth = node.offsetWidth - nPaddingLeft - nPaddingRight;
			sHeight = node.offsetHeight - nPaddingTop - nPaddingBottom;

			nodeAlternate = createElement("span");
			nodeAlternate.className = "sIFR-alternate";

			sText = fetchContent(node, nodeAlternate, sCase);
			sText = sText.replace(/%\d{0}/g, "%25");
			sText = sText.replace(/\+/g, "%2B");
			sText = sText.replace(/&/g, "%26");
			sText = sText.replace(/\"/g, "%22");
			sText = sText.normalize();

			sVars = "txt=" + sText + sFlashVars + "&w=" + sWidth + "&h=" + sHeight;
			if (sColor != null){sVars += "&textcolor=" + sColor};
			if (sLinkColor != null){sVars += "&linkcolor=" + sLinkColor};
			if (sHoverColor != null){sVars += "&hovercolor=" + sHoverColor};

			node.className = node.className.normalize() + (node.className == ""  ? "" : " ") + "sIFR-replaced";

			/*	Opera only supports the object element, other browsers are given the embed element,
				for backwards compatibility reasons between different browser versions. */
			if(UA.bIsOpera){
				nodeFlash = createElement("object");
				nodeFlash.setAttribute("type", "application/x-shockwave-flash");
				nodeFlash.setAttribute("data", sFlashSrc);
				createObjectParameter(nodeFlash, "quality", "high");
				createObjectParameter(nodeFlash, "wmode", sWmode);
				createObjectParameter(nodeFlash, "bgcolor", sBgColor);
				createObjectParameter(nodeFlash, "flashvars", sVars);
			} else {
				nodeFlash = createElement("embed");
				nodeFlash.setAttribute("src", sFlashSrc);
				nodeFlash.setAttribute("flashvars", sVars);
				nodeFlash.setAttribute("type", "application/x-shockwave-flash");
				nodeFlash.setAttribute("pluginspage", "http://www.macromedia.com/go/getflashplayer");
				nodeFlash.setAttribute("wmode", sWmode);
				nodeFlash.setAttribute("bgcolor", sBgColor);
			};
			nodeFlash.className = "sIFR-flash";
			nodeFlash.setAttribute("width", sWidth);
			nodeFlash.setAttribute("height", sHeight);
			nodeFlash.style.width = sWidth + "px";
			nodeFlash.style.height = sHeight + "px";
			node.appendChild(nodeFlash);

			node.appendChild(nodeAlternate);

			/*	Workaround to force KHTML-browsers to repaint the document.
				Additionally, IE for both Mac and PC need this.
				See: http://neo.dzygn.com/archive/2004/09/forcing-safari-to-repaint */

			if(UA.bIsKHTML || UA.bIsIE){
				node.innerHTML += "";
			};
		};
	};

	function mayReplace(e){
		if(((UA.bIsXML && UA.bIsGecko || UA.bIsKHTML) && e == null && bIsInitialized == false) || document.getElementsByTagName("body").length == 0){
			return false;
		};
		return true;
	};

	function sIFR(e){
		if((!sIFR.bAutoInit && (window.event || e) != null) || !mayReplace(e)){
			return;
		};
		bIsInitialized = true;

		for(var i = 0; i < stackReplaceElementArguments.length; i++){
			replaceElement.apply(null, stackReplaceElementArguments[i]);
		};
		stackReplaceElementArguments = [];
	};

	sIFR.replaceElement = replaceElement;
	sIFR.UA = UA;
	sIFR.bAutoInit = true;

	if(window.attachEvent){
		window.attachEvent("onload", sIFR);
	} else if(document.addEventListener || window.addEventListener){
		if(document.addEventListener){
			document.addEventListener("load", sIFR, false);
		};
		if(window.addEventListener){
			window.addEventListener("load", sIFR, false);
		};
	} else {
		if(typeof window.onload == "function"){
			var fOld = window.onload;
			window.onload = function(){ fOld(); sIFR(); };
		} else {
			window.onload = sIFR;
		};
	};

	return sIFR;
}
();

if(sIFR != null && sIFR.replaceElement != null){
	sIFR.replaceElement("h6", "/images/global/maxot-right.swf", "#000000", null, null, "transparent", 0, 0, 0, 0);

};
//]]>



/**
 * SWFObject v1.5.1: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept == "undefined") var deconcept = {};
if(typeof deconcept.util == "undefined") deconcept.util = {};
if(typeof deconcept.SWFObjectUtil == "undefined") deconcept.SWFObjectUtil = {};
deconcept.SWFObject = function(swf, id, w, h, ver, c, quality, xiRedirectUrl, redirectUrl, detectKey) {
	if (!document.getElementById) { return; }
	this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
	this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
	this.params = {};
	this.variables = {};
	this.attributes = [];
	if(swf) { this.setAttribute('swf', swf); }
	if(id) { this.setAttribute('id', id); }
	if(w) { this.setAttribute('width', w); }
	if(h) { this.setAttribute('height', h); }
	if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); }
	this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
	if (!window.opera && document.all && this.installedVer.major > 7) {
		// only add the onunload cleanup if the Flash Player version supports External Interface and we are in IE
		// fixes bug in some fp9 versions see http://blog.deconcept.com/2006/07/28/swfobject-143-released/
		if (!deconcept.unloadSet) {
			deconcept.SWFObjectUtil.prepUnload = function() {
				__flash_unloadHandler = function(){};
				__flash_savedUnloadHandler = function(){};
				window.attachEvent("onunload", deconcept.SWFObjectUtil.cleanupSWFs);
			}
			window.attachEvent("onbeforeunload", deconcept.SWFObjectUtil.prepUnload);
			deconcept.unloadSet = true;
		}
	}
	if(c) { this.addParam('bgcolor', c); }
	var q = quality ? quality : 'high';
	this.addParam('quality', q);
	this.setAttribute('useExpressInstall', false);
	this.setAttribute('doExpressInstall', false);
	var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
	this.setAttribute('xiRedirectUrl', xir);
	this.setAttribute('redirectUrl', '');
	if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); }
}
deconcept.SWFObject.prototype = {
	useExpressInstall: function(path) {
		this.xiSWFPath = !path ? "expressinstall.swf" : path;
		this.setAttribute('useExpressInstall', true);
	},
	setAttribute: function(name, value){
		this.attributes[name] = value;
	},
	getAttribute: function(name){
		return this.attributes[name] || "";
	},
	addParam: function(name, value){
		this.params[name] = value;
	},
	getParams: function(){
		return this.params;
	},
	addVariable: function(name, value){
		this.variables[name] = value;
	},
	getVariable: function(name){
		return this.variables[name] || "";
	},
	getVariables: function(){
		return this.variables;
	},
	getVariablePairs: function(){
		var variablePairs = [];
		var key;
		var variables = this.getVariables();
		for(key in variables){
			variablePairs[variablePairs.length] = key +"="+ variables[key];
		}
		return variablePairs;
	},
	getSWFHTML: function() {
		var swfNode = "";
		if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
			if (this.getAttribute("doExpressInstall")) {
				this.addVariable("MMplayerType", "PlugIn");
				this.setAttribute('swf', this.xiSWFPath);
			}
			swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ (this.getAttribute('style') || "") +'"';
			swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
			var params = this.getParams();
			 for(var key in params){ swfNode += [key] +'="'+ params[key] +'" '; }
			var pairs = this.getVariablePairs().join("&");
			 if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }
			swfNode += '/>';
		} else { // PC IE
			if (this.getAttribute("doExpressInstall")) {
				this.addVariable("MMplayerType", "ActiveX");
				this.setAttribute('swf', this.xiSWFPath);
			}
			swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ (this.getAttribute('style') || "") +'">';
			swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
			var params = this.getParams();
			for(var key in params) {
			 swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
			}
			var pairs = this.getVariablePairs().join("&");
			if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
			swfNode += "</object>";
		}
		return swfNode;
	},
	write: function(elementId){
		if(this.getAttribute('useExpressInstall')) {
			// check to see if we need to do an express install
			var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]);
			if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {
				this.setAttribute('doExpressInstall', true);
				this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));
				document.title = document.title.slice(0, 47) + " - Flash Player Installation";
				this.addVariable("MMdoctitle", document.title);
			}
		}
		if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){
			var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
			n.innerHTML = this.getSWFHTML();
			return true;
		}else{
			if(this.getAttribute('redirectUrl') != "") {
				document.location.replace(this.getAttribute('redirectUrl'));
			}
		}
		return false;
	}
}

/* ---- detection functions ---- */
deconcept.SWFObjectUtil.getPlayerVersion = function(){
	var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);
	if(navigator.plugins && navigator.mimeTypes.length){
		var x = navigator.plugins["Shockwave Flash"];
		if(x && x.description) {
			PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
		}
	}else if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0){ // if Windows CE
		var axo = 1;
		var counter = 3;
		while(axo) {
			try {
				counter++;
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+ counter);
//				document.write("player v: "+ counter);
				PlayerVersion = new deconcept.PlayerVersion([counter,0,0]);
			} catch (e) {
				axo = null;
			}
		}
	} else { // Win IE (non mobile)
		// do minor version lookup in IE, but avoid fp6 crashing issues
		// see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
		try{
			var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		}catch(e){
			try {
				var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
				PlayerVersion = new deconcept.PlayerVersion([6,0,21]);
				axo.AllowScriptAccess = "always"; // error if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)
			} catch(e) {
				if (PlayerVersion.major == 6) {
					return PlayerVersion;
				}
			}
			try {
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			} catch(e) {}
		}
		if (axo != null) {
			PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
		}
	}
	return PlayerVersion;
}
deconcept.PlayerVersion = function(arrVersion){
	this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0;
	this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0;
	this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0;
}
deconcept.PlayerVersion.prototype.versionIsValid = function(fv){
	if(this.major < fv.major) return false;
	if(this.major > fv.major) return true;
	if(this.minor < fv.minor) return false;
	if(this.minor > fv.minor) return true;
	if(this.rev < fv.rev) return false;
	return true;
}
/* ---- get value of query string param ---- */
deconcept.util = {
	getRequestParameter: function(param) {
		var q = document.location.search || document.location.hash;
		if (param == null) { return q; }
		if(q) {
			var pairs = q.substring(1).split("&");
			for (var i=0; i < pairs.length; i++) {
				if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
					return pairs[i].substring((pairs[i].indexOf("=")+1));
				}
			}
		}
		return "";
	}
}
/* fix for video streaming bug */
deconcept.SWFObjectUtil.cleanupSWFs = function() {
	var objects = document.getElementsByTagName("OBJECT");
	for (var i = objects.length - 1; i >= 0; i--) {
		objects[i].style.display = 'none';
		for (var x in objects[i]) {
			if (typeof objects[i][x] == 'function') {
				objects[i][x] = function(){};
			}
		}
	}
}
/* add document.getElementById if needed (mobile IE < 5) */
if (!document.getElementById && document.all) { document.getElementById = function(id) { return document.all[id]; }}

/* add some aliases for ease of use/backwards compatibility */
var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject; // for legacy support
var SWFObject = deconcept.SWFObject;


/******* end SWFObject ********/



function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}








/*NINBAR JAVASCRIPT*/


/*PL:16/11/2007*/
function object(o){function F(){}
F.prototype=o;return new F();}
if(typeof _global_==="undefined"){_global_={"@namespace":function(str){var a=str.split(".");var o=window;for(var i=0;i<a.length;i++){if(!o[a[i]]){o[a[i]]={};}
o=o[a[i]];}},"@import":function(source,destination){for(var property in source){if(source.hasOwnProperty(property)){destination[property]=source[property];}}},"@export":function(fn,nm){window[nm]=fn;},"@requires":function(str){var sourcePath="http://network.news.com.au/js/";var r="200711218";var sourceFiles={"ndm.$":"ndm.shorthand.js","ndm.functional":"functional.js","ndm.controls.calendar":"ndm.controls.calendar.js/0,,"+r+",00.js","ndm.controls.autocomplete":"ndm.controls.autocomplete.js/0,,"+r+",00.js"};var v=str.split(",");var a=null;var o=window;for(var i=0;i<v.length;i++){a=v[i].split(".");for(var j=0;j<a.length;j++){if(!o[a[j]]){if(ndm.ajax&&!!sourceFiles[v[i]]){return ndm.ajax.insertScript(sourcePath+sourceFiles[v[i]]);}else{console.log("Missing module. Check your source version. Aborting now.");throw"Fatal error: module \""+a.join(".")+"\" not found";return false;}}
o=o[a[j]];}}
return true;}};}
if(!Array.prototype.indexOf){Array.prototype.indexOf=function(elt,from){var len=this.length;var from=Number(arguments[1])||0;from=(from<0)?Math.ceil(from):Math.floor(from);if(from<0){from+=len;}
for(;from<len;from++){if(from in this&&this[from]===elt){return from;}}
return-1;};}
if(!Array.prototype.map){Array.prototype.map=function(fun){var len=this.length;if(typeof fun!="function"){throw new TypeError();}
var res=new Array(len);var thisp=arguments[1];for(var i=0;i<len;i++){if(i in this){res[i]=fun.call(thisp,this[i],i,this);}}
return res;};}
if(typeof console==="undefined"){console={log:function(){},error:function(){}};}
Date.prototype.format=function(mask){var d=this;var zeroize=function(value,length){if(!length){length=2;}
value=String(value);for(var i=0,zeros='';i<(length-value.length);i++){zeros+='0';}
return zeros+value;};return mask.replace(/"[^"]*"|'[^']*'|\b(?:d{1,4}|m{1,4}|yy(?:yy)?|([hHMs])\1?|TT|tt|[lL])\b/g,function($0){switch($0){case'd':return d.getDate();case'dd':return zeroize(d.getDate());case'ddd':return['Sun','Mon','Tue','Wed','Thr','Fri','Sat'][d.getDay()];case'dddd':return['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'][d.getDay()];case'm':return d.getMonth()+1;case'mm':return zeroize(d.getMonth()+1);case'mmm':return['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'][d.getMonth()];case'mmmm':return['January','February','March','April','May','June','July','August','September','October','November','December'][d.getMonth()];case'yy':return String(d.getFullYear()).substr(2);case'yyyy':return d.getFullYear();case'h':return d.getHours()%12||12;case'hh':return zeroize(d.getHours()%12||12);case'H':return d.getHours();case'HH':return zeroize(d.getHours());case'M':return d.getMinutes();case'MM':return zeroize(d.getMinutes());case's':return d.getSeconds();case'ss':return zeroize(d.getSeconds());case'l':return zeroize(d.getMilliseconds(),3);case'L':var m=d.getMilliseconds();if(m>99){m=Math.round(m/10);}
return zeroize(m);case'tt':return d.getHours()<12?'am':'pm';case'TT':return d.getHours()<12?'AM':'PM';default:return $0.substr(1,$0.length-2);}});};_global_["@namespace"]("ndm.dom");ndm.dom=function(_){var initList=[];var _timer=null;var init=function(){if(arguments.callee.done){return;}
arguments.callee.done=true;if(_timer){window.clearInterval(_timer);_timer=null;}
for(var i=0;i!==initList.length;i++){initList[i].assert();}};
var isMSIE = /*@cc_on!@*/false;
var InitBundle=function(functor,precondition,postcondition){this.functor=functor;this.precondition=precondition;this.postcondition=postcondition;};InitBundle.prototype.assert=function(){if(this.precondition.call()===true){this.functor.call();if(this.postcondition.call()===true){return true;}else{return false;}}else{return false;}};if(document.addEventListener){document.addEventListener("DOMContentLoaded",init,null);}
if(isMSIE){document.write("<script id=__ready defer src=//:></script>");document.all.__ready.onreadystatechange=function(){if(this.readyState==="complete"){this.removeNode();init();}};}
if(/WebKit/i.test(navigator.userAgent)){_timer=window.setInterval(function(){if(/loaded|complete/.test(document.readyState)){init();}},10);}
window.onload=function(){init();if(isMSIE){try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}}};return{hasClass:function(el,className){var re=el.className.split(' ');return-1!==re.indexOf(className);},getElementsByClassName:function(clss,prnt,tg){var elements=[];tg=tg||'*';prnt=prnt||document;var list=prnt.getElementsByTagName(tg);for(var i=0;i<list.length;++i){if(ndm.dom.hasClass(list[i],clss)){elements.push(list[i]);}}
return elements;},isIE:function(){return!!isMSIE;},addLoadEvent:function(functor,precondition,postcondition){_precondition=precondition||function(){return true;};_postcondition=postcondition||function(){return true;};var ib=new InitBundle(functor,_precondition,_postcondition);initList.push(ib);return true;},getPageSize:function(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=document.body.scrollWidth;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
var windowWidth,windowHeight;if(window.innerHeight){windowWidth=window.innerWidth;windowHeight=window.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
var pageHeight=0;if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}
var pageWidth=0;if(xScroll<windowWidth){pageWidth=windowWidth;}else{pageWidth=xScroll;}
return[pageWidth,pageHeight,windowWidth,windowHeight];},getPageScroll:function(){var yScroll;if(window.pageYOffset){yScroll=window.pageYOffset;}else if(document.documentElement&&document.documentElement.scrollTop){yScroll=document.documentElement.scrollTop;}else if(document.body){yScroll=document.body.scrollTop;}
return['',yScroll];},getEventTarget:function(e){var ev=e||window.event;if(typeof ev==="undefined"){return false;}
var targ=ev.target||ev.srcElement;if(targ.nodeType===3){targ=targ.parentNode;}
return targ;},findPos:function(obj){var curleft=0;var curtop=0;if(obj.offsetParent){curleft=obj.offsetLeft;curtop=obj.offsetTop;while(!!obj.offsetParent){obj=obj.offsetParent;curleft+=obj.offsetLeft;curtop+=obj.offsetTop;}}
return[curleft,curtop];},findParent:function(e,idOrClass){if(!e.parentNode){return false;}else if(e.parentNode.id===idOrClass){return e.parentNode;}else if(ndm.dom.hasClass(e,idOrClass)){return e.parentNode;}
else{return arguments.callee(e.parentNode,idOrClass);}},getMousePos:function(e){var tempX=0;var tempY=0;if(isMSIE){tempX=event.clientX+document.body.scrollLeft;tempY=event.clientY+document.body.scrollTop;}else{tempX=e.pageX;tempY=e.pageY;}
if(tempX<0){tempX=0;}
if(tempY<0){tempY=0;}
return[tempX,tempY];},replaceHTML:function(el,html){var oldEl=(typeof el==="string"?document.getElementById(el):el);var newEl=oldEl.cloneNode(false);newEl.innerHTML=html;oldEl.parentNode.replaceChild(newEl,oldEl);return newEl;}};}();ndm.dom.scheduler=function(_){var schedule=[];var runner=[];var t=null;var at=0;var ONE_SECOND=1000;var scale=8000;var chunk=function(){if(at===runner.length){at=0;}else{++at;}};var setFrequency=function(s){if(s){scale=s;}
var slots=Math.ceil(scale/ONE_SECOND);for(var i=0;i!==slots;i++){runner[i]=function(){return false;};}
var spacing=Math.abs(Math.floor(slots/schedule.length))+"";spacing=parseInt(spacing.charAt(spacing.length-1),10);for(var j=0;j!==schedule.length;j++){var pos=runner.length-(j+1)*spacing+1;runner[pos]=schedule[j];}};return{start:function(s){setFrequency(s);t=window.setInterval(function(){if(typeof runner[at]==="function"){runner[at]();}
chunk();},ONE_SECOND);},stop:function(){window.clearInterval(t);},addSchedule:function(fn){schedule.push(fn);setFrequency();},onMotionFinished:function(){}};}();_global_["@namespace"]("ndm.util");ndm.util=function(_){return{parseUri:function(source){var options={strictMode:false,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?=.)&?([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};var o=options,value=o.parser[o.strictMode?"strict":"loose"].exec(source);for(var i=0,uri={};i<14;i++){uri[o.key[i]]=value[i]||"";}
uri[o.q.name]={};uri[o.key[12]].replace(o.q.parser,function($0,$1,$2){if($1){uri[o.q.name][$1]=$2;}});return uri;}};}();_global_["@namespace"]("ndm.util.crypto");ndm.util.crypto=function(){return{xorExcrypt:function(str){if(str===null||str.length<8){return false;}
if(pwd===null||pwd.length<=0){return false;}
var prand="";for(var i=0;i<pwd.length;i++){prand+=pwd.charCodeAt(i).toString();}
var sPos=Math.floor(prand.length/5);var mult=parseInt(prand.charAt(sPos)+prand.charAt(sPos*2)+prand.charAt(sPos*3)+prand.charAt(sPos*4)+prand.charAt(sPos*5));var incr=Math.round(pwd.length/2);var modu=Math.pow(2,31)-1;var salt=parseInt(str.substring(str.length-8,str.length),16);str=str.substring(0,str.length-8);prand+=salt;while(prand.length>10){prand=(parseInt(prand.substring(0,10))+parseInt(prand.substring(10,prand.length))).toString();}
prand=(mult*prand+incr)%modu;var encChr="";var encStr="";for(i=0;i<str.length;i+=2){encChr=parseInt(parseInt(str.substring(i,i+2),16)^Math.floor((prand/modu)*255));encStr+=String.fromCharCode(encChr);prand=(mult*prand+incr)%modu;}
return encStr;},pseudoRandomString:function(){var chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";var stringLength=8;var rs="";for(var i=0;i<stringLength;i++){var rnum=Math.floor(Math.random()*chars.length);rs+=chars.substring(rnum,rnum+1);}
return rs;},keySaltEncrypt:function(s,key){s=s.toLowerCase();var r=s.length-4;var f="";var x=0;for(var i=0;i!=4;i++){f+=s.charAt(parseInt((key.charAt(i))-1));x+=(parseInt(f.charCodeAt(i))-96);}
x=x-r;f=x+f;return f;}};}();_global_["@namespace"]("ndm.forms.validation");ndm.forms.validation=function(){var validators=[];validators["email"]="^([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z_]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$";validators["fullName"]="[^ \\n]+";validators["name"]="[^ \\n]+";validators["location"]="[^ \\n]+";validators["comment"]="[^ \\n]+";validators["comments"]="[^ \\n]+";var matchfields=[];matchfields["pwd"]="pwdvalidate";var messages=[];messages["default"]="Please check the value of field '1', it does not validate.";messages["fullName"]="Please enter your name";messages["name"]="Please enter your name";messages["email"]="Please enter your (valid) email address";messages["location"]="Please enter your location";messages["comment"]="Please enter your comment";messages["comments"]="Please enter your comments";var keySaltEncrypt=function(s,key){key=key.replace(/\s/g,"");s=s.toLowerCase();var r=s.length-4;var f="";var x=0;for(var i=0;i!=4;i++){f+=s.charAt(parseInt((key.charAt(i))-1));x+=(parseInt(f.charCodeAt(i))-96);}
x=x-r;f=x+f;return f;};var validateRadio=function(element,theForm){var elements=theForm.getElementsByTagName("input");if(validators[element.name]){var redundant=false;var firstEncounter=-1;for(var i=0;i<elements.length&&!redundant;i++){if(elements[i].type==element.type&&elements[i].name==element.name){if(firstEncounter==-1){firstEncounter=i;}
if(elements[i].value==element.value&&firstEncounter!=i){return true;}
if(elements[i].checked){return true;}
element.onclick=function(){if(document.getElementById("single-error")){document.getElementById("single-error").style.display="none";}}}}
return false;}
else return true;};var validateText=function(element){var inputToValidate=element;if(element.className.indexOf("honey")>=0){inputToValidate=document.getElementById(keySaltEncrypt(element.name,document.getElementById("form-num").value));}
if(validators[element.name]){switch(typeof validators[element.name]){case"string":var re=new RegExp(validators[element.name]);return re.test(inputToValidate.value);case"function":return validators[element.name](element);}return true;}
else return true;};var validateCheckbox=function(element){if(validators[element.name]){switch(typeof validators[element.name]){case"string":return(element.checked);case"function":return validators[element.name](element);}return true;}
else return true;};var validateSelect=function(element){if(validators[element.name]){switch(typeof validators[element.name]){case"string":return(element.value.length>0);case"function":return validators[element.name](element);}return true;}
else return true;};var validateSelectOne=function(element){if(validators[element.name]){switch(typeof validators[element.name]){case"string":return(element.value.length>0);case"function":return validators[element.name](element);}return true;}
else return true;};var validateSelectMultiple=function(element){if(validators[element.name]){switch(typeof validators[element.name]){case"string":return(element.value.length>0);case"function":return validators[element.name](element);}return true;}
else return true;};var validatePassword=function(element){if(matchfields[element.name]){return(element.value==element.form.elements[matchfields[element.name]].value);}
else return true;};var assertCharLimit=function(caller){if(caller.className.indexOf("char-limit")<0){return true;}
if(caller.value.length>1200){if(!(document.getElementById("single-error"))){var errorAlert=document.createElement("p");errorAlert.className="error";errorAlert.id="single-error";}else{var errorAlert=document.getElementById("single-error");errorAlert.innerHTML="";}
errorAlert.innerHTML+="Unable to submit your comment as it exceeds the character limit of 1200 characters. If you need to send a longer message, please send us an email at <a href=\"mailto:news@news.com.au\">news@news.com.au</a>";if(document.getElementById("story-your-say")){parentForm=document.getElementById("story-your-say");}else{nd=caller;while(nd.parentNode){nd=nd.parentNode;if(nd.nodeName==="FORM"){parentForm=nd;break;}}}
parentForm.insertBefore(errorAlert,parentForm.firstChild);return false;}else{return true;}};var pseudoRandomString=function(){var chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";var stringLength=8;var rs="";for(var i=0;i<stringLength;i++){var rnum=Math.floor(Math.random()*chars.length);rs+=chars.substring(rnum,rnum+1);}
return rs;};var createPollCookie=function(value){var date=new Date();date.setTime(date.getTime()+10000);var expires="; expires="+date.toGMTString();document.cookie="syncopator="+value+expires+"; path=/";};var getFormLocation=function(str,pwd){var postLocation=str;str=str.split(",")[2];if(str==null||str.length<8){return;}
if(pwd==null||pwd.length<=0){return;}
var prand="";for(var i=0;i<pwd.length;i++){prand+=pwd.charCodeAt(i).toString();}
var sPos=Math.floor(prand.length/5);var mult=parseInt(prand.charAt(sPos)+prand.charAt(sPos*2)+prand.charAt(sPos*3)+prand.charAt(sPos*4)+prand.charAt(sPos*5));var incr=Math.round(pwd.length/2);var modu=Math.pow(2,31)-1;var salt=parseInt(str.substring(str.length-8,str.length),16);str=str.substring(0,str.length-8);prand+=salt;while(prand.length>10){prand=(parseInt(prand.substring(0,10))+parseInt(prand.substring(10,prand.length))).toString();}
prand=(mult*prand+incr)%modu;var enc_chr="";var enc_str="";for(var i=0;i<str.length;i+=2){enc_chr=parseInt(parseInt(str.substring(i,i+2),16)^Math.floor((prand/modu)*255));enc_str+=String.fromCharCode(enc_chr);prand=(mult*prand+incr)%modu;}
var tmps=postLocation.split(",")[2];var rval=postLocation.replace(tmps,enc_str);return rval;}
return{validate:function(form){var out="";for(var i=0;i<form.elements.length;i++){var element=form.elements[i];var validated=true;if(element.className.indexOf("is-optional")<0){switch(element.type){case"reset":break;case"submit":break;case"button":break;case"hidden":validated=validateText(element);break;case"password":validated=validateText(element)&&validatePassword(element);break;case"text":validated=validateText(element);break;case"radio":validated=validateRadio(element,form);break;case"textarea":validated=validateText(element);break;case"checkbox":validated=validateCheckbox(element);break;case"select":validated=validateSelect(element);break;case"select-one":validated=validateSelectOne(element);break;case"select-multiple":validated=validateSelectMultiple(element);break;default:break;}}
if(!validated){if(out.length>0)out+="<br/>";out+=((messages[element.name])?messages[element.name]:messages["default"]).replace(/\1/g,element.name);element.className+=" error-highlight";element.onfocus=function(){this.className=this.className.replace("error-highlight","");}}else{if((element.className!="")&&(element.className!="undefined")&&(element.className!=null)){element.className=element.className.replace("error-highlight","");}}}
if(document.getElementById("comment")){if(!(assertCharLimit(document.getElementById("comment")))){return false;document.getElementById("comment").className+=" error-highlight";document.getElementById("comment").onfocus=function(){document.getElementById("comment").className=document.getElementById("comment").className.replace("error-highlight","");}}}
if(out.length>0){if(typeof(singleErrorMessage)!="undefined"){out=singleErrorMessage;}
if(!(document.getElementById("single-error"))){var errorAlert=document.createElement("p");errorAlert.className="error";errorAlert.id="single-error";}else{var errorAlert=document.getElementById("single-error");errorAlert.innerHTML="";}
errorAlert.innerHTML=out;formFieldset=form.getElementsByTagName("fieldset")[0];if(formFieldset){formErrorLegend=formFieldset.getElementsByTagName("legend")[0];if(formErrorLegend){if((formFieldset.className).indexOf("error-parent")>=0){formErrorLegend.innerHTML=out;formErrorLegend.id="single-error";formErrorLegend.className+=" error";}}else if((formFieldset.className).indexOf("error-parent")>=0){formFieldset.insertBefore(errorAlert,formFieldset.firstChild);}else{form.insertBefore(errorAlert,form.firstChild);}}else{form.insertBefore(errorAlert,form.firstChild);}
return false;}else{try{if(window.location.href.match(/story|comments/gi)){var sid=window.location.href.split(",")[2];_hbSet("cv.c5",sid+"-"+hbx.mlc+"|"+hbx.pn);_hbSend();}}catch(e){console.log("This page missing HBX tracking code");}
return true;}},pollValidate:function(pollForm,samePage){var option=selectedValue(pollForm.option);var formAction=pollForm.getAttribute("action");if(formAction.indexOf("#")===0){formAction=formAction.replace("#","");var ky="6";pollForm.setAttribute("action",getFormLocation(formAction,ky));}
var plasNode=document.createElement("input");var randText=pseudoRandomString();createPollCookie(randText);plasNode.setAttribute("type","hidden");plasNode.setAttribute("name","syncopator");plasNode.setAttribute("value",randText);pollForm.insertBefore(plasNode,pollForm.childNodes[0]);var addr=pollForm.getAttribute("action")+"?option="+option+"&syncopator="+randText;if(validate(pollForm)){if(samePage){pollForm.submit();}else{popUp("nipoll",addr);}}
return false;},assertCharLimit:function(args){assertCharLimit(args);}}}();_global_["@namespace"]("ndm.util.cookies");ndm.util.cookies=function(){return{create:function(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}else{var expires="";}
document.cookie=name+"="+value+expires+"; path=/";},read:function(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' '){c=c.substring(1,c.length);}
if(c.indexOf(nameEQ)==0){return c.substring(nameEQ.length,c.length);}}
return null;},erase:function(name){createCookie(name,"",-1);}}}();_global_["@namespace"]("ndm");ndm.aop=function(_){var process=function(obj,filter,link){var check;if(filter.exec){check=function(str){return filter.exec(str);};}else if(filter.call){check=function(str){return filter.call(this,str);};}
if(check){for(var member in obj){if(check(member)){attach(obj,member,link);}}}else{attach(obj,filter,link);}};var attach=function(obj,member,link){var orig=obj[member];obj[member]=link(orig);};return{addBefore:function(obj,filter,before){var link=function(orig){return function(){return orig.apply(this,before(arguments,orig,this));};};process(obj,filter,link);},addAfter:function(obj,filter,after){var link=function(orig){return function(){return after(orig.apply(this,arguments),arguments,orig,this);};};process(obj,filter,link);},addAround:function(obj,filter,around){var link=function(orig){return function(){return around(arguments,orig,this);};};process(obj,filter,link);}};}();_global_["@namespace"]("ndm.legacy");ndm.legacy.aamAppendNewIframes=function(){if(/firefox\/[12][.]/.test(navigator.userAgent.toLowerCase())){document.close();var allIframes=document.getElementsByTagName('iframe');var currIframe=[];for(a=0;a<allIframes.length;a++){currIframe[currIframe.length]=allIframes[a];}
for(c=0;c<currIframe.length;c++){var newIframe=document.createElement('iframe');newIframe.width=currIframe[c].width;newIframe.height=currIframe[c].height;newIframe.frameBorder=0;newIframe.scrolling='no';newIframe.marginWidth=0;newIframe.marginHeight=0;newIframe.style.display='none';currIframe[c].parentNode.appendChild(newIframe);var newIframeDocument=newIframe.contentWindow.document;newIframeDocument.open();newIframeDocument.writeln('<html><head></head><body></body></html>');newIframeDocument.close();}}};window.onpageshow=function(){ndm.legacy.aamAppendNewIframes();};function selectedValue(nodeList){for(var i=0;i<nodeList.length;i++){if(nodeList[i].checked){return nodeList[i].value;}}

<!-- This site built and managed using the ARK Content Management System, Copyright 1999-2011 IRECKON  Pty Ltd http://www.ireckon.com -->
return null;}
function checkSiteVar(){niSearchForm=document.getElementById("ni-search");niSearchTerm=document.getElementById("ninnsearch");if(document.getElementById("local-search").checked){niSearchForm.setAttribute("action","http://www.truelocal.com.au/oneBoxSearch.do");niSearchTerm.setAttribute("name","term");niSearchForm.setAttribute("method","get");}else{niSearchForm.setAttribute("action","http://searchresults.news.com.au/servlet/Search");niSearchTerm.setAttribute("name","queryterm");niSearchForm.setAttribute("method","get");}
niSearchForm.submit();}
function pollSubmit(pollForm){var option=selectedValue(pollForm.option);var addr=pollForm.action+"?option="+option;window.open(addr,'nipoll','width=550, height=450');return false;}
function goStockUrl(){var quoteID=document.getElementById('quote').value;window.location.href="http://markets.news.com.au/newscorp/entry.aspx?secid="+quoteID;}
if(ndm.dom.isIE()){var startList=function(elementId){if(document.all&&document.getElementById){navRoot=document.getElementById(elementId);if(!navRoot){return;}
for(i=0;i<navRoot.childNodes.length;i++){node=navRoot.childNodes[i];if((node.nodeName=="LI")||(node.nodeName=="DL")||(node.nodeName=="DD")||(node.nodeName=="DT")){node.onmouseover=function(){this.className+=" over";};node.onmouseout=function(){this.className=this.className.replace(" over","");};}}}
return;};}
function createCookie(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}else{var expires="";}
document.cookie=name+"="+value+expires+"; path=/";}
function readCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' '){c=c.substring(1,c.length);}
if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length);}
return null;}
function eraseCookie(name){createCookie(name,"",-1);}
function commentFormInit(){var commentForm=document.getElementById("comment-form")||document.getElementById("story-your-say")||document.getElementById("feedback-form")||document.getElementById("have-your-say")||document.getElementById("have-your-say")||document.getElementById("comment-form");commentForm.onsubmit=function(){if(validate(commentForm)){commentFormSave();}else{return false;}};if(readCookie("commentRemember")=="true"){var fullNameElem=commentForm.fullName;var emailElem=commentForm.email;var locationElem=commentForm.location;var kv=document.getElementById("form-num").value;if(fullNameElem.className.match(/honey/gi)){fullNameElem=document.getElementById(keySaltEncrypt("fullName",kv));}
if(emailElem.className.match(/honey/gi)){emailElem=document.getElementById(keySaltEncrypt("email",kv));}
if(locationElem.className.match(/honey/gi)){locationElem=document.getElementById(keySaltEncrypt("location",kv));}
fullNameElem.value=readCookie("commentFullName");emailElem.value=readCookie("commentEmail");locationElem.value=readCookie("commentLocation");commentForm.remember.checked=true;if(readCookie("commentEmailMe")=="true"){commentForm.emailMe.checked=true;}}else{if(typeof commentForm.remember!=="undefined"){if(commentForm.remember!==null){commentForm.remember.checked=false;}}else{if(document.getElementById("remember")){document.getElementById("remember").checked=false;}}}}
function commentFormSave(){var form=document.storyCommentForm;if(form.remember.checked==true){createCookie("commentRemember","true",1000);createCookie("commentFullName",form.fullName.value,1000);createCookie("commentEmail",form.email.value,1000);createCookie("commentLocation",form.location.value,1000);if(form.emailMe.checked){createCookie("commentEmailMe","true",1000);}}else{eraseCookie("commentRemember");eraseCookie("commentFullName");eraseCookie("commentEmail");eraseCookie("commentLocation");eraseCookie("commentEmailMe");}
return true;}
_global_["@namespace"]("ndm.ajax");ndm.ajax=function(_){ndm.callback={};var hashIndex=0;var bindee=null;var queryCache={};var querySrc=null;var insertScript=function(src){querySrc=src;var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.id="upload-script";script.type="text/javascript";script.src=src;if(head){head.appendChild(script);}else{document.write("<scr"+"ipt type=\"text/javascript\" src=\""+src+"\"></scr"+"ipt>");}
return script;};var getCallbackHandler=function(url,func,namespaced,cached){if(!!cached){for(var q in queryCache){if(queryCache.hasOwnProperty(q)){if(q===url){console.log("ndm.ajax.getCallbackHandler: JSON cache hit");func(queryCache[url]);return false;}}}}
var fname=(ndm.util.parseUri(url).host).replace(/[^a-z]/gi,"")+(++hashIndex);ndm.callback[fname]=function(args){queryCache[url]=args;func(args);};if(namespaced===false){window["ndmcallback"+fname]=ndm.callback[fname];return"ndmcallback"+fname;}
return"ndm.callback."+fname;};return{insertScript:insertScript,callbackJSON:function(url,func,namespaced,cached){var cb=getCallbackHandler(url,func,namespaced,cached);if(!cb){return;}
insertScript(url.replace(/ndm.ajax.callbackHandler/gi,cb));},fetchJSON:function(url){return null;},XHR:function(){var handleReadyState=function(o,callback){if(o&&o.readyState===4&&o.status===200){if(callback){callback(o);}}};var getXHR=function(){var http;try{http=new XMLHttpRequest;getXHR=function(){return new XMLHttpRequest;};}catch(e){var msxml=['MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP','Microsoft.XMLHTTP'];for(var i=0,len=msxml.length;i<len;++i){try{http=new ActiveXObject(msxml[i]);getXHR=function(){return new ActiveXObject(msxml[i]);};break;}catch(er){}}}
return http;};return function(method,uri,callback,postData){var http=getXHR();http.open(method,uri,true);handleReadyState(http,callback);http.send(postData||null);return http;};}()};}();_global_["@namespace"]("ndm.ajax.restService");ndm.ajax.restService.Base=function(){return{toRestUrl:function(){var point="http://www.someservice.com/my/endpoint/blah?something=something&callback=dingo";return point;}};}();ndm.ajax.restService.Digg=function(opts){var that=object(ndm.ajax.restService.Base);return that;};_global_["@namespace"]("ndm.tracking");ndm.tracking.hbx=function(_){var getElementsByClassName=function(clss,prnt,tg){ndm.dom.getElementsByClassName(clss,prnt,tg);};var _hbCookie=function(a,b){document.cookie=a+"="+b+";path=/;";};var logHBX=function(into,data,append){var sid=window.location.href.split(",")[2]||"";var mlc=hbx.mlc||"";var pn=hbx.pn||"";var log=data||(sid+"-"+mlc+"|"+pn);if(append){log=data+sid+"-"+mlc+"|"+pn;}
try{_hbSet(into,log);_hbSend();}catch(e){return false;}
return true;};_global_["@export"](_hbCookie,"_hbCookie");var old=function(){};if(typeof document.onclick==="function"){old=document.onclick;}
document.onclick=function(e){var targ=ndm.dom.getEventTarget(e);var rel=targ.getAttribute("rel");var url=targ.getAttribute("href");if(/track/.test(rel)){var s=rel.replace(/track-([a-zA-Z0-9]*)/gi,"$1")+"|"+encodeURI(window.location)+"-"+encodeURI(url);s=s.replace(/,/gi,"&#44;");_hbSet("cv.c9",s);_hbSend();}
old(e);};return{pathSectionMap:{},log:logHBX,getPathFromNav:function(){var p="";var tmps="";var candidates=getElementsByClassName("active",document.getElementById("nav"))||[];if(document.getElementById("tertiary-nav")){candidates=candidates.concat(getElementsByClassName("over",document.getElementById("tertiary-nav")));candidates=candidates.concat(getElementsByClassName("current",document.getElementById("tertiary-nav")));candidates=candidates.concat(getElementsByClassName("active",document.getElementById("tertiary-nav")));}
if(document.getElementById("quaternary-nav")){candidates=candidates.concat(getElementsByClassName("current",document.getElementById("quaternary-nav")));candidates=candidates.concat(getElementsByClassName("active",document.getElementById("quaternary-nav")));}
var loc=window.location.href;loc=loc.replace(/[01],[a-zA-Z0-9]*,[a-zA-Z0-9]*,00.html/gi,"");loc=loc.replace(/(couriermail|dailytelegraph|sundaytelegraph|sundaymail|perthnow|adelaidenow|mercury|heraldsun|sundayheraldsun)/gi,"");loc=loc.replace(/\/\/$/gi,"/Home/");loc=loc.replace(/\/\//gi,"/");loc=loc.substring((loc.indexOf(".au/")+3),loc.length);loc=loc.replace(/\/$/g,"");if(typeof(pathSectionMap)!="undefined"){for(npath in pathSectionMap){if(npath.replace(/\/$/g,"")===loc){loc=(pathSectionMap[npath]);return loc;}}}
if(candidates.length===0){return loc;}
for(var i=0;i!=candidates.length;i++){if(typeof(candidates[i])!="undefined"){if(!!candidates[i]&&!!candidates[i].nodeName){if(candidates[i].nodeName.toLowerCase()==="a"){if(candidates[i].innerHTML.length>0){tmps=candidates[i].innerHTML.replace(/<(.|\n)+?>/gi,"");p+="/"+tmps.replace(/[^a-zA-Z0-9\s]/gi,"");}}else{for(var j=0;j!=candidates[i].childNodes.length;j++){if((candidates[i].childNodes[j].nodeName.toLowerCase()==="a")&&(!candidates[i].childNodes[j].className.match(/.*(active|over|current).*/gi))){tmps=candidates[i].innerHTML.replace(/<(.|\n)+?>/gi,"");p+="/"+tmps.replace(/[^a-zA-Z0-9\s]/gi,"");}}}}}}
p=p.replace(/\s/gi,"+");return p;}}}();ndm.tracking.hbx.advice=function(_){var scrollomatic=function(args){ndm.tracking.hbx.log("cv.c14");return args;};var printStory=function(args){ndm.tracking.hbx.log("cv.c19");return args;};var galleryControls=function(args){return args;};var pageScroll=function(args){ndm.tracking.hbx.log("cv.16",ndm.dom.getPageScroll()[1],true);return args;};return{loadDefaults:function(){}};}();













/*========================================================*/












/***************************************************************************************************
*
*-- Form validation script by Peter Bailey, Copyright (c) 2001-2002
*	Version 3.71b
*	Updated on December 10, 2002
*	www.peterbailey.net
*	me@peterbailey.net
*
*	IF YOU USE THIS SCRIPT, GIVE ME CREDIT PLEASE =)
*
*	Visit http://www.peterbailey.net/fValidate/ for more info
*
*	Please contact me with any questions, comments, problems, or suggestions
*	This script has only been tested on various versions of Windows with IE4+, NS6+ and Moz1.0+
*
*	Note: This document most easily read with tab spacing set to 4
*
*******************************************************************************************************/

function validateForm(Frm, bConfirm, bDisable, bDisableR, groupError) {
	var testOk = false;
	if (groupError && fv['groupErrors'] < fv['switchToEbyE']) {
		fv['groupError'] = 1;
		errorData = new Array();
		}
	else
		fv['groupError'] = 0;

	for (var i=0; i<Frm.elements.length; i++) {						// Loops through all the form's elements
		if (Frm.elements[i].getAttribute(fv['code'])) {				// Gets the validator attribute, if exists thus starting the validation
			var validateType = Frm.elements[i].getAttribute(fv['code']);
			var validateObj = Frm.elements[i];
			testOk = false;
			var params = validateType.split("|");					// Separates validation string into parameters
			if (params[0] == 'money') {								// Sets flags for money syntax
				var dollarsign	= (params[1].indexOf('$') != -1);
				var grouping	= (params[1].indexOf(',') != -1);
				var decimal		= (params[1].indexOf('.') != -1);
				}

			if (params[params.length-1] == 'bok')					// Sets flag if field is allowed to be blank
				fv['bok'] = true;

			switch (params[0]) {									// Calls appropriate validation function based on type
				case 'blank'	: if (validateBlank(validateObj)) testOk = true; break;
				case 'equalto'	: if (validateEqualTo(validateObj, params[1], Frm)) testOk = true; break;
				case 'length'	: if (validateLength(validateObj, params[1])) testOk = true; break;
				case 'number'	: if (validateNumber(validateObj, params[1], params[2], params[3])) testOk = true; break;
				case 'numeric'	: if (validateNumeric(validateObj, params[1])) testOk = true; break;
				case 'alnum'	: if (validateAlnum(validateObj, params[1], params[2], params[3], params[4], params[5] )) testOk = true; break;
				case 'decimal'	: if (validateDecimal(validateObj, params[1], params[2] )) testOk = true; break;
				case 'decimalr'	: if (validateDecimalR(validateObj, params[1], params[2], params[3], params[4] )) testOk = true; break;
				case 'ip'		: if (validateIP(validateObj, params[1], params[2])) testOk = true; break;
				case 'ssn'		: if (validateSSN(validateObj)) testOk = true; break;
				case 'money'	: if (validateMoney(validateObj, dollarsign, grouping, decimal)) testOk = true; break;
				case 'zip'		: if (validateZip(validateObj, params[1])) testOk = true; break;
				case 'cazip'	: if (validateCAzip(validateObj)) testOk = true; break;
				case 'phone'	: if (validatePhone(validateObj)) testOk = true; break;
				case 'email'	: if (validateEmail(validateObj)) testOk = true; break;
				case 'date'		: if (validateDate(validateObj, params[1], params[2], params[3], params[4])) testOk = true; break;
				case 'cc'		: if (validateCC(validateObj)) testOk = true; break;
				case 'select'	: if (validateSelect(validateObj)) testOk = true; break;
				case 'selectm'	: if (validateSelectM(validateObj, params[1], params[2])) testOk = true; break;
				case 'selecti'	: if (validateSelectI(validateObj, params[1])) testOk = true; break;
				case 'checkbox'	: if (validateCheckbox(validateObj, params[1], params[2])) testOk = true; break;
				case 'radio'	: if (validateRadio(validateObj)) testOk = true; break;
				case 'eitheror'	: if (validateEitherOr(validateObj, params[1], params[2])) testOk = true; break;
				case 'atleast'	: if (validateAtLeast(validateObj, params[1], params[2], params[3])) testOk = true; break;
				case 'file'		: if (validateFile(validateObj, params[1])) testOk = true; break;
				case 'custom'	: if (validateCustom(validateObj)) testOk = true; break;
				// Add additional cases here
				default			: alert('Validation Type Not Found:\n'+params[0]);
				}
			if (!testOk && !fv['groupError']) return false;
			}
		}
	// Begin group error routine
	if (fv['groupError']) {
		fv['groupErrors']++;
		var alertStr = "The fields listed below have erroneous data or need to be filled in.\n\n";
		for (var i in errorData) {
//			fv['revertClass'] = errorData[i].className;
			if (typeof errorData[i].type != 'undefined'  && typeof errorData[i].name != 'undefined') {
				errorData[i].className = fv['errorClass'];
				alertStr += " -" + formatName(errorData[i]) + "\n";
				}
			else {
				var temp = errorData[i];
				temp[0].className = fv['errorClass'];
				alertStr += " -" + formatName(temp[0]) + "\n";
				}
			errorProcess(errorData[0],0,1);
			}
		if (errorData.length > 0) {
			errorData[0].focus();
			alert(alertStr);
			return false;
			}
		}
/*******************************************************
*	Any special conditions you have can be added here
********************************************************/

	if (typeof bConfirm == 'undefined') bConfirm = 0;				// Checks for submission flags
	if (typeof bDisable == 'undefined') bDisable = 0;
	if (typeof bDisableR == 'undefined') bDisableR = 0;
	if (bConfirm) {
		if(!confirm(fv['confirmMsg']))
			{
			if (fv['confirmAbortMsg'] != '') alert(fv['confirmAbortMsg']);		// Displays confim if requested
			return false;
			}
		}
	if (bDisable) Frm.elements[fv['submitButton']].disabled=true;			// Disables submit if requested
	if (bDisableR) Frm.elements[fv['resetButton']].disabled=true;			// Disables reset if requested
	return true;													// Form has been validated
	}

/***************************************************************************/
function validateBlank(formObj) {
	var objName = formatName(formObj);
	if (fv['is'].ie5 || fv['is'].mac) {
		if (formObj.value == "") {
			return errorProcess2(formObj,0,1,'Please enter the '+objName);
			}
		}
	else {
		var regex = new RegExp(/\S/);
		if (!regex.test(formObj.value)) {
			return errorProcess2(formObj,1,1,'Please enter the '+objName);
			}
		}
	return true;
	}
/***************************************************************************/
// Special function used for bok
function checkBlank(formObj) {
	if (formObj.value == "")
		return true;
	var regex = new RegExp(/^\s+$/);
	if (regex.test(formObj.value))
		return true;
	return false;
	}

/***************************************************************************/
function validateEqualTo(formObj, otherObjName, Frm) {
	var objName = formatName(formObj);
	var equalToValue = Frm.elements[otherObjName].value;

	if (formObj.value != equalToValue) {
		return errorProcess2(formObj,1,1,otherObjName+' must be the same as '+objName+'.\nPlease make sure the data you entered matches.');
		}
	return true;
	}

/***************************************************************************/
function validateLength(formObj,len) {
	var objName = formatName(formObj);
	if (fv['bok'] && checkBlank(formObj))
		{ fv['bok']=false; return true; }

	if (formObj.value.length < parseInt(len)) {
		return errorProcess2(formObj,1,1,'The '+objName+' must be at least '+len+' characters long');
		}
	return true;
	}

/***************************************************************************/
function validateNumber(formObj, type, lb, ub) {
	var objName = formatName(formObj);
	if (fv['bok'] && checkBlank(formObj))
		{ fv['bok']=false; return true; }

	var num = formObj.value;
	if (isNaN(num) || checkBlank(formObj)) {
		return errorProcess2(formObj,1,1,'Please enter a valid number');
		}
	num = (parseInt(type) == 1) ? parseFloat(num) : parseInt(num) ;
	if (num < lb || num > ub)	{
		return errorProcess2(formObj,1,1,'Please enter a number between ' + lb + ' and ' + ub);
		}
	return true;
	}

/***************************************************************************/
function validateNumeric(formObj, len) {
	if (fv['bok'] && checkBlank(formObj))
		{ fv['bok']=false; return true; }
	var objName = formatName(formObj);

	if (len == '*') {
		var regex = /^\d+$/;
		if (!regex.test(formObj.value)) {
			return errorProcess2(formObj,1,1,'Only numeric values are valid for the ' + objName);
			}
		}
	else {
		numReg = "^\\d{"+parseInt(len)+",}$"
		var regex = new RegExp(numReg);
		if (!regex.test(formObj.value)) {
			return errorProcess2(formObj,1,1,'A minimum of '+len+' numeric values are required for the ' + objName);
			}
		}
	return true;
	}

/***************************************************************************/
function validateAlnum(formObj, minLen, tCase, numbers, spaces, puncs) {
	var objName = formatName(formObj);
	if (fv['bok'] && checkBlank(formObj))
		{ fv['bok']=false; return true; }
	var arrE = new Array();
	arrE[0] = (minLen == "*") ? "None" : minLen;
	var okChars = "";
	switch (tCase.toUpperCase()) {
		case 'U'	:	okChars = "A-Z"; arrE[1] = "UPPER"; break
		case 'L'	:	okChars = "a-z"; arrE[1] = "lower"; break;
		case 'C'	:	okChars = "A-Z][a-z"; if (minLen != "*") minLen--; arrE[1]="Initial capital"; break;
		default		:	okChars = "a-zA-Z"; arrE[1]="Any"; break;
		}
	if (parseInt(numbers)) { okChars += "0-9"; arrE[2] = "Yes"; } else arrE[2] = "No";
	if (parseInt(spaces)) { okChars += " "; arrE[3] = "Yes"; } else arrE[3] = "No";
	if (puncs == "all") { okChars += "."; arrE[4] = "All"; }
	if (puncs == "all") { okChars += puncStr("!@#$%^&*()_+-={}|[]:\";'<\\>?,.?~`"); arrE[4] = "All"; }
	else if (puncs == "none") arrE[4] = "None";
	else { okChars += puncStr(puncs); arrE[4] =  puncStr(puncs).replace(/\\/g,""); }
	var length = (minLen == "*") ? "+" : "{"+minLen+",}";
	var alnumReg = "^["+okChars+"]"+length+"$";
	var regex = new RegExp(alnumReg);
	if (!regex.test(formObj.value) ) {
		return errorProcess2(formObj,1,1,"The data you entered ("+formObj.value+") does not match the requested format for the "+objName+"\nMinimum Length: "+arrE[0]+"\nCase: "+arrE[1]+"\nNumbers allowed: "+arrE[2]+"\nSpaces allowed: "+arrE[3]+"\nPunctuation characters allowed: "+arrE[4]);
		}
	return true;
	}
/***************************************************************************/
function validateDecimal(formObj, lval, rval) {
	var objName = formatName(formObj);
	if (fv['bok'] && checkBlank(formObj))
		{ fv['bok']=false; return true; }

	(lval == '*')? lval = '*': lval = parseInt(lval);
	(rval == '*')? rval = '*': rval = parseInt(rval);
	var decReg = "";
	if (lval == 0)
		decReg = "^\\.[0-9]{"+rval+"}$";
	else if (lval == '*')
		decReg = "^[0-9]"+lval+"\\.[0-9]{"+rval+"}$";
	else if (rval == '*')
		decReg = "^[0-9]{"+lval+"}\\.[0-9]"+rval+"$";
	else
		decReg = "^[0-9]{"+lval+"}\\.[0-9]{"+rval+"}$";
	var regex = new RegExp(decReg);
	if (!regex.test(formObj.value)) {
		return errorProcess2(formObj,1,1,formObj.value+' is not a valid '+objName+'.  Please re-enter the '+objName);
		}
	return true;
	}

/***************************************************************************/
function validateDecimalR(formObj, lmin, lmax, rmin, rmax) {
	var objName = formatName(formObj);
	if (fv['bok'] && checkBlank(formObj))
		{ fv['bok']=false; return true; }

	(lmin == '*')? lmin = 0: lmin = parseInt(lmin);
	(lmax == '*')? lmax = '': lmax = parseInt(lmax);
	(rmin == '*')? rmin = 0: rmin = parseInt(rmin);
	(rmax == '*')? rmax = '': rmax = parseInt(rmax);
	var	decReg = "^[0-9]{"+lmin+","+lmax+"}\\.[0-9]{"+rmin+","+rmax+"}$"
	var regex = new RegExp(decReg);
	if (!regex.test(formObj.value)) {
		return errorProcess2(formObj,1,1,formObj.value+' is not a valid '+objName+'.  Please re-enter the '+objName);
		}
	return true;
	}
/***************************************************************************/
function validateIP(formObj, portMin, portMax) {
	var objName = formatName(formObj);
	if (fv['bok'] && checkBlank(formObj))
		{ fv['bok']=false; return true; }
	if (typeof portMin == 'undefined') portMin = 0;
	if (typeof portMax == 'undefined') portMax = 99999;
	var portOk = true;
	var ipReg = "^((?:([2]{1}[0-5]{2})|([2]{1}[0-4]{1}[0-9]{1})|([1]?[0-9]{2})|([0-9]{1}))[\\.]){3}(?:([2]{1}[0-5]{2})|([2]{1}[0-4]{1}[0-9]{1})|([1]?[0-9]{2})|([0-9]{1}))(\\:[0-9]{1,5})?$"
	var portLoc = formObj.value.indexOf(":");
	if (portLoc != -1) {
		 var port = parseInt(formObj.value.substring(portLoc+1));
		 if (port < portMin || port > portMax) portOk = false;
		 }
	var regex = new RegExp(ipReg);
	if (!regex.test(formObj.value) || !portOk) {
		var errorMessage =  (regex.test(formObj.value) && !portOk) ?
			"The port number you specified, "+port+",  is out of range.\nIt must be between "+portMin+" and "+portMax :
			formObj.value+' is not a valid IP address.  Please re-enter';
		return errorProcess2(formObj,1,1,errorMessage);
		}
	return true;
	}
/***************************************************************************/
function validateSSN(formObj) {
	var objName = formatName(formObj);
	if (fv['bok'] && checkBlank(formObj))
		{ fv['bok']=false; return true; }

	var regex = new RegExp(/^\d{3}\-\d{2}\-\d{4}$/);
	if (!regex.test(formObj.value)) {
		return errorProcess2(formObj,1,1,formObj.value+' is not a valid Social Security Number.\nYour SSN must be entered in \'XXX-XX-XXXX\' format.');
		}
	return true;
	}
/***************************************************************************/
function validateMoney(formObj, ds, grp, dml) {
	var objName = formatName(formObj);
	if (fv['bok'] && checkBlank(formObj))
		{ fv['bok']=false; return true; }

	var moneySyntax;
	if (ds && grp && dml)		// Dollar sign, grouping, and decimal
		{ moneyReg = "^\\$(?:(?:[0-9]{1,3},)(?:[0-9]{3},)*[0-9]{3}|[0-9]{1,3})(\\.[0-9]{2})$";	moneySyntax = "$XX,XXX.XX"; }
	if (ds && grp && !dml)		// Dollar sign and grouping
		{ moneyReg="^\\$(?:(?:[0-9]{1,3},)(?:[0-9]{3},)*[0-9]{3}|[0-9]{1,3})$"; moneySyntax="$XX,XXX"; }
	if (ds && !grp && dml)		// Dollar sign and decimal
		{ moneyReg="^\\$[0-9]*(\\.[0-9]{2})$"; moneySyntax="$XXXXX.XX"; }
	if (!ds && grp && dml)		// Grouping and decimal
		{ moneyReg="^(?:(?:[0-9]{1,3},)(?:[0-9]{3},)*[0-9]{3}|[0-9]{1,3})(\\.[0-9]{2})?$"; moneySyntax="XX,XXX.XX"; }
	if (ds && !grp && !dml)		// Dollar sign only
		{ moneyReg="^\\$[0-9]*$"; moneySyntax="$XXXXX"; }
	if (!ds && grp && !dml)		// Grouping only
		{ moneyReg="^(?:(?:[0-9]{1,3},)(?:[0-9]{3},)*[0-9]{3}|[0-9]{1,3})$"; moneySyntax="XX,XXX"; }
	if (!ds && !grp && dml)		// Decimal only
		{ moneyReg="^[0-9]*(\\.[0-9]{2})$"; moneySyntax="XXXXX.XX"; }
	if (!ds && !grp && !dml)	// No params set, all special chars become optional
		{ moneyReg="^\\$?(?:(?:[0-9]{1,3},?)(?:[0-9]{3},?)*[0-9]{3}|[0-9]{1,3})(\\.[0-9]{2})?$"; moneySyntax="[$]XX[,]XXX[.XX]"; }
	var regex = new RegExp(moneyReg);
	if (!regex.test(formObj.value)) {
		return errorProcess2(formObj,1,1,formObj.value+' does not match the required format of '+moneySyntax+' for '+objName+'.');
		}
	return true;
	}

/***************************************************************************/
function validateSelect(formObj) {
	var objName = formatName(formObj);
	if (formObj.selectedIndex == 0) {
		return errorProcess2(formObj,0,1,"Please select the "+objName);
		}
	return true;
	}

/***************************************************************************/
function validateSelectM(formObj, minS, maxS) {
	var objName = formatName(formObj);
	var selectCount = 0;
	if (maxS == 999) maxS = formObj.length;
	for (var i=0; i<formObj.length; i++)
		{
		if (formObj.options[i].selected)
			selectCount++;
		}
	if (selectCount < minS || selectCount > maxS) {
		return errorProcess2(formObj,0,1,'Please select between '+minS+' and '+maxS+' '+objName+'.\nYou currently have '+selectCount+' selected');
		}
	return true;
	}

/***************************************************************************/
function validateSelectI(formObj, indexes) {
	var objName = formatName(formObj);
	var arrIndexes =indexes.split(/[,]/);
	var selectOK = true;
	for (var i=0; i<arrIndexes.length; i++)
		if (formObj.selectedIndex == arrIndexes[i])
			selectOK = false;
	if (!selectOK) {
		return errorProcess2(formObj,0,1,"Please select a valid option for "+objName);
		}
	return true;
	}

/***************************************************************************/
function validateZip(formObj, sep) {
	if (typeof sep == 'undefined')
		sep = "- ";
	var objName = formatName(formObj);
	if (fv['bok'] && checkBlank(formObj))
		{ fv['bok']=false; return true; }
	zipReg = "^[0-9]{5}(|["+puncStr(sep)+"]?[0-9]{4})$"
	var regex = new RegExp(zipReg);
	if (!regex.test(formObj.value)) {
		return errorProcess2(formObj,1,1,"Please enter a valid 5 or 9 digit Zip code.");
		}
	return true;
	}

/***************************************************************************/
function validateCAzip(formObj) {
	var objName = formatName(formObj);
	if (fv['bok'] && checkBlank(formObj))
		{ fv['bok']=false; return true; }

	zipReg = "^[A-Z][0-9][A-Z] [0-9][A-Z][0-9]$"
	var regex = new RegExp(zipReg);
	if (!regex.test(formObj.value)) {
		return errorProcess2(formObj,1,1,"Please enter a valid postal code.");
		}
	return true;
	}

/***************************************************************************/
function validateEmail(formObj)	{
	if (fv['bok'] && checkBlank(formObj))
		{ fv['bok']=false; return true; }

	var emailStr = formObj.value;
	var emailReg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
	var emailReg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,6}|[0-9]{1,3})(\]?)$/; // valid
	if (!(!emailReg1.test(emailStr) && emailReg2.test(emailStr))) {// if syntax is valid
		return errorProcess2(formObj,1,1,"Please enter a valid Email address.");
		}
	return true;
	}

/***************************************************************************/


function validateDate(formObj, dateStr, delim, code, specDate) {
	var objName = formatName(formObj);
	if (fv['bok'] && checkBlank(formObj))
		{ fv['bok']=false; return true; }

	var months = ['January','February','March','April','May','June','July','August','September','October','November','December'];
	var vDate = formObj.value;
	var mPlace = dateStr.indexOf("m");
	var dPlace = dateStr.indexOf("d");
	var yPlace = dateStr.indexOf("y");
	var yLength = dateStr.lastIndexOf("y") - yPlace + 1;
	var dateReg = dateStr.replace(/\w/g,"\\d");
	delim = puncStr(delim);
	dateReg = dateReg.replace(/-/g,"[" + delim + "]");
	dateReg = "^" + dateReg + "$";
	var day = vDate.substring(dPlace, dPlace+2);
	var month = vDate.substring(mPlace, mPlace+2);
	var year = vDate.substring(yPlace, yPlace + yLength);
	var regex = new RegExp(dateReg);
	var d = new Date(months[month-1] + " " + day + ", " + year);
	var today = (specDate == 'today') ? new Date() : new Date(specDate);
	today.setHours(0);
	today.setMinutes(0);
	today.setSeconds(0);
	today.setMilliseconds(0);
	var timeDiff = today.getTime() - d.getTime();
	var dateOk = false;
	switch (parseInt(code)) {
		case 1 : // Before specDate
			dateOk = (timeDiff > 0);
			break;
		case 2 : // Before or on specDate
			dateOk = ((timeDiff + 86400000) > 0);
			break;
		case 3 : // After specDate
			dateOk = (timeDiff < 0);
			break;
		case 4 : // After or on specDate
			dateOk = ((timeDiff - 86400000) < 0);
			break;
		default : dateOk = true;
		}
	if (!regex.test(vDate) || d == 'NaN' || !dateOk) {
		return errorProcess2(formObj,1,1,"Please enter a valid date");
		}
	return true;
	}

/***************************************************************************/
function validatePhone(formObj)	{
	var objName = formatName(formObj);
	if (fv['bok'] && checkBlank(formObj))
		{ fv['bok']=false; return true; }

	phoneReg = "^(?:[\(][0-9]{3}[\)]|[0-9]{3})[-. ]?[0-9]{3}[-. ]?[0-9]{4}$";
	var regex = new RegExp(phoneReg);
	if (!regex.test(formObj.value)) {
		return errorProcess2(formObj,1,1,"Please enter a valid Phone number plus Area Code.");
		}
	return true;
	}

/***************************************************************************/
function validateCheckbox(formObj, minC, maxC) {
	var objName = formatName(formObj);
	var formObj = formObj.form.elements[formObj.name];
	var checkTotal = formObj.length;
	var checkCount = 0;

	if (maxC == 999) maxC = checkTotal;
	for (var i=0; i<checkTotal; i++) {
		if (formObj[i].checked) checkCount++;
		}
	if (checkCount < minC || checkCount > maxC) {
		if (fv['groupError']) { addError(formObj); return true; }
		alert('Please select between '+minC+' and '+maxC+' options for '+objName+'.\nYou currently have '+checkCount+' selected');
		for (i=formObj.length-1; i>=0; i--)
			errorProcess(formObj[i],0,1);
		return false;
		}
	return true;
	}

/***************************************************************************/
function validateRadio(formObj) {
	var objName = formatName(formObj);
	var formObj = formObj.form.elements[formObj.name];
	var selectTotal = 0;

	for (i=0; i<formObj.length; i++)
		if (formObj[i].checked)
			selectTotal++;

	if (selectTotal != 1) {
		if (fv['groupError']) { addError(formObj); return true; }
		alert((formObj[0].getAttribute(fv['emsg'])) ? formObj[0].getAttribute(fv['emsg']) : 'Please select an option for '+objName);
		for (i=formObj.length-1; i>=0; i--)
			errorProcess(formObj[i],0,1);
		return false;
		}
	return true;
	}
/***************************************************************************/
function validateEitherOr(formObj, del, fields) {
	var f = formObj.form;
	var arrF = fields.split(del);
	var nbCount = 0;
	var list = "";
	for (var i=0; i<arrF.length; i++) {
		list += " -"+formatName(f.elements[arrF[i]])+"\n";
		if (!checkBlank(f.elements[arrF[i]]))
			nbCount++;
		}
	if (nbCount != 1) {
		if (fv['groupError']) { addError(f.elements[arrF[0]]); return true; }
		alert((formObj.getAttribute(fv['emsg'])) ? formObj.getAttribute(fv['emsg']) : "Only one of the following fields may be filled in:\n"+list);
		for (var i=0; i<arrF.length; i++)
			errorProcess(f.elements[arrF[i]],0,0);
		return false;
		}
	return true;
	}
/***************************************************************************/
function validateAtLeast(formObj, qty, del, fields) {
	var f = formObj.form;
	var arrF = fields.split(del);
	var nbCount = 0;
	var list = "";
	for (var i=0; i<arrF.length; i++) {
		list += " -"+formatName(f.elements[arrF[i]])+"\n";
		if (!checkBlank(f.elements[arrF[i]])) {
			nbCount++;
			}
		}
	if (nbCount < parseInt(qty)) {
		if (fv['groupError']) { addError(f.elements[arrF[0]]); return true; }
		alert((formObj.getAttribute(fv['emsg'])) ? formObj.getAttribute(fv['emsg']) : "At least "+qty+" of the following fields must be filled in:\n"+list);
		for (var i=0; i<arrF.length; i++)
			errorProcess(f.elements[arrF[i]],0,0);
		return false;
		}
	return true;
	}
/***************************************************************************/
function validateFile(formObj, extensions, cSens) {
	var objName = formatName(formObj);
	if (fv['bok'] && checkBlank(formObj))
		{ fv['bok']=false; return true; }

	cSens = (cSens) ? "" : "i";
	regExten = extensions.replace(/,/g,"|");
	var fileReg = "^.+\\.("+regExten+")$";
	var regex = new RegExp(fileReg,cSens);
	if (!regex.test(formObj.value)) {
		return errorProcess2(formObj,1,1,"The file must be one of the following types:\n"+extensions+"\nNote: File extention may be case-sensitive");
		}
	return true;
	}
/***************************************************************************/
function validateCustom(formObj) {
	var objName = formatName(formObj);
	if (fv['bok'] && checkBlank(formObj))
		{ fv['bok']=false; return true; }

	var regex = new RegExp(formObj.getAttribute(fv['pattern']));
	if (!regex.test(formObj.value)) {
		return errorProcess2(formObj,1,1,"The "+objName+" is invalid.");
		}
	return true;
	}
/****************************************************************************
*	Here are all the ancillary functions
****************************************************************************/
function addError(o) {
	errorData[errorData.length] = o;
	}
/***************************************************************************/
function formatName(o) {
	var wStr = (o.name) ? o.name : o.id;
	wStr = wStr.replace(/_/g," ");
	return wStr;
	}
/***************************************************************************/
function errorProcess(o, sel, foc) {
	fv['revertClass'] = o.className;
	o.className = fv['errorClass'];
	if (sel) o.select();
	if (foc) o.focus();
	}

function errorProcess2(o, sel, foc, error) {
	var ret = false;
	if (fv['groupError']) { addError(o); ret = true; }
	else {
		alert((o.getAttribute(fv['emsg'])) ? o.getAttribute(fv['emsg']) : error);
		if (sel) o.select();
		if (foc) o.focus();
		}
	fv['revertClass'] = o.className;
	o.className = fv['errorClass'];
	return ret;
	}
/***************************************************************************/
function clearStyle(o) {
	if (o.className == fv['errorClass']) o.className = fv['revertClass'];
	}
/***************************************************************************/
function puncStr(str) {
	str = str.replace("pipe", "|");
	return str.replace(/([\\\|\(\)\[\{\^\$\*\+\?\.])/g,"\\$1");
//	return str.replace(/([\!\@\#\$\%\^\&\*\(\)\_\+\-\=\{\}\|\[\]\\\:\"\;\'\<\>\?\,\.\/])/g,"\\$1");
	}

/*****************************************************************************************************
*	CREDIT CARD FUNCTIONS
*
*********** WARNING: DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING! ****************/

function cleanupCCNum(ccNum) {
	return ccNum.replace(/\D/g,'');
	}
/***************************************************************************/
function validateCC(formObj) {
	if (fv['bok'] && checkBlank(formObj))
		{ fv['bok']=false; return true; }
	var objName = formatName(formObj);

	switch (formObj.form.elements[fv['ccType']].value.toUpperCase()) {
		case 'VISA'		: var ccReg = /^4\d{12}(\d{3})?$/; break;
		case 'MC'		: var ccReg = /^5[1-5]\d{14}$/; break;
		case 'DISC'		: var ccReg = /^6011\d{12}$/; break;
		case 'AMEX'		: var ccReg = /^3[4|7]\d{13}$/; break;
		case 'DINERS'	: var ccReg = /^3[0|6|8]\d{12}$/; break;
		case 'ENROUTE'	: var ccReg = /^2[014|149]\d{11}$/; break;
		case 'JCB'		: var ccReg = /^3[088|096|112|158|337|528]\d{12}$/; break;
		case 'SWITCH'	: var ccReg = /^(49030[2-9]|49033[5-9]|49110[1-2]|4911(7[4-9]|8[1-2])|4936[0-9]{2}|564182|6333[0-4][0-9]|6759[0-9]{2})\d{10}(\d{2,3})?$/; break;
		case 'DELTA'	: var ccReg = /^4(1373[3-7]|462[0-9]{2}|5397[8|9]|54313|5443[2-5]|54742|567(2[5-9]|3[0-9]|4[0-5])|658[3-7][0-9]|659(0[1-9]|[1-4][0-9]|50)|844[09|10]|909[6-7][0-9]|9218[1|2]|98824)\d{10}$/; break;
		case 'SOLO'		: var ccReg = /^(6334[5-9][0-9]|6767[0-9]{2})\d{10}(\d{2,3})?$/; break;
		// Add additonal card types here
		default			: if (!fv['groupError']) alert('Error! Card Type not found!'); return false;
		}
	var formatOK = ccReg.test(formObj.value);
	var luhnOK = validateLUHN(formObj.value);
	if (!formatOK || !luhnOK) {
		return errorProcess2(formObj,1,1,'The '+objName+' you entered is not valid. Please check again and re-enter');
		}
	return true;
	}
/***************************************************************************/
function validateLUHN(ccString) {
	var odds = "";
	var evens = "";
	var i=1;

	for (i=ccString.length-2; i>=0; i=i-2) {
		var digit = parseInt(ccString.charAt(i)) * 2;
		odds += digit+"";
		}
	for (i=ccString.length-1; i>=0; i=i-2)
		evens += ccString.charAt(i);
	var luhnStr = odds + evens;
	var checkSum = 0;
	for (i=0; i<luhnStr.length; i++)
		checkSum += parseInt(luhnStr.charAt(i));
	return (checkSum % 10 == 0);
	}

























var fv = new Array()

/****************************************************
*	Globals.  Modify these to suit your setup
****************************************************/

//	Attribute used for fValidate Validator codes
fv['code'] = 'alt';

//	Attribute used for custom error messages (override built-in error messages)
fv['emsg'] = 'emsg';

//	Attribute used for pattern with custom validator type
fv['pattern'] = 'pattern';

//	Change this to the classname you want for the error highlighting
fv['errorClass'] = 'errHilite';

//	If the bConfirm flag is set to true, the users will be prompted with CONFIRM box with this message
fv['confirmMsg'] = 'Your Data is about to be sent.\nPlease click \'Ok\' to proceed or \'Cancel\' to abort.';

//	If user cancels CONFIRM, then this message will be alerted.  If you don't want this alert to show, then
//	empty the variable (  fv['confirmAbortMsg'] = '';  )
fv['confirmAbortMsg'] = 'Submission cancelled.  Data has not been sent.';

//	Enter the name/id of your form's submit button here (works with type=image too)
fv['submitButton'] = 'Submit';

//	Enter the name/id of your form's reset button here (works with type=image too)
fv['resetButton'] = 'Reset';

//	Ender the name or id of the SELECT object here. Make sure you pay attention to the values (CC Types)
//	used in the case statement for the function validateCC()
fv['ccType'] = 'Credit_Card_Type';

//	NOTE: The config value below exists for backwards compatibility with fValidate 3.55b.  If you have a newer
//	version, use the above fv['ccType'] instead.
//	Enter the DOM name of the SELECT object here. Make sure you pay attention to the values (CC Types)
//	used in the case statement for the function validateCC()
fv['ccTypeObj'] = 'form1.Credit_Card_Type';

//	Number of group error mode alerts before switching to normal error mode
fv['switchToEbyE'] = 3;

/**********************************************************
*	Do not edit This section. Start below
***********************************************************/

function FV_bs() {
	this.ver = navigator.appVersion; //Cheking for browser version
	this.agent = navigator.userAgent; //Checking for browser type
    var minor = parseFloat(this.ver);
    var major = parseInt(minor);
	this.dom = document.getElementById?1:0;
	this.opera = (this.agent.indexOf("opera") != -1);
	var iePos  = this.ver.indexOf('msie');
	if (iePos !=-1) {
		minor = parseFloat(this.ver.substring(iePos+5,this.ver.indexOf(';',iePos)))
		major = parseInt(minor);
		}
	this.ie = ((iePos!=-1) && (!this.opera));
	this.gecko = ((navigator.product)&&(navigator.product.toLowerCase()=="gecko"))?true:false;
    this.ie4   = (this.ie && major == 4);
    this.ie4up = (this.ie && minor >= 4);
    this.ie5   = (this.ie && major == 5);
    this.ie5up = (this.ie && minor >= 5);
    this.ie5_5  = (this.ie && (this.agent.indexOf("msie 5.5") !=-1));
    this.ie5_5up = (this.ie && minor >= 5.5);
    this.ie6   = (this.ie && major == 6);
    this.ie6up = (this.ie && minor >= 6);
	this.mac = this.agent.indexOf("Mac")>-1;
	}

/****************************************************
*	Constants. Do not edit
****************************************************/

//	Global used for flagging the validateBlank() function within most other validation functions
fv['bok'] = false;

//	Global used for class switching.
fv['revertClass'] = '';

//	Placeholder for Group Error boolean
fv['groupError'] = 0;

//	Placeholder for number of group error alerts
fv['groupErrors'] = 0;

//	Browser Sniffer
fv['is'] = new FV_bs();

//	Array for error totalling while in group error mode
var errorData = new Array();

//	EOF























/* ---- font size change  ---- */
/* --------------------------- */

var curFontSize = 1; 	// curFontSize needs to be the same as the font size for paragraphs, as set in the css (in pixels)
var fontModifier = 0.1; 	// how much to increase/decrease font size each time (in pixels)

function textSizing(act) {
        tmpStoryBody = document.getElementById("articlestory");
        if (act == 1) {
            curFontSize += fontModifier;
            curFontSize = Math.min(curFontSize, 2);
        }
        else if (act == 0) {
            curFontSize -= fontModifier;
            curFontSize = Math.max(curFontSize, 0.7);
        }
        tmpStoryBody.style.fontSize = curFontSize + "em";
		for (v = 0; v < tmpStoryBody.getElementsByTagName("p").length; v++) {
           tmpStoryBody.getElementsByTagName("p")[v].style.fontSize = curFontSize + "em";  }
}

/* ------------------------------ */
/* ---- // font size change  ---- */


function display_email_friend_popup(selected_url) {
	var url = 'http://tools.cairns.com.au/forms/email_friend.php?selected_url=' + selected_url;
        window.open(url,'EmailFriend','width=600,height=500');
}       // end function display_email_friend_popup

function getlink(selObj, linkTarget) {
	theLink = selObj.options[selObj.selectedIndex].value;
	if (theLink == '/advertising/place.html') {
		popupform('http://' + document.domain + '/' + theLink);
	}
	else {
		if (linkTarget == 0) {
			currentsite('http://' + document.domain + '/' + theLink);
		}
		else if (linkTarget == 1) {
			externalsite(theLink);
		}
		else if (linkTarget == 2) {
			popupform('http://' + document.domain + '/' + theLink);
		}
	}
	selObj.selectedIndex=0;
}
function popupform(fileName) {
	window.open(fileName,'popupWin','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=510,height=550,left=150,top=50');
}
function currentsite(fileName) {
	window.open(fileName,'_self');
}
function externalsite(fileName) {
	window.open(fileName,'_blank');
}
function showsubmenu(layername) {
        document.getElementById('feedbacksub').className = 'submenu';
		document.getElementById('advertsub').className = 'submenu';
		document.getElementById('classifiedsub').className = 'submenu';
		document.getElementById('picturessub').className = 'submenu';
		document.getElementById('sectionssub').className = 'submenu';
		document.getElementById('newssub').className = 'submenu';

		layerchange = document.getElementById(layername);
        layerchange.className = 'submenuOn';
}



function poll_popup(poll, answer) {
                        window.open('http://tools.goldcoast.com.au/polls/poll_popup.php?poll_id='+poll+'&answer='+answer, '_blank', 'height=250,width=400,location=no,menubar=no,status=no,toolbar=no');
                }





/*
Auto center window script- Eric King (http://redrival.com/eak/index.shtml)
Permission granted to Dynamic Drive to feature script in archive
For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}


/* li hover fix for IE6 */
sfHover = function() {
	var sfEls = document.getElementById("top-nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);



//** Featured Content Slider script- (c) Dynamic Drive DHTML code library: http://www.dynamicdrive.com.
//** May 2nd, 08'- Script rewritten and updated to 2.0.
//** June 12th, 08'- Script updated to v 2.3, which adds the following features:
			//1) Changed behavior of script to actually collapse the previous content when the active one is shown, instead of just tucking it underneath the later.
			//2) Added setting to reveal a content either via "click" or "mouseover" of pagination links (default is former).
			//3) Added public function for jumping to a particular slide within a Featured Content instance using an arbitrary link, for example.

//** July 11th, 08'- Script updated to v 2.4:
			//1) Added ability to select a particular slide when the page first loads using a URL parameter (ie: mypage.htm?myslider=4 to select 4th slide in "myslider")
			//2) Fixed bug where the first slide disappears when the mouse clicks or mouses over it when page first loads.

var featuredcontentslider={

//3 variables below you can customize if desired:
ajaxloadingmsg: '<div style="margin: 20px 0 0 20px"><img src="loading.gif" /> Fetching slider Contents. Please wait...</div>',
bustajaxcache: true, //bust caching of external ajax page after 1st request?
enablepersist: true, //persist to last content viewed when returning to page?

settingcaches: {}, //object to cache "setting" object of each script instance

jumpTo:function(fcsid, pagenumber){ //public function to go to a slide manually.
	this.turnpage(this.settingcaches[fcsid], pagenumber)
},

ajaxconnect:function(setting){
	var page_request = false
	if (window.ActiveXObject){ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
		try {
		page_request = new ActiveXObject("Msxml2.XMLHTTP")
		}
		catch (e){
			try{
			page_request = new ActiveXObject("Microsoft.XMLHTTP")
			}
			catch (e){}
		}
	}
	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
		page_request = new XMLHttpRequest()
	else
		return false
	var pageurl=setting.contentsource[1]
	page_request.onreadystatechange=function(){
		featuredcontentslider.ajaxpopulate(page_request, setting)
	}
	document.getElementById(setting.id).innerHTML=this.ajaxloadingmsg
	var bustcache=(!this.bustajaxcache)? "" : (pageurl.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
	page_request.open('GET', pageurl+bustcache, true)
	page_request.send(null)
},

ajaxpopulate:function(page_request, setting){
	if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
		document.getElementById(setting.id).innerHTML=page_request.responseText
		this.buildpaginate(setting)
	}
},

buildcontentdivs:function(setting){
	var alldivs=document.getElementById(setting.id).getElementsByTagName("div")
	for (var i=0; i<alldivs.length; i++){
		if (this.css(alldivs[i], "contentdiv", "check")){ //check for DIVs with class "contentdiv"
			setting.contentdivs.push(alldivs[i])
				alldivs[i].style.display="none" //collapse all content DIVs to begin with
		}
	}
},

buildpaginate:function(setting){
	this.buildcontentdivs(setting)
	var sliderdiv=document.getElementById(setting.id)
	var pdiv=document.getElementById("paginate-"+setting.id)
	var phtml=""
	var toc=setting.toc
	var nextprev=setting.nextprev
	if (typeof toc=="string" && toc!="markup" || typeof toc=="object"){
		for (var i=1; i<=setting.contentdivs.length; i++){
			phtml+='<a href="#'+i+'" class="toc">'+(typeof toc=="string"? toc.replace(/#increment/, i) : toc[i-1])+'</a> '
		}
		phtml=(nextprev[0]!=''? '<a href="#prev" class="prev">'+nextprev[0]+'</a> ' : '') + phtml + (nextprev[1]!=''? '<a href="#next" class="next">'+nextprev[1]+'</a>' : '')
		pdiv.innerHTML=phtml
	}
	var pdivlinks=pdiv.getElementsByTagName("a")
	var toclinkscount=0 //var to keep track of actual # of toc links
	for (var i=0; i<pdivlinks.length; i++){
		if (this.css(pdivlinks[i], "toc", "check")){
			if (toclinkscount>setting.contentdivs.length-1){ //if this toc link is out of range (user defined more toc links then there are contents)
				pdivlinks[i].style.display="none" //hide this toc link
				continue
			}
			pdivlinks[i].setAttribute("rel", ++toclinkscount) //store page number inside toc link
			pdivlinks[i][setting.revealtype]=function(){
				featuredcontentslider.turnpage(setting, this.getAttribute("rel"))
				return false
			}
			setting.toclinks.push(pdivlinks[i])
		}
		else if (this.css(pdivlinks[i], "prev", "check") || this.css(pdivlinks[i], "next", "check")){ //check for links with class "prev" or "next"
			pdivlinks[i].onclick=function(){
				featuredcontentslider.turnpage(setting, this.className)
				return false
			}
		}
	}
	this.turnpage(setting, setting.currentpage, true)
	if (setting.autorotate[0]){ //if auto rotate enabled
		pdiv[setting.revealtype]=function(){
			featuredcontentslider.cleartimer(setting, window["fcsautorun"+setting.id])
		}
		sliderdiv["onclick"]=function(){ //stop content slider when slides themselves are clicked on
			featuredcontentslider.cleartimer(setting, window["fcsautorun"+setting.id])
		}
		setting.autorotate[1]=setting.autorotate[1]+(1/setting.enablefade[1]*50) //add time to run fade animation (roughly) to delay between rotation
	 this.autorotate(setting)
	}
},

urlparamselect:function(fcsid){
	var result=window.location.search.match(new RegExp(fcsid+"=(\\d+)", "i")) //check for "?featuredcontentsliderid=2" in URL
	return (result==null)? null : parseInt(RegExp.$1) //returns null or index, where index (int) is the selected tab's index
},

turnpage:function(setting, thepage, autocall){
	var currentpage=setting.currentpage //current page # before change
	var totalpages=setting.contentdivs.length
	var turntopage=(/prev/i.test(thepage))? currentpage-1 : (/next/i.test(thepage))? currentpage+1 : parseInt(thepage)
	turntopage=(turntopage<1)? totalpages : (turntopage>totalpages)? 1 : turntopage //test for out of bound and adjust
	if (turntopage==setting.currentpage && typeof autocall=="undefined") //if a pagination link is clicked on repeatedly
		return
	setting.currentpage=turntopage
	setting.contentdivs[turntopage-1].style.zIndex=++setting.topzindex
	this.cleartimer(setting, window["fcsfade"+setting.id])
	setting.cacheprevpage=setting.prevpage
	if (setting.enablefade[0]==true){
		setting.curopacity=0
		this.fadeup(setting)
	}
	if (setting.enablefade[0]==false){ //if fade is disabled, fire onChange event immediately (verus after fade is complete)
		setting.contentdivs[setting.prevpage-1].style.display="none" //collapse last content div shown (it was set to "block")
		setting.onChange(setting.prevpage, setting.currentpage)
	}
	setting.contentdivs[turntopage-1].style.visibility="visible"
	setting.contentdivs[turntopage-1].style.display="block"
	if (setting.prevpage<=setting.toclinks.length) //make sure pagination link exists (may not if manually defined via "markup", and user omitted)
		this.css(setting.toclinks[setting.prevpage-1], "selected", "remove")
	if (turntopage<=setting.toclinks.length) //make sure pagination link exists (may not if manually defined via "markup", and user omitted)
		this.css(setting.toclinks[turntopage-1], "selected", "add")
	setting.prevpage=turntopage
	if (this.enablepersist)
		this.setCookie("fcspersist"+setting.id, turntopage)
},

setopacity:function(setting, value){ //Sets the opacity of targetobject based on the passed in value setting (0 to 1 and in between)
	var targetobject=setting.contentdivs[setting.currentpage-1]
	if (targetobject.filters && targetobject.filters[0]){ //IE syntax
		if (typeof targetobject.filters[0].opacity=="number") //IE6
			targetobject.filters[0].opacity=value*100
		else //IE 5.5
			targetobject.style.filter="alpha(opacity="+value*100+")"
	}
	else if (typeof targetobject.style.MozOpacity!="undefined") //Old Mozilla syntax
		targetobject.style.MozOpacity=value
	else if (typeof targetobject.style.opacity!="undefined") //Standard opacity syntax
		targetobject.style.opacity=value
	setting.curopacity=value
},


fadeup:function(setting){
	if (setting.curopacity<1){
		this.setopacity(setting, setting.curopacity+setting.enablefade[1])
		window["fcsfade"+setting.id]=setTimeout(function(){featuredcontentslider.fadeup(setting)}, 50)
	}
	else{ //when fade is complete
		if (setting.cacheprevpage!=setting.currentpage) //if previous content isn't the same as the current shown div (happens the first time the page loads/ script is run)
			setting.contentdivs[setting.cacheprevpage-1].style.display="none" //collapse last content div shown (it was set to "block")
		setting.onChange(setting.cacheprevpage, setting.currentpage)
	}
},

cleartimer:function(setting, timervar){
	if (typeof timervar!="undefined"){
		clearTimeout(timervar)
		clearInterval(timervar)
		if (setting.cacheprevpage!=setting.currentpage){ //if previous content isn't the same as the current shown div
			setting.contentdivs[setting.cacheprevpage-1].style.display="none"
		}
	}
},

css:function(el, targetclass, action){
	var needle=new RegExp("(^|\\s+)"+targetclass+"($|\\s+)", "ig")
	if (action=="check")
		return needle.test(el.className)
	else if (action=="remove")
		el.className=el.className.replace(needle, "")
	else if (action=="add")
		el.className+=" "+targetclass
},

autorotate:function(setting){
 window["fcsautorun"+setting.id]=setInterval(function(){featuredcontentslider.turnpage(setting, "next")}, setting.autorotate[1])
},

getCookie:function(Name){
	var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
	if (document.cookie.match(re)) //if cookie found
		return document.cookie.match(re)[0].split("=")[1] //return its value
	return null
},

setCookie:function(name, value){
	document.cookie = name+"="+value

},


init:function(setting){
	var persistedpage=this.getCookie("fcspersist"+setting.id) || 1
	var urlselectedpage=this.urlparamselect(setting.id) //returns null or index from: mypage.htm?featuredcontentsliderid=index
	this.settingcaches[setting.id]=setting //cache "setting" object
	setting.contentdivs=[]
	setting.toclinks=[]
	setting.topzindex=0
	setting.currentpage=urlselectedpage || ((this.enablepersist)? persistedpage : 1)
	setting.prevpage=setting.currentpage
	setting.revealtype="on"+(setting.revealtype || "click")
	setting.curopacity=0
	setting.onChange=setting.onChange || function(){}
	if (setting.contentsource[0]=="inline")
		this.buildpaginate(setting)
	if (setting.contentsource[0]=="ajax")
		this.ajaxconnect(setting)
}

}

