$(document).ready(function() {
	
	$('#style_selector').change(function() {
		if ($('#style_selector option:selected').attr("title") != '') {
			sImg = $('#style_selector option:selected').attr("title");
			sImg = sImg.substring(4);
			$("#prod_image").attr("src", "/data/images/" + sImg);	
		}		
	});

	// Product description switcher
	$('#range_parts').hide();
	$('#range_downloads').hide();
	$('#prod_related').hide();
	$('#prod_video').hide();
	
	$('#switch_more').addClass("parton");

	$('#switch_more a').click(function(){

		$('#range_parts').hide();
		$('#range_downloads').hide();
		$('#prod_related').hide();
		$('#prod_video').hide();
		$('#prod_features').show();
		
		$('#prod_switch_links li').removeClass("parton");
		$('#switch_more').addClass("parton");

		return false;
	});

	$('#switch_part a').click(function(){

		$('#range_downloads').hide();
		$('#prod_related').hide();
		$('#prod_features').hide();
		$('#prod_video').hide();
		$('#range_parts').show();
		
		$('#prod_switch_links li').removeClass("parton");
		$('#switch_part').addClass("parton");

		return false;
	});

	$('#switch_wire a').click(function(){

		$('#range_parts').hide();
		$('#prod_related').hide();
		$('#prod_features').hide();
		$('#prod_video').hide();
		$('#range_downloads').show();
		
		$('#prod_switch_links li').removeClass("parton");
		$('#switch_wire').addClass("parton");

		return false;
	});

	$('#switch_rela a').click(function(){

		$('#range_parts').hide();
		$('#range_downloads').hide();
		$('#prod_features').hide();
		$('#prod_video').hide();
		$('#prod_related').show();
		
		$('#prod_switch_links li').removeClass("parton");
		$('#switch_rela').addClass("parton");

		return false;
	});

	$('#switch_vide a').click(function(){

		$('#range_parts').hide();
		$('#range_downloads').hide();
		$('#prod_features').hide();
		$('#prod_related').hide();
		$('#prod_video').show();
		
		$('#prod_switch_links li').removeClass("parton");
		$('#switch_vide').addClass("parton");

		return false;
	});

});


function select_site(){
	choice = document.add_prod.pulldown.selectedIndex;
	top.location.href = document.add_prod.pulldown.options[choice].value;
}

function load_hide(){
	document.getElementById('add_prod').style.display = "";
}
