jQuery(document).ready(function() {
	jQuery(window).resize();
	setTimeout("removeloading()",5000);
	jQuery("#main, #sub, #color").change(function() {
		if(jQuery(this).val()!=0)
			jQuery(this).closest("form").submit();
	});
	/*
	jQuery("#sub").change(function() {
		jQuery(this).closest("form").submit();
	});
	*/
	
	
	jQuery("#close").click(function(){
		window.location.href=jQuery('#iframe').attr("src");
	});
	$("#main").selectmenu({style:'dropdown',width: 160,maxHeight: 400,menuWidth: 160});
	$("#sub").selectmenu({style:'dropdown',width: 140,maxHeight: 400,menuWidth: 140});
	$("#color").selectmenu({style:'dropdown',width: 80,maxHeight: 400,menuWidth: 80});
});

jQuery(window).resize(function(){
	var oldH, newH;
	oldH=jQuery(window).height();
	newH=oldH-61;
	$('#iframe').height(newH);
	//alert(oldH + "--" + newH);
});
function removeloading(){
	jQuery("body").css("background-image","none");
}
