var data = new Array();
var t;
var working = false;

function changeTextServices(content) {
	if(working){
		return;
	}
	data[0] = "We start by understanding your needs and that of your customers. This gives us all a foundation from which we can build a specification for your website.<br /><br />The specification defines your website structure, roughly what each page should contain, and what functionality it may have. This allows us to build mockups of key pages, to show you the basic design of each.<br /><br />From here, we gradually add detail to these mockups to develop a visual design for your website.<br /><br />We consult with our customers throughout to take on board suggestions and comments, and from this we believe we can better meet our customers' needs.";
	data[1] = "At this stage we implement the design, and write our first lines of code.<br /><br />We code all our pages by hand to recognised web standards, using appropriate technologies, and work diligently to ensure that your website is consistent across all platforms and browsers.<br /><br />Simultaneously, we develop any dynamic functionality that may be included in your website.<br /><br />By the completion of this stage, your website is functionally and visually complete.<br /><br />We again consult with you at this stage to ensure that we are meeting your expectations and needs and to allow for any changes.";
	data[2] = "The content of your site is just as important as the design. At this stage we help you develop and implement the content your site will contain.<br /><br />Simple things like how your text is worded, presented and structured, which images you use, and what supporting content you supply can make a huge difference to the effectiveness of your message. We help you with this and much more to ensure maximum impact.<br /><br />At this stage we also fully test all aspects of your site, checking for standards compliance, accessibility, bugs and usability issues. From this and from discussion with you, we can make any final changes until you are happy with the finished product.";
	data[3] = "So you've got your finished website. What now?<br /><br />We offer a full hosting and management solution for your website - we can not only help you obtain a domain name, but host your site, email and/or applications on our own dedicated, high-bandwidth servers.<br /><br />We can also perform SEO and analysis on your website, to make sure it appears high in search rankings ensuring you can be found by your customers and that you know how to target them, through customer usage data.<br /><br />Finally, we can maintain and update your website with new content or features if you so wish.";
	var element = document.getElementById("text-container");
	element.innerHTML=data[content];
	working = true;
	for(var i = 0; i < 4; i++)
	{
		if(i == content){ document.getElementById("text"+i).style.color = "#FFFFFF";  document.getElementById("text"+i).style.borderBottom = "3px solid #BB0000"; }
		else { document.getElementById("text"+i).style.color = ""; document.getElementById("text"+i).style.borderBottom = "1px solid #BB0000"; }
	}
	animateFade(element,0);
}

var display = "";
function iframeData(id, img, url, name, desc, count)
{
	
	for(var i = 0; i < count; i++) 
	{
		iframeDataClose("frame"+i)
	}
	
	document.getElementById(id).style.height = "auto";
		
	display = "<div class='preSubboxImageDiv'>";
	display += "<img src='theme/element/"+img+"' alt='image' title='image' style='width:100%;'/></div>";
	display += "<div class='preSubbox'>";
	display += "<div class='preText'>";
	display += "<h4>"+name+"</h4>";
	display += desc+"<br /><br /><br />";
	display += "</div>";
	
	
	display += "<div class='postText'>";
	display += "<div class='leftHalf'><a href='"+url+"' class='bodyLink' target='_blank'>Click to see website</a></div>";
	display += "<div class='rightHalf'><a href='#"+id+"' onClick=\"iframeDataClose('"+id+"')\">Close</a></div>";
	display += "</div>";
	display += "</div>";
	
	document.getElementById(id).innerHTML = display;
}

function iframeDataClose(id) {
	document.getElementById(id).style.height = 0+"px";
	document.getElementById(id).innerHTML = "";
}

/*********************************************
 *  animateFade v1                           *
 *	J. Millar                                *
 *********************************************
 *	Simple function to fade in an element from
 *  a given opacity to 100%
 *  Params:
 *  id = a DOM object to perform fade on
 *  opacity = starting opacity
 *  
 *  ToDo: add capability to fade in or out 
 *  depending on finish opacity param?
 */
function animateFade(id,opacity)
{
	var step = 5;   //amount of opacity to add in each iteration
	var speed = 30; //time in ms till next interation
	var actOp = 0;  //var for standards opacity (decimal between 0 and 1)
	if(opacity>=100) 
	{
		working = false;
		clearTimeout(t);
		id.style.removeAttribute('filter');
		return;
	}
	else
	{
		opacity = opacity+step;
		actOp = opacity/100;
		id.style.opacity=actOp;
		id.style.filter = "alpha(opacity=" + opacity + ")";
		t=setTimeout(function() {animateFade(id,opacity)}, speed);
	}
}
