/* accordian */
$(function(){
	$("#accordion").accordion({ 
		header: "h3",
		alwaysOpen: false, 
		collapsible: true,
		animated: false,
		
	});								
});

/* cookies */
$( function()
			{
				var cookieName = 'stickyAccordion';
				$( '#accordion' ).accordion( {
					active: ( $.cookies.get( cookieName ) || 0 ),
					change: function( e, ui )
					{
						$.cookies.set( cookieName, $( this ).find( 'h3', 'm3' ).index ( ui.newHeader[0] ) );
					}
				});
			});
		
/* preload imgs */
/* coming soon */





/* random image on index page */
var theImages = new Array()

theImages[0] = 'images/home1.jpg' 
theImages[1] = 'images/home2.jpg'
theImages[2] = 'images/home3.jpg' 
theImages[3] = 'images/home4.jpg' 
theImages[4] = 'images/home5.jpg' 
theImages[5] = 'images/home6.jpg' 
theImages[6] = 'images/home7.jpg' 
theImages[7] = 'images/home8.jpg' 
theImages[8] = 'images/home9.jpg' 

var j = 0
var p = theImages.length;
var preBuffer = new Array()

for (i = 0; i < p; i++){
preBuffer[i] = new Image()
preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));

function showImage(){
if(whichImage==0){
document.write('<img class="home" src="'+theImages[whichImage]+'" border=0 ');
}
else if(whichImage==1){
document.write('<img class="home" src="'+theImages[whichImage]+'" border=0 ');
}
else if(whichImage==2){
document.write('<img class="home" src="'+theImages[whichImage]+'" border=0 ');
}
else if(whichImage==3){
document.write('<img class="home" src="'+theImages[whichImage]+'" border=0 ');
}
else if(whichImage==4){
document.write('<img class="home" src="'+theImages[whichImage]+'" border=0 ');
}
else if(whichImage==5){
document.write('<img class="home" src="'+theImages[whichImage]+'" border=0 ');
}
else if(whichImage==6){
document.write('<img class="home" src="'+theImages[whichImage]+'" border=0 ');
}
else if(whichImage==7){
document.write('<img class="home" src="'+theImages[whichImage]+'" border=0 ');
}
else if(whichImage==8){
document.write('<img class="home" src="'+theImages[whichImage]+'" border=0 ');
}

}

