

//
//	ORDER
//

function getTotal(refsel,discount,subtotal,selected_lang,order_id,res_subtotal) {
	
	$('#order_total').html('<img src="images/preloading.gif" alt="Loading..."/>');
	
	var transport = refsel.options[refsel.selectedIndex].value;
	var postvars = {
		transport:transport,
		discount:discount,
		subtotal:subtotal,
		selected_lang:selected_lang,
		order_id:order_id,
		res_subtotal:res_subtotal
	};
	
	$.post("jsrequest_order_total.php",postvars,function(data){
		$('#order_total').html(data);
	});
	
}

function checkForm(msg) {
	if($('#shipping').val() == -1) {
		alert(msg);
		return false;
	}
	return true;
}


//
// GENERAL
//



function initApplication() {
	
	$(".product-info").css( {opacity: "0.6"} );
	
	$("#right-sidebar ul ul").hide();
	$(".subcat-menu-on").show();
	
	
	$(".product-block span img").hover(function(){
		$(this).attr({ src: "images/products/product_mask_roll.gif" });
		$($(this).parents()[2]).next('div').animate( { opacity: "1" } , 300 );
	}, function(){
		$(this).attr({ src: "images/products/product_mask.gif" });
		$($(this).parents()[2]).next('div').animate( { opacity: "0.6" } , 300 );
		}
	)
	
	
	
	$(".product-info").hover(function(){
		$(this).animate( { opacity: "1" } , 300 );
	}, function(){
		$(this).animate( { opacity: "0.6" } , 300 );
		}
	)
	
	$(".submit-comanda").hover(function(){
		$(this).css( { color: "#DD137B" } );
	}, function(){
		$(this).css( { color: "#838281" } );
		}
	)
	
	
	$(".form-template p input").not(".formsubmit").hover(function(){ 
		$(this).css( { background: "#FDF1F7" } ); 
	},function(){
		$(this).css( { background: "white" } ); 
		}
	)
	
	$(".delcartlink").hover(function(){
		$(this).attr({ src: "images/delete_roll.gif" });
	}, function(){
		$(this).attr({ src: "images/delete.gif" });
		}
	)
}

if(typeof window.onload == 'function') {
	var parentfunction = window.onload;
}

window.onload = function() {
	if(parentfunction) {
		parentfunction();
	}
	initApplication();
	if(typeof(initMenu) == 'function') {
		initMenu();
	}
}