
//////////////////////////////////////////////////////////////////////////////////////
/////////////////////// ACCORDIAN FUNCTIONS /////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////


var _glbAccord = "";
var _glbAccordActive = 0;

function accordControl(num){
	document.getElementById('accordLinkDetail'+num).innerHTML = "";
		if (_glbAccordActive == 0){
			if(_glbAccord != ""){
				closeContent(num);
			}
			showContent(num);
		}
}

function closeContent(num){

/*	document.getElementById('accordExpandTitle'+_glbAccord).style.display = "none";
	document.getElementById('accordLinks'+_glbAccord).style.display = "none";
	document.getElementById('accordLinkDetail'+_glbAccord).style.display = "none";*/
	currentNum=_glbAccord;
	


	closeDetails = new Tween(document.getElementById('accordContent'+currentNum).style,'height',Tween.regularEaseInOut,185,0,.5,'px');
		
		closeDetails.onMotionFinished = function(){	
		
			document.getElementById('accordHead'+currentNum).className = "accordHead";
			document.getElementById('titleText'+currentNum).className = "orngText";
			//opacityTween = new OpacityTween(document.getElementById('accordHead'+_glbAccord),Tween.regularEaseOut, 0, 100, 1);
			//opacityTween.start();
			//document.getElementById('accordContent'+currentNum).style.display = "none";
			//contentTween = new OpacityTween(document.getElementById('accordContent'+_glbAccord),Tween.regularEaseOut, 100, 0, .5);
			//contentTween.start();
/*			document.getElementById('accordExpandTitle'+currentNum).style.display = "none";
			document.getElementById('accordLinks'+currentNum).style.display = "none";
			document.getElementById('accordLinkDetail'+currentNum).style.display = "none";*/
		}
		
	closeDetails.start();
		
	_glbAccord = num;
}

function showContent(num){
	if(_glbAccordActive == 0){
	
		//document.getElementById('accordHead'+num).style.display = "none";
		
		document.getElementById('accordHead'+num).className = "accordHeadClear";
		document.getElementById('titleText'+num).className = "accordTitleGrey";
		showDetails = new Tween(document.getElementById('accordContent'+num).style,'height',Tween.regularEaseInOut,0,185,.5,'px');
	
		showDetails.onMotionStarted = function(){
			_glbAccordActive = 1;
			//contentTween = new OpacityTween(document.getElementById('accordContent'+num),Tween.regularEaseOut, 0, 100, .3);
			//contentTween.onMotionStarted =  function(){
				document.getElementById('accordContent'+num).style.display = "block";
			//}
			//contentTween.start();
			
		}
		
		showDetails.onMotionFinished = function(){
			//document.getElementById('accordExpandTitle'+num).style.display = "block";
			//titleTween = new OpacityTween(document.getElementById('accordExpandTitle'+num),Tween.regularEaseOut, 0, 100, .1);
			//titleTween.start();
			
			//document.getElementById('accordLinks'+num).style.display = "block";
			//linksTween = new OpacityTween(document.getElementById('accordLinks'+num),Tween.regularEaseOut, 0, 100,.1);
			//linksTween.start();
			
			//document.getElementById('accordLinkDetail'+num).style.display = "block";
			//linksDetailTween = new OpacityTween(document.getElementById('accordLinkDetail'+num),Tween.regularEaseOut, 0, 100,.1);
			//linksDetailTween.start();
			_glbAccordActive = 0;
		 }
			
		showDetails.start();
		
		_glbAccord = num;
	}
}
/////////////////////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////////////////////
///////////     SUB NAV FUNCTIONS     ///////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////

var _gblSubNavName = "";
var _glbMenuActive = 0;

function subNavControl(subNavName){

	if(_glbMenuActive == 0){
		if(_gblSubNavName != ""){
			closeSubNav(_gblSubNavName);
		}
		
		if(subNavName != 'subnavblank'){
			openSubNav(subNavName);
		}
	}
}

function openSubNav(subNavName){

	if(document.getElementById('subNav').style.height == '' && _glbMenuActive == 0){
		subNavTween = new Tween(document.getElementById('subNav').style,'height',Tween.regularEaseInOut,0,32,.5,'px');
		
		subNavTween.onMotionStarted = function(){
			_glbMenuActive = 1;
		}
		subNavTween.onMotionFinished = function(){
			document.getElementById(subNavName).style.display = "block";
			_glbMenuActive = 0;
		}

		subNavTween.start();
		
		
	}else{
		document.getElementById(subNavName).style.display = "block";
	}
	

	_gblSubNavName = subNavName;

}

