﻿var panels = new Array();
panels[0] = 'search';
panels[1] = 'kids-activities';
panels[2] = 'leisure-time';
panels[3] = 'parties';
panels[4] = 'weddings';
panels[5] = 'going-out';
panels[6] = 'family-history';
panels[7] = 'local-businesses';
panels[8] = 'glos-info';
panels[9] = 'searchext';

animatedcollapse.addDiv('search', 'fade=0,height=60px');
animatedcollapse.addDiv('kids-activities', 'fade=0,height=170px');
animatedcollapse.addDiv('leisure-time', 'fade=0,height=190px');
animatedcollapse.addDiv('parties', 'fade=0,height=120px'); 
animatedcollapse.addDiv('weddings', 'fade=0,height=185px');
animatedcollapse.addDiv('going-out', 'fade=0,height=130px');
animatedcollapse.addDiv('family-history', 'fade=0,height=130px');
animatedcollapse.addDiv('local-businesses', 'fade=0,height=190px');
animatedcollapse.addDiv('glos-info', 'fade=0,height=100px');
animatedcollapse.addDiv('searchext', 'fade=0,height=50px');
animatedcollapse.init();

function hover(panelID) {
	if (panelID=='kids-activities')	{
		document.body.style.backgroundImage="url('/images/red/background.jpg')";	
	} else if (panelID=='leisure-time') {
		document.body.style.backgroundImage="url('/images/purple/background.jpg')";	
	} else if (panelID=='parties') {
		document.body.style.backgroundImage="url('/images/orange/background.jpg')";	
	} else if (panelID=='weddings') {
		document.body.style.backgroundImage="url('/images/pink/background.jpg')";	
	} else if (panelID=='going-out') {
		document.body.style.backgroundImage="url('/images/green/background.jpg')";	
	} else if (panelID=='family-history') {
		document.body.style.backgroundImage="url('/images/brown/background.jpg')";	
	} else if (panelID=='local-businesses') {
		document.body.style.backgroundImage="url('/images/grey/background.jpg')";	
	} else if (panelID=='glos-info') {
		document.body.style.backgroundImage="url('/images/ogreen/background.jpg')";	
	} else {
		document.body.style.backgroundImage="url('/images/background.jpg')";	
	}
}

function switchpanel(toThis) {
	var x;
	
 	for (x in panels)
	{
		if(toThis==panels[x])
			{
				animatedcollapse.show(toThis);
				if(x==0){
					document.getElementById('cmbMajorCategory').onchange();
					}
				if (panels[x]=='search') {
				} else {
					document.getElementById(toThis+'-link').style.color='#666666';
				}
			}
		else
			{
				animatedcollapse.hide(panels[x]);
				if (panels[x]=='searchext') {
				} else {
					document.getElementById(panels[x]+'-link').style.color='#000000';
				}
			}
	}
}

function hidepanelssmooth() {
	var x;

	for (x in panels)
	{
		animatedcollapse.hide(panels[x]);
	}
}


function hidepanels() {
	var x;

	for (x in panels)
	{
		document.getElementById(panels[x]).style.display='none';
	}
}

