<!--

// Script para agragar a Favoritos
function agregar(){
	//Para internet explorer
	if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>=4)) {
		var url="http://www.dromedigital.com/"; //Cambia esta dirección por la de tu web
		var titulo="Drome Digital"; //Cambia esta nombre por el de tu web
		window.external.AddFavorite(url,titulo);
	}
	//Para Netscape y Firefox
	else {
		if(navigator.appName == "Netscape")
			alert ("Presione Crtl+D para agregar a este sitio en sus Bookmarks/Favoritos");  //Puedes personalizar este mensaje
		}
}


$(document).ready(function() {
	jQuery.fn.fadeLink = function(start,end){
		return this.each(function() {			
			$(this).hover(
				function(){$(this).animate({"opacity":end}, 150);},
				function(){$(this).animate({"opacity":start}, 150);}
			);
			$(this).css({"opacity":start});
		});
	}
	
	jQuery.fn.fadeObj = function(start,end,obj){
		
		return this.each(function() {			
			$(this).hover(
				function(){$(obj).animate({"opacity":end}, 150);},
				function(){$(obj).animate({"opacity":start}, 150);}
			);
			$(obj).css({"opacity":start});
		});
	}

});

$(document).ready(function() {
	// by RGdesign.org - 2008
	jQuery.fn.ChangeImgOver = function(){
		return this.each(function() {			
			$(this).hover(
				function(){
					imgsrc = $(this).attr("src");
					matches = imgsrc.match(/_over/);
					if (!matches) {
						imgsrcON = imgsrc.replace(/.gif$/ig,"_over.gif");
						$(this).attr("src", imgsrcON);
					}
				},
				function(){
					$(this).attr("src", imgsrc);
				}
			);
			rollsrc = $(this).attr("src");
			rollON = rollsrc.replace(/.gif$/ig,"_over.gif");
			$("<img>").attr("src", rollON);
		});
	}

});

/* forms */
$(document).ready(function(){
						   
	$('#newsletterform').ajaxForm(function(data) {
	   
		if (data==1){
			$('#success').fadeIn("slow");
			$('#newsletterform').resetForm();
			$('#bademail').fadeOut(0);
			$('#badserver').fadeOut(0);
			$('#loader').fadeOut(0);
			$('#badname').fadeOut(0);
		} else if (data==2){
			$('#badserver').fadeIn("slow");
			$('#bademail').fadeOut(0);
			$('#loader').fadeOut(0);
			$('#badname').fadeOut(0);
		} else if (data==3){
			$('#bademail').fadeIn("slow");
			$('#badserver').fadeOut(0);
			$('#loader').fadeOut(0);
			$('#badname').fadeOut(0);
		}
		else if (data==4){
			$('#badname').fadeIn("slow");
			$('#bademail').fadeOut(0);
			$('#badserver').fadeOut(0);
			$('#loader').fadeOut(0);
		}
	});
	
	$('#newsletterform .formBt').click(function(){
		$('#loader').fadeIn(0);
	});

});

jQuery(document).ready(function() {
	$('.enableForm').click(function(){
		$("input[type='text']:first", document.forms[1]).focus();
	});

	$('input[type="text"], textarea').focus(function() {
		if (this.value == this.defaultValue){ 
			this.value = '';
		}
		if(this.value != this.defaultValue){
			this.select();
		}
	});
	$('input[type="text"], textarea').blur(function() {
		if ($.trim(this.value) == ''){
			this.value = (this.defaultValue ? this.defaultValue : '');
		}
		
	});
});	


/* nomailspam */
function nomailspam(name,domain) {
	document.location = "mailto:" + name + "@" + domain;
}

/* replace last "," from cat list*/	
$(document).ready(function(){
	$(".meta .cats").each(function(){
		var catVal = $(this).html();
		var catVal_long = catVal.length;
		var catVal_last_char = catVal.charAt(catVal_long-2);
		if(catVal_last_char == ","){
			$(this).replaceWith(catVal.substr(0,catVal_long-2));
			};
	});
})

