function changeState(el)
{
	var state_el = document.getElementById('state');
	var state = state_el.options[state_el.selectedIndex].value;
	var url = "index.php?state="+state;
	window.location = url;
}
function changeClassname(el,classname)
{
	var elem = document.getElementById(el);
	elem.className = classname;
}
var current_image = 1;
var intervalId = 0;
intervalId = setInterval('bam()',7000);
var prev_image = 1;
function bam()
{
	current_image++;
	if(current_image > 5)
		current_image = 1;
	//show(current_image);
}
function show(whichOne){
	 var Div1 = "bucket_03-1";
     var Div2 = "bucket_03-2";
     var Div3 = "bucket_03-3";
     var Div4 = "bucket_03-4";
     var Div5 = "bucket_03-5";
     clearInterval(intervalId);
 	 intervalId = setInterval('bam()',7000);
     if($(Div1).fx){$(Div1).fx.stop();}
     if($(Div2).fx){$(Div2).fx.stop();}
     if($(Div3).fx){$(Div3).fx.stop();}
     if($(Div4).fx){$(Div4).fx.stop();}
     if($(Div5).fx){$(Div5).fx.stop();}
    if(whichOne == "bucket_03-1"){
    	$(Div1).fx = $(Div1).effect('opacity', {duration: 1000}).start(1);
        $(Div2).fx = $(Div2).effect('opacity', {duration: 200}).start(0);
        $(Div3).fx = $(Div3).effect('opacity', {duration: 200}).start(0);
        $(Div4).fx = $(Div4).effect('opacity', {duration: 200}).start(0);
        $(Div5).fx = $(Div5).effect('opacity', {duration: 200}).start(0);
    }else if (whichOne == "bucket_03-2"){
    	$(Div1).fx = $(Div1).effect('opacity', {duration: 200}).start(0);
        $(Div2).fx = $(Div2).effect('opacity', {duration: 200}).start(1);
        $(Div3).fx = $(Div3).effect('opacity', {duration: 200}).start(0);
        $(Div4).fx = $(Div4).effect('opacity', {duration: 200}).start(0);
        $(Div5).fx = $(Div5).effect('opacity', {duration: 200}).start(0);
    }
    else if (whichOne == "bucket_03-3"){
    	$(Div1).fx = $(Div1).effect('opacity', {duration: 200}).start(0);
        $(Div2).fx = $(Div2).effect('opacity', {duration: 200}).start(0);
        $(Div3).fx = $(Div3).effect('opacity', {duration: 200}).start(1);
        $(Div4).fx = $(Div4).effect('opacity', {duration: 200}).start(0);
        $(Div5).fx = $(Div5).effect('opacity', {duration: 200}).start(0);
    }
    else if (whichOne == "bucket_03-4"){
    	 $(Div1).fx = $(Div1).effect('opacity', {duration: 200}).start(0);
         $(Div2).fx = $(Div2).effect('opacity', {duration: 200}).start(0);
         $(Div3).fx = $(Div3).effect('opacity', {duration: 200}).start(0);
         $(Div4).fx = $(Div4).effect('opacity', {duration: 200}).start(1);
         $(Div5).fx = $(Div5).effect('opacity', {duration: 200}).start(0);
    }
    else if (whichOne == "bucket_03-5"){
        $(Div1).fx = $(Div1).effect('opacity', {duration: 200}).start(0);
        $(Div2).fx = $(Div2).effect('opacity', {duration: 200}).start(0);
        $(Div3).fx = $(Div3).effect('opacity', {duration: 200}).start(0);
        $(Div4).fx = $(Div4).effect('opacity', {duration: 200}).start(0);
        $(Div5).fx = $(Div5).effect('opacity', {duration: 200}).start(1);
    }
    prev_image = current_image;
}
function changeText(el,newtext)
{
	var elem2 = document.getElementById('bucket_03-find');
	$(elem2).fadeOut("fast");
	var elem = document.getElementById(el);

    $(elem).fadeIn("fast");
}
function changeTextBack(el)
{
	var elem = document.getElementById(el);
    $(elem).fadeOut("fast");
    var elem2 = document.getElementById('bucket_03-find');
    $(elem2).fadeIn("fast");

}
function showFAQ(id)
{
	var count = document.getElementById('faqcount').value;
	for(n = 1;n<=count;n++)
	{
		var el = document.getElementById('faq'+n);
		if(n == id) {
			el.style.display="block";
			document.getElementById('faqtitle'+n).className = 'faq_current';
		}
		else {
			el.style.display="none";
			document.getElementById('faqtitle'+n).className = 'faq_question';
		}
	}
}
function showDiv(id)
{
	var count = 4; //document.getElementById('faqcount').value;
	//alert(id);
	for(n = 1;n<=count;n++)
	{
		var el = document.getElementById('div'+n);
		if(n == id) {
			el.style.display="block";
			document.getElementById('header'+n).className = 'cat_header_on';
		}
		else {
			el.style.display="none";
			document.getElementById('header'+n).className = 'cat_header';
		}
	}
}
