$(document).ready(function() {
// Customer Logged In OR Logged Out
	if (loggedIn) {
		$(".loggedin").show();
		$(".loggedout").hide();
// 			Update all URLS to become SSL if loggedIn		
//			$("a[href*='digitalchameleon.net'], a[href*='digitalchameleon.net.au'], a[href*='digitalchameleon.com.au'], a[href*='digitalchameleon.prettypollution'], a[href^='/']").each(function() {
//				if (!$(this).hasClass("logout-link")) {
//					this.href = this.href.replace(/^http:\/\/[\w.]*\.(com|net)\.*a*u*/, "https://digitalchameleon.worldsecuresystems.com");
//				}
//			});			
	} else {
		$(".loggedin").hide();
		$(".loggedout").show();
//		if($('body#logout-page').length != 0)
//		{
//			$("a[href^='/']").each(function() {
//				this.href = this.href.replace(/^https*\:\/\/[\w.]*\.(com|net)\.*a*u*/, "http://www.digitalchameleon.net");
//			});
//		}
	}

	/* Client Slides */
	$('.client-pics').cycle({
		fx:    'fade', 
		speed:    300, 
		timeout:  2000 
	});
	
	$("ul.zoneSubscriptions li ul li:nth-child(2)").before("<span style='float: left; padding: 0 15px 0 0;'> Expiry: </span>");

});

/* Launch Training Flash Files in a new window */

function LaunchPresentation(bChromeless, bResize)
{
	var nWidth = screen.availWidth;
	var nHeight = screen.availHeight;

	// Get the width
	if (nWidth > 820)
	{
		nWidth = 980;
		nHeight = 640;
	}

	// Build the options string
	var strOptions = "width=" + nWidth +",height=" + nHeight;
	if (bResize)
	{
		strOptions += ",resizable=yes"
	}

	if (bChromeless)
	{
		strOptions += ", status=0, toolbar=0, location=0, menubar=0, scrollbars=0";
	}
	else
	{
		strOptions += ", status=1, toolbar=1, location=1, menubar=1, scrollbars=1";
	}

	// Launch the URL
	window.open("player.html" , "_blank", strOptions);

};

/* Suckerfish Menu for IE6 */

sfHover = function() {
	var sfEls = document.getElementById("nav_501317").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);
