<!--prepopulated form script -->

// Variables
//maxPhones = 5;

// scroller script
$(function() {
	$(".scrollable").scrollable();
});
/*
// switch phones
function switchArticles(num){
	switch(num){
	case 1:
	  	hideStuff(1);
		
	break;
	case 2:
		hideStuff(2);
		
	break;
	case 3:
		hideStuff(3);
		
	break;
	case 4:
		hideStuff(4);
		
	break;
	case 5:
		hideStuff(5);
		
	break;
	case 6:
		hideStuff(6);
		
	break;
	case 7:
		hideStuff(7);
		
	break;
	case 8:
		hideStuff(8);
		
	break;
	case 9:
		hideStuff(9);
		
	break;
	case 10:
		hideStuff(10);
		}
}

// hide overviews
function hideStuff(currPhone) {
	addRolls(); // add oldPhone variable here for shorter addRolls function
	for (i=1;i<=maxPhones;i++){	
			if (i != currPhone) {
				document.getElementById("phone"+i).style.display = "none";
				thumbDown = "url(images/btm_nav/thumb_"+i+".png)";
				document.getElementById("thumb" + i).style.backgroundImage = thumbDown;
			} else {
				document.getElementById("phone"+i).style.display = "block";
				thumbUp = "url(images/btm_nav/thumb_"+i+"_on.png)";
				document.getElementById("thumb" + i).style.backgroundImage = thumbUp;
				document.getElementById("thumb" + i).onmouseover = function (){};
				document.getElementById("thumb" + i).onmouseout = function (){};
			}
	}
}

// add rollovers back to buttons

function addRolls() {
		document.getElementById('thumb1').onmouseover = function () {document.getElementById('thumb1').style.backgroundImage = "url(images/btm_nav/thumb_1_on.png)";}
		document.getElementById('thumb1').onmouseout = function () {document.getElementById('thumb1').style.backgroundImage = "url(images/btm_nav/thumb_1.png)";}
		document.getElementById('thumb2').onmouseover = function () {document.getElementById('thumb2').style.backgroundImage = "url(images/btm_nav/thumb_2_on.png)";}
		document.getElementById('thumb2').onmouseout = function () {document.getElementById('thumb2').style.backgroundImage = "url(images/btm_nav/thumb_2.png)";}
		document.getElementById('thumb3').onmouseover = function () {document.getElementById('thumb3').style.backgroundImage = "url(images/btm_nav/thumb_3_on.png)";}
		document.getElementById('thumb3').onmouseout = function () {document.getElementById('thumb3').style.backgroundImage = "url(images/btm_nav/thumb_3.png)";}
		document.getElementById('thumb4').onmouseover = function () {document.getElementById('thumb4').style.backgroundImage = "url(images/btm_nav/thumb_4_on.png)";}
		document.getElementById('thumb4').onmouseout = function () {document.getElementById('thumb4').style.backgroundImage = "url(images/btm_nav/thumb_4.png)";}
		document.getElementById('thumb5').onmouseover = function () {document.getElementById('thumb5').style.backgroundImage = "url(images/btm_nav/thumb_5_on.png)";}
		document.getElementById('thumb5').onmouseout = function () {document.getElementById('thumb5').style.backgroundImage = "url(images/btm_nav/thumb_5.png)";}
	} 
	*/
// lightbox junk

$(document).ready(function(){
	$(".inpagehtml").colorbox({width:"680px", height:"75%", iframe:true});
	
	//Example of preserving a JavaScript event for inline calls.
	$("#click").click(function(){ 
		$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
		return false;
	});
				
	// Accodion button init	
	$('.accordionButton').click(function() {			
		$('.accordionContent').slideUp('normal').prev().removeClass('open');				
		$(this).next().stop().slideDown('normal').prev().addClass('open');
	});
 
	// Hide contents on pageload apart from the first one	
	$('.accordionContent').hide();
	$('.accordionContent:first').show();
	$('.accordionButton:first').addClass('open first');
	$('.accordionButton:last').addClass('last');	

});
