function strpos (haystack, needle, offset) {
    var i = (haystack+'').indexOf(needle, (offset ? offset : 0));
    return i === -1 ? false : i;
}
function makeURL(str) {
    var strAux = str.toLowerCase();
    strAux = strAux.replace(/-/g," ");
    strAux = strAux.replace(/^\s*|\s*$/g,"");
    while(strAux.indexOf("/")!=-1) strAux = strAux.replace("/","-");
    while(strAux.indexOf("(")!=-1) strAux = strAux.replace("(","");
    while(strAux.indexOf(")")!=-1) strAux = strAux.replace(")","");
    while(strAux.indexOf("*")!=-1) strAux = strAux.replace("*","");
    strAux = strAux.replace(/ /g,"-");
    strAux = strAux.replace(/á/g,"a");
    strAux = strAux.replace(/é/g,"e");
    strAux = strAux.replace(/í/g,"i");
    strAux = strAux.replace(/ó/g,"o");
    strAux = strAux.replace(/ú/g,"u");
    strAux = strAux.replace(/ñ/g,"n");
    while(strAux.indexOf("--")!=-1) strAux = strAux.replace("--","-");
    return strAux;
}
$(document).ready(function() {
	$(".project_thumbs .thumbnail:last").addClass("last");
	$('a.nudge_l1').hover(function() { $(this).animate({ paddingLeft: 14 },200); }, function() { $(this).animate({ paddingLeft: 4 }, 100); });
	$('a.nudge_l2').hover(function() { $(this).animate({ paddingLeft: 24 },200); }, function() { $(this).animate({ paddingLeft: 14 }, 100); });
	$('a.nudge_l3').hover(function() { $(this).animate({ paddingLeft: 37 },200); }, function() { $(this).animate({ paddingLeft: 27 }, 100); });
	$("input[type=text]").addClass("inputSize");
	$('a').each(function(){
		if(strpos(this.href,'@')){
			e = this.href.replace('@','(encrAnf)');
			this.href = e;
		}
	});
	$('a').click(function(){
		if(strpos(this.href,'(encrAnf)')){
			e = this.href.replace('(encrAnf)','@');
			this.href = e;
		}
	});
});
Cufon.replace([ 'h1', 'h2', 'h3', 'h4' ]);
