	function WriteFlashLogos()
	{
		document.write('<OBJECT id="logo_movie" codeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"	width="990" height="66" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">\n');
			document.write('<PARAM NAME="_cx" VALUE="4763">\n');
			document.write('<PARAM NAME="_cy" VALUE="4868">\n');
			document.write('<PARAM NAME="FlashVars" VALUE="">\n');
			document.write('<PARAM NAME="Movie" VALUE="flash/logos.swf">\n');
			document.write('<PARAM NAME="Src" VALUE="flash/logos.swf">\n');
			document.write('<PARAM NAME="WMode" VALUE="Transparent">\n');
			document.write('<PARAM NAME="Play" VALUE="0">\n');
			document.write('<PARAM NAME="Loop" VALUE="-1">\n');
			document.write('<PARAM NAME="Quality" VALUE="High">\n');
			document.write('<PARAM NAME="SAlign" VALUE="">\n');
			document.write('<PARAM NAME="Menu" VALUE="-1">\n');
			document.write('<PARAM NAME="Base" VALUE="">\n');
			document.write('<PARAM NAME="AllowScriptAccess" VALUE="">\n');
			document.write('<PARAM NAME="Scale" VALUE="ShowAll">\n');
			document.write('<PARAM NAME="DeviceFont" VALUE="0">\n');
			document.write('<PARAM NAME="EmbedMovie" VALUE="0">\n');
			document.write('<PARAM NAME="BGColor" VALUE="">\n');
			document.write('<PARAM NAME="SWRemote" VALUE="">\n');
			document.write('<PARAM NAME="MovieData" VALUE="">\n');
			document.write('<PARAM NAME="SeamlessTabbing" VALUE="1">\n');
			document.write('<PARAM NAME="Profile" VALUE="0">\n');
			document.write('<PARAM NAME="ProfileAddress" VALUE="">\n');
			document.write('<PARAM NAME="ProfilePort" VALUE="0">\n');
			document.write('<embed src="flash/logos.swf" wmode="transparent" name="logo_movie" play="0" swliveconnect="true" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="990" height="66"> </embed>\n');
		document.write('</OBJECT>\n');
	}

	function getFlashMovieObject(movieName)
	{
		if (window.document[movieName]) 
		{
			return window.document[movieName];
		}
		if (navigator.appName.indexOf("Microsoft Internet")==-1)
		{
			if (document.embeds && document.embeds[movieName])
			return document.embeds[movieName]; 
		}
		else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
		{
			return document.getElementById(movieName);
		}
	}

	var arrTestimonials;
	var timerID;
	
	function initPage()
	{
		arrTestimonials = strTestimonial.split("</p>");
		currentTestimonial = parseInt((Math.random()*1000)%6);
		nextTestimonial();

		loadFlash();
		
  		showHideAll(0);
		showCaseStudy();	    
		
		timerID = window.setInterval("moveCaseStudy(-1,true)", 3000);
	}
			
	function nextTestimonial()
	{
		var myspan = document.getElementById("TestimonialSpan");
		if (currentTestimonial >= arrTestimonials.length-2)
		{
			currentTestimonial = 0;
		}
		else
		{
			currentTestimonial++;

        }
		
		myspan.innerHTML = arrTestimonials[currentTestimonial].replace("<p>", "");
	}

	function loadFlash()
	{
		var flashMovie=getFlashMovieObject("logo_movie");
		flashMovie.Play();
		//createCookie("moviePlayed",1);
	}
	
	function createCookie(name,value,days) {
		if (days) {
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else var expires = "";
		document.cookie = name+"="+value+expires+"; path=/";
	}

	function readCookie(name) {
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
		return null;
	}


	function showHideAll(action)
	{
		var action;
		var divAnswers = document.getElementsByTagName('div');
		var bulletImage = document.getElementsByTagName('img');
		
		for(var no=0;no<divAnswers.length;no++){
			if(divAnswers[no].className=='answer'){
				if(action==1){ 
					divAnswers[no].style.display='block';
				}
				if(action==0){
					divAnswers[no].style.display='none';
				}
			}
		}
		
		for(var i_no=0;i_no<bulletImage.length;i_no++){
			if(bulletImage[i_no].className=='bulletImg'){
				if(action==1){
					bulletImage[i_no].src = "images/icon_minus.gif"
				}
				if(action==0){
					bulletImage[i_no].src = "images/icon_plus.gif"
				}
			}
		}
	}
	
	function showAnswer(item_no)
	{
		var obj_a = document.getElementById('a'+item_no);
		var theImage = document.getElementById('imgBullet'+item_no);
		
		if(obj_a.style.display=='none')
		{
			showHideAll(0);
			obj_a.style.display='block';
			theImage.src = "images/icon_minus.gif";
		}
		else
		{
			showHideAll(0);
			theImage.src = "images/icon_plus.gif";
		}		
	}

	var i = 0;
	var x = 20;
	var y = 20;

	var down_position = new Array();
	var up_position = new Array();
	var client_image = new Array();

	
	client_image[1] = "-10px -18px";
	client_image[2] = "-253px -18px";
	client_image[3] = "-2px -95px";
	client_image[4] = "-230px -173px";
	client_image[5] = "-5px -255px";
	client_image[6] = "-226px -93px";
	client_image[7] = "-226px -255px";
	client_image[8] = "-40px -355px";

    //client_image is a zero-based array but we don't use the first element
	var totalClients = client_image.length - 1;

	var prev_val = 0;

	function showCaseStudy(cs_id) {

	    //the first time this function is called it will have to compute the starting point
        //which is the last item, i.e. most recent case study
	    if (!cs_id)
	        cs_id = totalClients;

	    var val = cs_id;
	    var cs_detail = getStyleObject("csdetails" + val);

	    if (cs_detail) {
	        if (prev_val != 0) {
	            var prev_detailobject = document.getElementById("csdetails" + prev_val);
	            prev_detailobject.style.display = "none";
	        }
	        var imageobject = document.getElementById("image" + val);
	        var detailobject = document.getElementById("csdetails" + val);
	        imageobject.style.backgroundPosition = client_image[val];

	        detailobject.style.display = "block";
	        prev_val = val;
	    }
	}

	function moveCaseStudy(byCount, autoMove) {

	    var cs_id = 0;

        //if this move was triggered by user action, cancel the time to auto-move
	    if (!autoMove) {
	        window.clearInterval(timerID);
	    }

	    //cs_id = prev_val + (byCount * -1);
	    cs_id = prev_val + byCount;
	    
	    if (cs_id > totalClients) {
	    cs_id = 1;
	    }
	    
	    if (cs_id < 1){
	    cs_id = totalClients;
	    }

	    showCaseStudy(cs_id);
	    
	    var counter = document.getElementById("csnavcounter");
	    if (counter) {
	        counter.innerHTML = (totalClients - cs_id + 1).toString() + " of " + totalClients.toString();
	    }
	}

	function getStyleObject(objectId) {
	    // cross-browser function to get an object's style object given its
	    if (document.getElementById && document.getElementById(objectId)) {
	        // W3C DOM
	        return document.getElementById(objectId).style;
	    } else if (document.all && document.all(objectId)) {
	        // MSIE 4 DOM
	        return document.all(objectId).style;
	    } else if (document.layers && document.layers[objectId]) {
	        // NN 4 DOM.. note: this won't find nested layers
	        return document.layers[objectId];
	    } else {
	        return false;
	    }
	}



	function showFAQ() {
	    if ($("#faq_box").is(":visible")) {
	        $("#faq_box").hide("fast");
	        $("#close_faq").hide();
	    }
	    else {
	        $("#faq_box").show("fast");
	        $("#close_faq").show();
	        /*
	        $("body").click(function(){
	            $("#faq_box").hide("fast");
	        });
	        */
	    }
	}

	function showLinks() {

	    if ($("#links_box").is(":visible")) {
	        $("#links_box").hide("fast");
	        $("#close_links").hide();
	    }
	    else {
	        $("#links_box").show("fast");
	        $("#close_links").show();
	        /*
	        $("body").click(function() {
	            $("#links_box").hide("fast");
	        });
	        */
	        
	    }
	}

	//window.onload = showCaseStudy;
