// JavaScript Document
//$(function() {
$(document).ready(function(){

	if(slides3!=null) {
		for(var i=0; i<slides3.length; i++) {
			$('<a href="'+slides3[i][2]+'" target="'+slides3[i][3]+'"><img src="'+slides3[i][0]+'" /></a>').appendTo('#slideshow');
		}
	}

	$('#slideshow').prepend($('<div id="control"><a href="#" id="prev">&lt;</a><div id="pager"></div><a href="#" id="next">&gt;</a></div>'));	


	var total = $("#slideshow img").length;
	var rand = Math.floor(Math.random()*total);
	
    $('#slideshow').cycle({
        fx:     'fade',
        speed:  'slow',
        timeout: 4000,
		//pause:  1,  //mouse over pause
		//random : 1, //play random
		startingSlide: rand,
		prev:'#prev',	
		next:'#next',			
        pager:  '#pager',
		slideExpr: 'img'
    });
});