function closeSubNav(subNavName){

	document.getElementById(subNavName).style.display = "none";
	
	_gblSubNavName = subNavName;
}

/////////////////////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////////////////////
/////////////////  JUST LAUNCHED IMAGES /////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////

var imgCount = 1;

var launchImages = new Array();

	
	
	launchImages[0] = new Array();
	launchImages[0].image = "launchBGImage12.jpg";
	launchImages[0].Title = "FISHING CAMPING OUTDOORS - NZ  <br>E-COMMERCE WEBSITE DEVELOPMENT";
	launchImages[0].Text = "This site builds and extends upon the eCommerce framework developed by Emu for our clients.  The site introduces e-commerce to the FCO brand as well as paid loyalty club membership and social media integration.<br><br><table border=0 cellpadding=0 cellspacing=0 style='margin-left: -6px;' align=right><tr valign=middle><td><div class='folderImage'></div></td><td><a href='/portfolio.cfm?portfolio_category=web' class='orngLink' style='font-size: 11px; color: #ffffff; font-weight: bold;'> View Our Portfolio</a></td></tr></table>";
	
	launchImages[1] = new Array();
	launchImages[1].image = "launchBGImage11.jpg";
	launchImages[1].Title = "NAB EQUITY LENDING<br>WEBSITE REDEVELOPMENT";
	launchImages[1].Text = "Emu worked with the NAB to redevelop their Equity Lending website that is used by clients and advisors. In a joint project with the Broker Services Division (another division of GBST), the new website was developed allowing clients to see real-time portfolio positions and transactions.<br><br><table border=0 cellpadding=0 cellspacing=0 style='margin-left: -6px;' align=right><tr valign=middle><td><div class='folderImage'></div></td><td><a href='/portfolio.cfm?portfolio_category=web' class='orngLink' style='font-size: 11px; color: #ffffff; font-weight: bold;'> View Our Portfolio</a></td></tr></table>";
	
	launchImages[2] = new Array();
	launchImages[2].image = "launchBGImage10.jpg";
	launchImages[2].Title = "EB GAMES <br>WEBSITE REDEVELOPMENT";
	launchImages[2].Text = "EMU recently worked closely with EB Games to redevelop and relaunch their website to include a highly customised e-commerce solution. The new website allows customers to purchase new, pre-owned and pre-order games online for the first time. This project was a clear indication of EMU's ability to deliver large and complex projects for clients. <br><br><table border=0 cellpadding=0 cellspacing=0 style='margin-left: -6px;' align=right><tr valign=middle><td><div class='folderImage'></div></td><td><a href='/portfolio.cfm?portfolio_category=web' class='orngLink' style='font-size: 11px; color: #ffffff; font-weight: bold;'> View Our Portfolio</a></td></tr></table>";
	
	launchImages[3] = new Array();
	launchImages[3].image = "launchBGImage7.jpg";
	launchImages[3].Title = "SUPERCHEAP AUTO <br>E-COMMERCE SITE DEVELOPMENT";
	launchImages[3].Text = "Supercheap Auto is one of Australasia's leading retailers of automotive accessories.  Emu continues to work with Super Retail Group to devleop their e-commerce website , creating a more effective and powerful shopping experience for customers.<br><br><table border=0 cellpadding=0 cellspacing=0 style='margin-left: -6px;' align=right><tr valign=middle><td><div class='folderImage'></div></td><td><a href='/portfolio.cfm?portfolio_category=web' class='orngLink' style='font-size: 11px; color: #ffffff; font-weight: bold;'> View Our Portfolio</a></td></tr></table>";

	launchImages[4] = new Array();
	launchImages[4].image = "launchBGImage8.jpg";
	launchImages[4].Title = "GRIFFITH UNIVERSITY <br>PLAY YOUR PART CAMPAIGN";
	launchImages[4].Text = "Emu recently recently developed the 'play your part' microsite for Griffith University. Emu delivered a website providing an effective introduction for new students to the university, helping them decide what they would like to study and which campus they would like to attend. <br><br><table border=0 cellpadding=0 cellspacing=0 style='margin-left: -6px;' align=right><tr valign=middle><td><div class='folderImage'></div></td><td><a href='/portfolio.cfm?portfolio_category=web' class='orngLink' style='font-size: 11px; color: #ffffff; font-weight: bold;'> View Our Portfolio</a></td></tr></table>";
	
	
	launchImages[5] = new Array();
	launchImages[5].image = "launchBGImage13.jpg";
	launchImages[5].Title = "COLUMBIA  OUTDOOR PERFORMANCE WEAR <br>WEBSITE DEVELOPMENT";
	launchImages[5].Text = " Design and Development of a new website for Columbia to include up to date product information for each season<br><br><table border=0 cellpadding=0 cellspacing=0 style='margin-left: -6px;' align=right><tr valign=middle><td><div class='folderImage'></div></td><td><a href='/portfolio.cfm?portfolio_category=web' class='orngLink' style='font-size: 11px; color: #ffffff; font-weight: bold;'> View Our Portfolio</a></td></tr></table>";
	
	
	
	launchImages[6] = new Array();
	launchImages[6].image = "launchBGImage14.jpg";
	launchImages[6].Title = "QUEENSLAND URBAN UTILITIES <br>WEBSITE DEVELOPMENT";
	launchImages[6].Text = " This project involved taking the new branding and designing an easy to use site that provided users with key information online and the ability to access and pay their bills online. <br><br><table border=0 cellpadding=0 cellspacing=0 style='margin-left: -6px;' align=right><tr valign=middle><td><div class='folderImage'></div></td><td><a href='/portfolio.cfm?portfolio_category=web' class='orngLink' style='font-size: 11px; color: #ffffff; font-weight: bold;'> View Our Portfolio</a></td></tr></table>";
	
	
	
	launchImages[7] = new Array();
	launchImages[7].image = "launchBGImage15.jpg";
	launchImages[7].Title = "MOUNTAIN DESIGNS <br>E-COMMERCE WEBSITE DEVELOPMENT";
	launchImages[7].Text = "This project included the design and development of a new website for Mountain Designs.  Systems integration with their retail computer systems was also achieved offering real-time stock levels when transacting. <br><br><table border=0 cellpadding=0 cellspacing=0 style='margin-left: -6px;' align=right><tr valign=middle><td><div class='folderImage'></div></td><td><a href='/portfolio.cfm?portfolio_category=web' class='orngLink' style='font-size: 11px; color: #ffffff; font-weight: bold;'> View Our Portfolio</a></td></tr></table>";
	
	
