$.fn.wait=function(time,type){time=time||1000;type=type||"fx";return this.queue(type,function(){var self=this;setTimeout(function(){$(self).dequeue();},time);});};function error(){$('#resize').focus(function(){$(this).parent().parent().stop(true,true).effect("highlight",{},1500);});$('#redo').click(function(){$(this).toggle();$('#enviando').toggle();});};function pref(){var $opened=$('a#popen'),$closed=$('a#pclosed'),$prefPanel=$('#pref-panel');$closed.click(function(){$prefPanel.slideDown('slow');$opened.toggle();$(this).toggle();});$opened.click(function(){$prefPanel.slideUp('slow');$closed.toggle();$(this).toggle();});$('#cortarurl').change(function(){var checked=$(this).is(':checked')?'1':'0';var url='js/pref.php?url='+checked;$.ajax({url:url});});$('#savepref').click(function(){$prefPanel.slideUp('slow');$closed.toggle();$opened.toggle();});};function upload(){var $localUP=$('#localUP'),$remoteT=$('a.remota'),$localT=$('a.local'),$uploadDiv=$('#contenedorupload'),$uploadBtn=$('#subir'),$resize=$('#resize'),$ropen=$('a#ropen'),$rclose=$('a#rclosed'),$progBar=$('#enviando');$remoteT.click(function(){$('#subir_local').fadeOut(.5);$('#subir_remota').wait(.5).fadeIn("slow");$('#linklocal').toggle();$('#linkremota').toggle();$('#remotaUP').focus();});$localT.click(function(){$('#subir_remota').fadeOut(.5);$('#subir_local').wait(.5).fadeIn("slow");$('#linklocal').toggle();$('#linkremota').toggle();$('#localUP').focus();});$uploadDiv.click(function(){$uploadDiv.stop(true,true).effect("highlight",{},1500);});$rclose.click(function(){$(this).toggle();$ropen.toggle();$('#redimensionar-borde').slideDown("slow");});$ropen.click(function(){$(this).toggle();$rclose.toggle();$('#redimensionar-borde').slideUp("slow");});$resize.click(function(){$(this).parent().stop(true,true).effect("highlight",{},1500);});$uploadBtn.click(function(){$(this).toggle();$progBar.fadeIn('fast');});};function process(){$('#sharing').click(function(){$.scrollTo('#share');});};function viewer(){var $sopen=$('a#sharing'),$sclose=$('a#sharing-close');$sopen.click(function(){$('#share').slideDown('3000',function(){$.scrollTo('#share');});$(this).toggle();$sclose.toggle();});$sclose.click(function(){$('#share').slideUp('3000');$(this).toggle();$sopen.toggle();});};function social(){var $d1=$('#d-delicious'),$facebook=$('#d-facebook'),$google=$('#d-google'),$tumbler=$('#d-tumblr'),$twitter=$('#d-twitter'),$vis=$('#d-visualizeus');$('#delicious').mouseenter(function(){$d1.stop(true,true).fadeIn('fast');}).mouseleave(function(){$d1.fadeOut('fast');});$('#facebook').mouseenter(function(){$facebook.stop(true,true).fadeIn('fast');}).mouseleave(function(){$facebook.fadeOut(0);});$('#google').mouseenter(function(){$google.stop(true,true).fadeIn('fast');}).mouseleave(function(){$google.fadeOut(0);});$('#tumblr').mouseenter(function(){$tumbler.stop(true,true).fadeIn('fast');}).mouseleave(function(){$tumbler.fadeOut(0);});$('#twitter').mouseenter(function(){$twitter.stop(true,true).fadeIn('fast');}).mouseleave(function(){$twitter.fadeOut(0);});$('#visualizeus').mouseenter(function(){$vis.stop(true,true).fadeIn('fast');}).mouseleave(function(){$vis.fadeOut(0);});};
