$(document).ready(function(){
	$("#submenu li:last,#footer ul.fright li:last,#footer ul.fleft li:last,#lang li:last").addClass("last");
	$("#submenu li:first,#footer ul.fright li:first,#footer ul.fleft li:first").addClass("first");
	remplaceFonts();
	submitCSS();
	$("#moreinfo").click(function(){
		$(this).toggleClass("moreinfo-active");
		$("#enviar-pedirinfo").toggle();
	});	
	var contador = 1;
	/*$(".actualidadList .producto").each(function(){
		if(contador == 2){
			$(this).addClass("last");					
			contador = 1;
		}else{ 
			contador++;
		}
	});*/
	
	//setTimeout ('equalHeight($(".listado_icos li"))', 500);
	
	$.each($.browser, function(i, val) {
		if((i=="msie" && $.browser.version.substr(0,3)=="7.0") || (i=="msie" && $.browser.version.substr(0,3)=="6.0")){
			$(".productos").each(function(){
				var anchura = $(this).width();
				$(this).find(".productos-bottom").width(anchura);
			});
			$(".productos2").each(function(){
				var anchura = $(this).width();
				$(this).find(".productos-bottom2").width(anchura);
			});
		}
	});
	$(".producto").click(function() {
		var url = $(this).find("a:first").attr("href");
		window.location = url;
	    return false;
	});
	$('#footer a.fright').colorbox({title:true});
});
function formDefaultValue (elemento, defaultValue) {
	if (elemento.value==defaultValue) {
		elemento.value = "";
	}
	return true;
}
function formDefaultValueCheck (elemento,defaultValue) {
	if(elemento.value == "") {
		elemento.value = defaultValue;
	}
}
function equalHeight(group) {
    tallest = 0;
    group.each(function() {
        thisHeight = $(this).height();
        if(thisHeight > tallest) {
            tallest = thisHeight;
        }
    });
    group.height(tallest);
}
function remplaceFonts() {
	Cufon.replace('.DINPro-Bold', {fontFamily:'DINPro-Bold',hover: true});
	Cufon.replace('.DINPro-Black', {fontFamily:'DINPro-Black',hover: true});
	Cufon.replace('.DINPro-Light', {fontFamily:'DINPro-Light',hover: true});
	Cufon.replace('.Myriad-Pro', {fontFamily:'Myriad Pro',hover: true});
}

function embedFlash(swf){
	if($.browser.msie) {
		return swf+"?"+Math.random();
	}
	return swf;
}
