//OPACITY FUNCTION
function opacity(id,opacStart,opacEnd,millisec){
var speed=Math.round(millisec/100);var timer = 0;
if(opacStart>opacEnd){for(i=opacStart;i>=opacEnd;i--){setTimeout("changeOpac("+i+",'"+id+"')",(timer*speed));timer++;}}
else if(opacStart<opacEnd){for(i=opacStart;i<=opacEnd;i++){setTimeout("changeOpac("+i+",'"+id+"')",(timer*speed));timer++;}}}
function changeOpac(opacity, id){var object=document.getElementById(id).style;object.opacity=(opacity/100);
object.MozOpacity=(opacity/100);object.KhtmlOpacity=(opacity/100);object.filter="alpha(opacity="+opacity+")";}

//WIDTH FUNCTION
function slideWidth(id,widthStart,widthEnd,millisec){
var speed = Math.round(millisec/100);var timer = 0; 
if(widthStart>widthEnd){for(i=widthStart;i>=widthEnd;i--){setTimeout("changeWidth("+i+",'"+id+"')",(timer*speed));timer++;}}
else if(widthStart<widthEnd){for(i=widthStart;i<=widthEnd;i++){setTimeout("changeWidth("+i+",'"+id+"')",(timer*speed));timer++;}}}
function changeWidth(slideWidth, id){var object=document.getElementById(id).style;object.width=slideWidth+"px";}

//AJAX FUNCTIONS

function spitOut(x){
	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null){alert ("Browser does not support HTTP Request");return;}
	var url="spitout.php?spitout="+x;
	xmlhttp.onreadystatechange=retrieveActive;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);}
function retrieveActive(){
	if (xmlhttp.readyState==4){
	document.getElementById("slider-stuff").innerHTML=xmlhttp.responseText;}}
function GetXmlHttpObject(){
	if (window.XMLHttpRequest){//code for IE7+, Firefox, Chrome, Opera, Safari
	return new XMLHttpRequest();}
	if (window.ActiveXObject){//code for IE6, IE5
	return new ActiveXObject("Microsoft.XMLHTTP");}
	return null;}

//SLIDER FUNCTIONS

var trigger=0;

function sliderOp(x){	opacity("ctx-slider",0,70,300);
						slideWidth("ctx-slider",0,300,100);
						ldSldCont(x); trigger=1;}

function clSlider(){	opacity("ctx-slider",70,0,300);
						slideWidth('ctx-slider',300,0,100);
						ldSldCont("xx"); trigger=0;}

function ldSldCont(x){	;}

function slider(x){		if(trigger==1){clSlider();
						setTimeout("spitOut('"+x+"')",300);
						setTimeout("sliderOp('"+x+"')",900);}
						else{spitOut(x);sliderOp(x);trigger=1;}}