/* imageBox */
$(document).ready(function(){
	$.fn.colorbox.settings.transition = "ease";
	$.fn.colorbox.settings.bgOpacity = "0.8";
	$.fn.colorbox.settings.contentCurrent = "im&aacute;gen {current} de {total}";
	$.fn.colorbox.settings.initialWidth = 200;
	$.fn.colorbox.settings.initialHeight = 200;
	$.fn.colorbox.settings.overlayClose = true;
	
	$(".cpModal").colorbox();
	
	$(".popImageGal").each(function(){
		url = $(this).attr("rel");
		$(this).attr('rel','gal');
		$(this).colorbox({contentCurrent: "Producto {current} de {total} - <a href='"+url+"'>Ver detalles del producto</a>"});
	});

	$(".openRelGal").each(function(){
		$(this).click(function(){
			$("a[rel='nofollowMini']").click();
			return false;
			});
		});	
	
	
	/* mini galeria en single posts */
	$(".popImageGalMini").each(function(){
		$('#current').css({"opacity":1});
		$(this).img = $(this).attr('rel');
		$(this).attr('rel','nofollowMini');
		$(this).colorbox({contentCurrent: "Im&aacute;gen {current} de {total}"});
		$(this).hover(
				function(){
					imgsrc = $(this).children('span').text();
					$('#bigThumb').css("background-image", "url("+imgsrc+")");
					$('#bigThumb a').attr("href", $(this).attr('href'));
					$(this).css({"opacity":0.8});
					$('#current').removeAttr('id');
					
					$(this).attr('id', 'current');
					//$('#current').css({"opacity":1});
					},
				function(){
					$(this).css({"opacity":1});
					//$(this).attr("src", imgsrc);
				}
			);
		
	});
});

/* catalogue list modification */
$(document).ready(function(){
	$(".wp_dTreewp_dtree_Node a").each(function(){
		t = $(this).attr("title");
		matchesT = t.match(/Productos/);
		out = $('#header a').attr("href");
		if(matchesT){
			//$(this).text("Todos los productos");
			}
	});
	$(".wp_dTreewp_dtree_Node img").each(function(){
		
		srcImg = $(this).attr("src");
		matchesNolines = srcImg.match(/nolines/);
		if (matchesNolines) {
			// hide [+] and [-] icons
			$(this).addClass("no");
			srcJS = $(this).parent().attr("href");
		}
		matchesPage = srcImg.match(/page/);
		if (matchesPage) {
			// hide page icons //
			$(this).prev('img').addClass("no");
		}
		matchesFolder = srcImg.match(/folder/);
		if (matchesFolder) {
			// converting custom icons into links to open close menu */
			txt = $(this).nextAll().attr("title");
			$(this).wrap("<a title='Expandir/Colapsar "+txt+"' href='"+srcJS+"'></a>");
		}
	});
})

/* catalogue header ul li animation [easySlider] */
$(document).ready(function(){
	$('#catHeader').show();
	$('#catHeader').animate({"height":261}, 1000);
	$("#ofertasList").easySlider({
		prevId: 'prevBtn',
		prevText: 'Previous',
		nextId: 'nextBtn',	
		nextText: 'Next',
		controlsShow: false,
		controlsBefore: '',
		controlsAfter: '',	
		controlsFade: true,
		firstId: 'firstBtn',
		firstText: 'First',
		firstShow: false,
		lastId: 'lastBtn',	
		lastText: 'Last',
		lastShow: false,				
		vertical: true,
		speed: 500,
		auto: true,
		pause: 8000,
		continuous: true
	});
})

/* general callings */
$(document).ready(function(){
	
	/* form buttons */
	$('.formBt').ChangeImgOver();
	$('.formBt2').ChangeImgOver();
	/* general */
	$('.fadeIn').ChangeImgOver();
	$('.fadeThis').fadeLink(0.8,1);
	$('.ChangeImgOver').ChangeImgOver();
	/* servicios */
	$('.fadeSoporte').fadeObj(0.8,1,'.thumb_soporte');
	$('.fadeProductos').fadeObj(0.8,1,'.thumb_productos');
	$('.fadeAlgoritmo').fadeObj(0.8,1,'.thumb_algoritmo');
	$('.fadeDesign').fadeObj(0.8,1,'.thumb_diseno');
	/* sidebar open/close all */
	$('#catTitle a').fadeLink(0.8,1);
});

//-->