function swapLaunchInfo(){
	
	if(imgCount <= launchImages.length - 1){
		setTimeout('swapLaunchInfo()', 10000);
	}

	contentTween = new OpacityTween(document.getElementById('launchImage'),Tween.regularEaseOut, 0, 100, 1);
	
	contentTween.onMotionStarted = function(){
		document.getElementById('launchImage').style.background = "url(\/images\/layout\/launchImages\/"+launchImages[imgCount].image+")";
		document.getElementById('launchTitle').innerHTML = launchImages[imgCount].Title;
		document.getElementById('launchShortText').innerHTML = '';
		document.getElementById('launchShortText').innerHTML = launchImages[imgCount].Text;
	}
	
	contentTween.start();

	if(imgCount == launchImages.length - 1){
		imgCount = 0;
	}else{
		imgCount++;
	}
	
}

/////////////////////////////////////////////////////////////////////////////////////


function swapOverlay(id,numOverlays){
	
	for(var i = 1; i <= numOverlays; i++){
		if(id == i){
			document.getElementById('overlay'+i).style.display = "none";
		}else{
			document.getElementById('overlay'+i).style.display = "block";
		}
	}

}

////////////////////////////////////////////////////////////////////////////////////


function importXML(docName,section,subSection,contentID)
{
	if (document.implementation && document.implementation.createDocument){
	   xmlDoc= document.implementation.createDocument("","root",null);
		xmlDoc.onload = function () {
			getXMLData(section,subSection,contentID);
		}
		
	}
	else if (window.ActiveXObject){
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.onreadystatechange = function () {
			if (xmlDoc.readyState == 4) {
				getXMLData(section,subSection,contentID);
			}
		}
 	}
	else{
		alert('Your browser can\'t handle this script');
		return;
	}
	xmlDoc.load("/xml/"+docName+".xml");

}

function getXMLData(section,subSection,contentID){
	var rootLevel = xmlDoc.getElementsByTagName('data');

	var topLevel = rootLevel[0].getElementsByTagName(section);
	var subLevel = topLevel[0].getElementsByTagName(subSection)[0];

	for (j=0;j<subLevel.childNodes.length;j++)
	{

		if (subLevel.childNodes[j].nodeType != 1) continue;

		var theData = subLevel.childNodes[j].firstChild.nodeValue;
	}
	document.getElementById(contentID).innerHTML = theData;
}


function topNavState(elemID){
	
	if(document.getElementById(elemID).className == "mainLinks"){
		document.getElementById(elemID).className = "mainLinksState";
	}else{
		document.getElementById(elemID).className = "mainLinks"
	}
}

function subNavState(elemID){
	document.getElementById(elemID).className = 'selected';
}
