// JavaScript Document
//alert(window.innerWidth/2);
var index = 0;
function fadeHeader(id, opacStart, opacEnd, millisec){

		index = Math.round(14*Math.random());
	var speed = Math.round(millisec / 100);
	// set position
	var x = Math.round(300*Math.random())+150;// set between 150 and 450
	var y = Math.round(40*Math.random())+60; // set between 50 and 90 
	document.getElementById("testimonial").style.marginTop="-"+y+"px";
	document.getElementById("testimonial").style.marginLeft=x+"px";


	
	// set text
	swapTestimonials();
	
	opacity(id,opacEnd , opacStart, millisec); // call to fade out
	//setTimeout("swapServices('"+service+"')",(opacStart * speed)); // change content
	setTimeout("opacity('"+ id +"',"+ opacStart +","+opacEnd+","+millisec+")", (opacStart * speed)*10); // fade back out
	setTimeout("fadeHeader('"+id+"',"+ opacStart +","+opacEnd+","+millisec+")", (opacStart * speed)*15);
}

var xmlHttp

function swapTestimonials()
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="/testimonials.php"
url=url+"?index="+index
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=testimonialStateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function testimonialStateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("testimonial").innerHTML=xmlHttp.responseText 
} 
} 

                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    