jQuery(function($){$.easing.outbounce=function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;}};$.easing.sineinout=function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b;};});$(window).load(function(){$('#existence').fadeIn(1500);$.scrollTo('50%',2000,{onAfter:function(){$('#angel').show();$('#devil').show();if($('#tuser').val()!=""){$('#go').click();}}});});var contentstore;$(document).ready(function(){var p=$.preloadCssImages();visited=getCookie('unmaskervisit');if(visited!=null&&visited!=""){$('#inputform').fadeIn(500);}else{$('#warning').fadeIn(500);}
$('#again').click(function(){reset();return false;});$('#reset').click(function(){reset();return false;});$('#closewarning').click(function(){$('#warning').fadeOut(500,function(){setCookie('unmaskervisit','visited',30);$('#inputform').fadeIn(800);if($('#tuser').val()!=""){$('#go').click();}});return false;});$('#tuser').keypress(function(e){if(e.which==13){$('#go').click();}});$('#go').click(function(){if($('#tuser').val()!=""){$('#inputform #theform').fadeOut(500,function(){$('#inputform #loading').fadeIn(500);});$.getJSON('ajaxhandler.php?user='+$('#tuser').val(),function(json){processCall(json);});}
return false;});$('#footer').hover(function(){$('#footer').stop();$('#footer').animate({"width":"18em"},800);},function(){$('#footer').stop();$('#footer').animate({"width":"0px"},800);});$('.aboutlink').click(function(){$('#about').fadeIn(500);return false;});$('#closeabout').click(function(){$('#about').fadeOut(300);return false;});$('#links a').click(function(){$('#links a').each(function(){var rel=$(this).attr('rel');$(rel).slideUp(250);});var rel=$(this).attr('rel');var href=$(this).attr('href');$(rel).css('background-image','url(img/greyloader.gif)');$(rel+' .wrap').html('');$(rel+' .wrap').load(href,function(){$(rel).css('background-image','none');});$(rel).slideDown(800);return false;});$('div.sideblock div.close').click(function(){$(this).parent().slideUp(500);});});function reset(){$('#fail').fadeOut(200);$('#person').fadeOut(200);$('#warning').fadeOut(200);$.scrollTo('50%',800,{easing:'outbounce',onAfter:function(){$('#angel p').hide();$('#devil p').hide();$('#tuser').val("");$('#inputform #theform').show();$('#inputform #loading').hide();$('#inputform').fadeIn(200);}});}
function processCall(json){$('#inputform').fadeOut(800,function(){switch(json.action)
{case"fail":$('#fail p').text(json.message);$('#fail').fadeIn(500);break;case"ascend":$('#angel p').text(json.avatarcomment);$('#person img').attr("src",json.imgurl);$('#person span').text(json.realname+" ("+json.username+")");$('#person p:first').text(json.translated);var tinyurl="http://unmasker.webdeveloper2.com/"+json.username;$('#tweetthis').attr("href","http://twitter.com/home?status=@"+$('#tuser').val()+" was too good for Unmasker "+tinyurl+" %23unmasked");$.get("ajaxhandler.php?shorturl="+tinyurl,function(data){$('#tweetthis').attr("href","http://twitter.com/home?status=@"+$('#tuser').val()+" was too good for Unmasker "+data+" %23unmasked");});$('#person').fadeIn(200,function(){$.scrollTo('0%',1800,{easing:'sineinout',onAfter:function(){$('#angel p').fadeIn(500);}});});break;case"descend":$('#devil p').text(json.avatarcomment);$('#person img').attr("src",json.imgurl);$('#person span').text(json.realname+" ("+json.username+")");$('#person p').text(json.translated);var tinyurl="http://unmasker.webdeveloper2.com/"+json.username;$('#tweetthis').attr("href","http://twitter.com/home?status=I unmasked @"+$('#tuser').val()+" "+tinyurl+" %23unmasked");$.get("ajaxhandler.php?shorturl="+tinyurl,function(data){$('#tweetthis').attr("href","http://twitter.com/home?status=I unmasked @"+$('#tuser').val()+" "+data+" %23unmasked");});$('#person').fadeIn(200,function(){$.scrollTo('100%',2000,{easing:'outbounce',onAfter:function(){$('#devil p').fadeIn(500);}});});break;default:reset();}});}
function getCookie(c_name){if(document.cookie.length>0){c_start=document.cookie.indexOf(c_name+"=");if(c_start!=-1){c_start=c_start+c_name.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1)c_end=document.cookie.length;return unescape(document.cookie.substring(c_start,c_end));}}
return"";}
function setCookie(c_name,value,expiredays)
{var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays);document.cookie=c_name+"="+escape(value)+((expiredays==null)?"":";expires="+exdate.toGMTString());};(function($){var $scrollTo=$.scrollTo=function(target,duration,settings){$(window).scrollTo(target,duration,settings);};$scrollTo.defaults={axis:'xy',duration:parseFloat($.fn.jquery)>=1.3?0:1};$scrollTo.window=function(scope){return $(window)._scrollable();};$.fn._scrollable=function(){return this.map(function(){var elem=this,isWin=!elem.nodeName||$.inArray(elem.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!isWin)
return elem;var doc=(elem.contentWindow||elem).document||elem.ownerDocument||elem;return $.browser.safari||doc.compatMode=='BackCompat'?doc.body:doc.documentElement;});};$.fn.scrollTo=function(target,duration,settings){if(typeof duration=='object'){settings=duration;duration=0;}
if(typeof settings=='function')
settings={onAfter:settings};if(target=='max')
target=9e9;settings=$.extend({},$scrollTo.defaults,settings);duration=duration||settings.speed||settings.duration;settings.queue=settings.queue&&settings.axis.length>1;if(settings.queue)
duration/=2;settings.offset=both(settings.offset);settings.over=both(settings.over);return this._scrollable().each(function(){var elem=this,$elem=$(elem),targ=target,toff,attr={},win=$elem.is('html,body');switch(typeof targ){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(targ)){targ=both(targ);break;}
targ=$(targ,this);case'object':if(targ.is||targ.style)
toff=(targ=$(targ)).offset();}
$.each(settings.axis.split(''),function(i,axis){var Pos=axis=='x'?'Left':'Top',pos=Pos.toLowerCase(),key='scroll'+Pos,old=elem[key],max=$scrollTo.max(elem,axis);if(toff){attr[key]=toff[pos]+(win?0:old-$elem.offset()[pos]);if(settings.margin){attr[key]-=parseInt(targ.css('margin'+Pos))||0;attr[key]-=parseInt(targ.css('border'+Pos+'Width'))||0;}
attr[key]+=settings.offset[pos]||0;if(settings.over[pos])
attr[key]+=targ[axis=='x'?'width':'height']()*settings.over[pos];}else{var val=targ[pos];attr[key]=val.slice&&val.slice(-1)=='%'?parseFloat(val)/100*max:val;}
if(/^\d+$/.test(attr[key]))
attr[key]=attr[key]<=0?0:Math.min(attr[key],max);if(!i&&settings.queue){if(old!=attr[key])
animate(settings.onAfterFirst);delete attr[key];}});animate(settings.onAfter);function animate(callback){$elem.animate(attr,duration,settings.easing,callback&&function(){callback.call(this,target,settings);});};}).end();};$scrollTo.max=function(elem,axis){var Dim=axis=='x'?'Width':'Height',scroll='scroll'+Dim;if(!$(elem).is('html,body'))
return elem[scroll]-$(elem)[Dim.toLowerCase()]();var size='client'+Dim,html=elem.ownerDocument.documentElement,body=elem.ownerDocument.body;return Math.max(html[scroll],body[scroll])
-Math.min(html[size],body[size]);};function both(val){return typeof val=='object'?val:{top:val,left:val};};})(jQuery);;jQuery.preloadCssImages=function(settings){settings=jQuery.extend({statusTextEl:null,statusBarEl:null,errorDelay:999,simultaneousCacheLoading:2},settings);var allImgs=[],loaded=0,imgUrls=[],thisSheetRules,errorTimer;function onImgComplete(){clearTimeout(errorTimer);if(imgUrls&&imgUrls.length&&imgUrls[loaded]){loaded++;if(settings.statusTextEl){var nowloading=(imgUrls[loaded])?'Now Loading: <span>'+imgUrls[loaded].split('/')[imgUrls[loaded].split('/').length-1]:'Loading complete';jQuery(settings.statusTextEl).html('<span class="numLoaded">'+loaded+'</span> of <span class="numTotal">'+imgUrls.length+'</span> loaded (<span class="percentLoaded">'+(loaded/imgUrls.length*100).toFixed(0)+'%</span>) <span class="currentImg">'+nowloading+'</span></span>');}
if(settings.statusBarEl){var barWidth=jQuery(settings.statusBarEl).width();jQuery(settings.statusBarEl).css('background-position',-(barWidth-(barWidth*loaded/imgUrls.length).toFixed(0))+'px 50%');}
loadImgs();}}
function loadImgs(){if(imgUrls&&imgUrls.length&&imgUrls[loaded]){var img=new Image();img.src=imgUrls[loaded];if(!img.complete){jQuery(img).bind('error load onreadystatechange',onImgComplete);}else{onImgComplete();}
errorTimer=setTimeout(onImgComplete,settings.errorDelay);}}
function parseCSS(sheets,urls){var w3cImport=false,imported=[],importedSrc=[],baseURL;var sheetIndex=sheets.length;while(sheetIndex--){var cssPile='';if(urls&&urls[sheetIndex]){baseURL=urls[sheetIndex];}else{var csshref=(sheets[sheetIndex].href)?sheets[sheetIndex].href:'window.location.href';var baseURLarr=csshref.split('/');baseURLarr.pop();baseURL=baseURLarr.join('/');if(baseURL){baseURL+='/';}}
if(sheets[sheetIndex].cssRules||sheets[sheetIndex].rules){thisSheetRules=(sheets[sheetIndex].cssRules)?sheets[sheetIndex].cssRules:sheets[sheetIndex].rules;var ruleIndex=thisSheetRules.length;while(ruleIndex--){if(thisSheetRules[ruleIndex].style&&thisSheetRules[ruleIndex].style.cssText){var text=thisSheetRules[ruleIndex].style.cssText;if(text.toLowerCase().indexOf('url')!=-1){cssPile+=text;}}else if(thisSheetRules[ruleIndex].styleSheet){imported.push(thisSheetRules[ruleIndex].styleSheet);w3cImport=true;}}}
var tmpImage=cssPile.match(/[^\("]+\.(gif|jpg|jpeg|png)/g);if(tmpImage){var i=tmpImage.length;while(i--){var imgSrc=(tmpImage[i].charAt(0)=='/'||tmpImage[i].match('://'))?tmpImage[i]:baseURL+tmpImage[i];if(jQuery.inArray(imgSrc,imgUrls)==-1){imgUrls.push(imgSrc);}}}
if(!w3cImport&&sheets[sheetIndex].imports&&sheets[sheetIndex].imports.length){for(var iImport=0,importLen=sheets[sheetIndex].imports.length;iImport<importLen;iImport++){var iHref=sheets[sheetIndex].imports[iImport].href;iHref=iHref.split('/');iHref.pop();iHref=iHref.join('/');if(iHref){iHref+='/';}
var iSrc=(iHref.charAt(0)=='/'||iHref.match('://'))?iHref:baseURL+iHref;importedSrc.push(iSrc);imported.push(sheets[sheetIndex].imports[iImport]);}}}
if(imported.length){parseCSS(imported,importedSrc);return false;}
var downloads=settings.simultaneousCacheLoading;while(downloads--){setTimeout(loadImgs,downloads);}}
parseCSS(document.styleSheets);return imgUrls;};