
function ixRollovers() {
	// stk 02/2007
	var ixImgSuffix = "-over";
	var ixPreload = new Object();
	var ixImagesOff = new Array();
	var ixImagesOvr = new Array();
	var docImages = document.getElementsByTagName("*");
	
	for(var i=0; i<docImages.length; i++) {
		if(docImages[i].getAttribute("ixrollover")) {
			var imgSplit = docImages[i].src.split(".");
			imgSplit[((imgSplit.length)-2)] = imgSplit[((imgSplit.length)-2)] + ixImgSuffix;
			
			ixImagesOff[docImages[i].id] = docImages[i].src;
			ixImagesOvr[docImages[i].id] = imgSplit.join(".");
			ixPreload[docImages[i].id] = new Image();
			ixPreload[docImages[i].id].src = imgSplit.join(".");
			
			docImages[i].onmouseover = function() {
				this.src = ixImagesOvr[this.id];
			}
			
			docImages[i].onmouseout = function() {
				this.src = ixImagesOff[this.id];	
			}
		}
	}
}

function setOpac(strId, intO) {
	var object = document.getElementById(strId).style;
	object.opacity = (intO / 100);
	object.MozOpacity = (intO / 100);
	object.KhtmlOpacity = (intO / 100);
	object.filter = "alpha(opacity=" + intO + ")"; 
}

var showAwards = 0;
function toggleAwards(intDir) {

	showAwards+= intDir;
	var awardsDivs = document.getElementById("col3").getElementsByTagName("div");

	for(var i=0; i<awardsDivs.length; i++) {
		
		if(intDir == 0) {
			
			awardsDivs[i].style.position = "absolute";
			awardsDivs[i].style.height = parseInt(awardsDivs[i].offsetHeight)+"px";
			
			// create element to force text wrap around awards image			
			var imgblk = document.createElement("span");
			imgblk.className = "imgblock";
			awardsDivs[i].insertBefore(imgblk, awardsDivs[i].firstChild);
		}
		
		if(i == showAwards) {
			// show this div
			awardsDivs[i].style.visibility = "visible";
		}
		else {
			// hide this div
			awardsDivs[i].style.visibility = "hidden";
		}
	}
	
	/*
	if(intDir != 0) {
		var timer = 0;
		awardsDivs[showAwards].style.opacity = 0;
		awardsDivs[showAwards].style.visibility = "visible";
		for(var x=1; x<101; x++) {
			setTimeout("setOpac('"+awardsDivs[showAwards].id+"', "+x+")", timer*10);
        	timer++; 
		}
	}
	*/
	
	// toggle prev/next links
	if(showAwards-1 >= 0) {
		document.getElementById("awards_next").style.visibility = "visible";
	} else {
		document.getElementById("awards_next").style.visibility = "hidden";
	}
	if(showAwards+1 < awardsDivs.length) {
		document.getElementById("awards_prev").style.visibility = "visible";
	} else {
		document.getElementById("awards_prev").style.visibility = "hidden";
	}

}

function loadFolioSwf(strSwfFilename,cAbbr,cTitle,cDetail,cURL,cswfW,cswfH) {
	
	document.getElementById("video_wrapper").innerHTML = '<div id="video"></div>';
	var so = new SWFObject(RootPath+"/resources/swf/"+strSwfFilename, "video", "915", "237", "8", "#CCCCCC");
	so.useExpressInstall(RootPath+"/resources/swf/expressinstall.swf");
	
	// add the variables
	so.addVariable("strSwfFilename", strSwfFilename);
	so.addVariable("cAbbrev", cAbbr);	
	so.addVariable("HeaderTitle",cTitle);
	so.addVariable("HeaderDetail",cDetail);
	so.addVariable("cURL",cURL);
	so.addVariable("cswfW",cswfW);
	so.addVariable("cswfH",cswfH);
	
	so.write("video");
	self.scrollTo(0, 0);
}

function homeFolioLaunch(idNum){
	if(idNum==1){
	loadFolioSwf('portfolio.swf', 'ab', 'Adidas Bounce The Block', 'Flash Website Design and development. Site allows visitors to obtain product information, view a documentary on Krumping and flick through an interactive e-zine.', 'http://www.volume.net.au/clients/bounce/', '', '');
	}
	if(idNum==2){
	loadFolioSwf('portfolio.swf', 'arb', 'ARB 4x4 Accessories', 'Website Design and development. Site allows visitors to customize by vehicle and is managed via a customized CMS and supported by an email marketing system.', 'http://www.arb.com.au', '', '');
	}
	if(idNum==3){
	loadFolioSwf('portfolio.swf', 'cb', 'Chocolate Buddha', 'There was no chocolate involved but we still had a blast designing this website.', 'http://www.chocolatebuddha.com.au', '', '');
	}
	if(idNum==4){
	javascript:loadFolioSwf('portfolio.swf', 'noo', 'Noodle Box', 'Website design and development. Html and embedded flash combine to create an engaging user experience. ', 'http://www.noodlebox.com.au', '', '');
	}
	if(idNum==5){
	loadFolioSwf('portfolio.swf', 'ap', 'Australia Post', 'Australia Post was very happy with our \'delivery\' of their new ECI website', 'http://www.auspost.com.au/internationalpost/', '', '');
	}
	if(idNum==6){
	loadFolioSwf('portfolio.swf', 'agl_sg', 'AGL Skipping Girl', 'Website design and development. Website outlines the history of the Skipping Girl sign and how AGL is helping to restore it to its rightful place as a Melbourne Icon.', 'http://www.skippinggirl.com.au', '', '');
	}
	if(idNum==7){
	loadFolioSwf('portfolio.swf', '711', '7 Eleven', 'Website design and development. Fresh new online presence for a brand that Australians know and love.', 'http://www.7eleven.com.au', '', '');
	}
	if(idNum==8){
	loadFolioSwf('portfolio.swf', 'hifi', 'The Hi-Fi', 'Website Design and development. Site provides visitors with event details, online ticket sales. Managed via a customized CMS, the site is supported by an email marketing system and an online reporting system.', 'http://www.thehifi.com.au', '', '');
	}
}

