
var m2_content = '';
var imageArray = new Array();
var totalImages = 8; // number of images in array to preload
var imagesLoaded = new Array(); // number of completed loaded images
var infoNextID = 'tg9hp';


	imageArray['tg9hp']=new Image()
	imageArray['tg9hp'].src = '../../img/items/Graphic-Design-Sheffield-advertising-6.jpg';

	imageArray['c79q0']=new Image()
	imageArray['c79q0'].src = '../../img/items/Graphic-Design-Sheffield-advertising-7.jpg';
	imageArray['mnhty']=new Image()
	imageArray['mnhty'].src = '../../img/items/Graphic-Design-Sheffield-advertising-3.jpg';
	imageArray['qn658']=new Image()
	imageArray['qn658'].src = '../../img/items/Graphic-Design-Sheffield-advertising-2.jpg';
	imageArray['br4jk']=new Image()
	imageArray['br4jk'].src = '../../img/items/Graphic-Design-Sheffield-advertising-1.jpg';
	imageArray['1lf84']=new Image()
	imageArray['1lf84'].src = '../../img/items/Graphic-Design-Sheffield-advertising-4.jpg';
	imageArray['9mld1']=new Image()
	imageArray['9mld1'].src = '../../img/items/Graphic-Design-Sheffield-advertising-8.jpg';
	imageArray['tzp2y']=new Image()
	imageArray['tzp2y'].src = '../../img/items/Graphic-Design-Sheffield-advertising-5.jpg';


 m2_content += '<a href="#" id="link_c79q0">BMC Young Membership Advertising</a>';
 m2_content += '<a href="#" id="link_mnhty">BMC Insurance Advertising</a>';
 m2_content += '<a href="#" id="link_qn658">BMC Membership Advertising</a>';
 m2_content += '<a href="#" id="link_br4jk">BMC General Advertising</a>';
 m2_content += '<a href="#" id="link_1lf84">Deuter</a>';
 m2_content += '<a href="#" id="link_9mld1">Scarpa Walking</a>';
 m2_content += '<a href="#" id="link_tg9hp" class="thisTab">Scarpa Rock Climbing</a>';
 m2_content += '<a href="#" id="link_tzp2y">Eighteen Bikes</a>';


var initialOffsetLeft = -5100;




var infoFadeState = 1;
var infoFadeDirection = '';
var infoFadeText = '';
var infoFadeIncrement = 0.03;
var infoTextBox;

function makeRequest(url) {
        var httpRequest;

        if (window.XMLHttpRequest) { // Mozilla, Safari, ...
            httpRequest = new XMLHttpRequest();
            if (httpRequest.overrideMimeType) {
                httpRequest.overrideMimeType('text/xml');
                // See note below about this line
            }
        } 
        else if (window.ActiveXObject) { // IE
            try {
                httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
                } 
                catch (e) {
                           try {
                                httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
                               } 
                             catch (e) {}
                          }
                                       }

        if (!httpRequest) {
			document.getElementById('debug').innerHTML = 'Cannot make request';
            return false;
        }
        httpRequest.onreadystatechange = function() { 
			updateInfoBox(httpRequest); 
		};
        httpRequest.open('GET', url, true);
        httpRequest.send('');

}

function updateInfoBox(httpRequest) {

   if (httpRequest.readyState == 4) {
		if (httpRequest.status == 200) {
			infoFadeText = httpRequest.responseText;
			infoFadeDirection = 'in';
		}
   }

}


function fadeInfo(direction) {
	
	infoTextBox.style.opacity = infoFadeState;
	infoTextBox.style.filter = 'alpha(opacity=' + Math.floor(infoFadeState*100) + ')';
	
	if (infoFadeDirection == 'out') {
		if (infoFadeState > 0) {
			infoFadeState -= infoFadeIncrement;
		} else {
			infoFadeState = 0;
			infoFadeDirection = '';
		}
	} 
	
	if (infoFadeDirection == 'in') {
		if (infoFadeText != '') {
			document.getElementById('copy_showcase_text').innerHTML = infoFadeText;
			infoFadeText = '';
		}
		if (infoFadeState < 1) {
			infoFadeState += infoFadeIncrement;
		} else {
			infoFadeState = 1;
			infoFadeDirection = '';
		}
	}
			
}


function clearLinkTabs() {
			for (var thisLink = 0 ; thisLink < linkList.length; thisLink++) {
				var tempID = linkList[thisLink].className = '';
			}
}


function setTabbedLink(itemID) {
		var linkID = 'link_' + itemID;
		document.getElementById(linkID).className = 'thisTab';
}
