// THIS IS FOR THE DIV POPUP OVERLAY USED FOR THE LOGIN DIALOGUE BOX
// What is $(document).ready ? See: http://flowplayer.org/tools/using.html#document_ready
$(document).ready(function() {
	var triggers = $("button.modalInput").overlay({
		// some expose tweaks suitable for modal dialogs
		expose: {
			color: '#333',
			loadSpeed: 200,
			opacity: 0.9
		},
		closeOnClick: false
	});
	
	
	$("#prompt form").submit(function(e) {
	
		// close the overlay
		triggers.eq(1).overlay().close();
	
		// get user input
		var input = $("input", this).val();
	
		// do something with the answer
		triggers.eq(1).html(input);
	
		// do not submit the form
		return e.preventDefault();
	});
});


//main nav rollovers
function main_nav(n,type){
	 if (type=="over"){
		document.getElementById('main_nav_'+n+'_left').setAttribute("class", "act_left");
		document.getElementById('main_nav_'+n+'_right').setAttribute("class", "act_right");
		document.getElementById('main_nav_'+n+'_mid').setAttribute("class", "act");

	 } else {
		document.getElementById('main_nav_'+n+'_left').setAttribute("class", "act_left_none");
		document.getElementById('main_nav_'+n+'_right').setAttribute("class", "act_left_none");
		document.getElementById('main_nav_'+n+'_mid').setAttribute("class", "no");
	 
	 }
}


/* CLIENT LOGOS SLIDES */
var index1=0;
var index2=1;
var index3=2;
var index4=3;
var index5=4;

var maxindex=4;

var image = new Array();
/* this should be in the same order as the original lineup on the website on first load */
image[0] = "images/clients/york.gif";
image[1] = "images/clients/wa.gif";
image[2] = "images/clients/beyond.gif";
image[3] = "images/clients/chr.gif";
image[4] = "images/clients/commsolv.gif";

function client_next(){
	index1--; if (index1<0) index1=maxindex;
	index2--; if (index2<0) index2=maxindex;
	index3--; if (index3<0) index3=maxindex;
	index4--; if (index4<0) index4=maxindex;
	index5--; if (index5<0) index5=maxindex;
	
	document.images.client1.src=image[index1];
	document.images.client2.src=image[index2];
	document.images.client3.src=image[index3];
	document.images.client4.src=image[index4];
	document.images.client5.src=image[index5];
}
function client_prev(){
	index1++; if (index1>maxindex) index1=0;
	index2++; if (index2>maxindex) index2=0;
	index3++; if (index3>maxindex) index3=0;
	index4++; if (index4>maxindex) index4=0;
	index5++; if (index5>maxindex) index5=0;
	
	document.images.client1.src=image[index1];
	document.images.client2.src=image[index2];
	document.images.client3.src=image[index3];
	document.images.client4.src=image[index4];
	document.images.client5.src=image[index5];
}
