/* Copyright (c) 2009 Egon Hyszczak [egon_at_hyszczak_dot_net] Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ var _0x3cd6=["get","#container","#parallax","strongEaseInOut","","getPos","offsetLeft","offsetTop","goto_page","display","css","none","fadeIn","abs","h","style","left","px","addChild","\x0Agoto: moving horizontally [cX/fX]: ","/","v","top","\x0Agoto: moving vertically [cY/fY]: ","start","setPageSizes","getBrowserDimensions","MSIE","indexOf","userAgent","clientWidth","documentElement","clientHeight","innerWidth","innerHeight","getBrowserDimensions: [w/h] ","\x0A","#start","#contact","#skills","#about","#work","#extra","height","width","each","Microsoft","Chrome","log"];curPos=null;panel=null;run=true;var TransPanel=function (){var canvas=$(_0x3cd6[1])[_0x3cd6[0]](0);var parallax_canvas=$(_0x3cd6[2])[_0x3cd6[0]](0);var tweenType=Tween[_0x3cd6[3]];var duration=1.0;var textarea_message=_0x3cd6[4];this[_0x3cd6[5]]=function (obj){var curleft=0;var curtop=0;curleft+=obj[_0x3cd6[6]];curtop+=obj[_0x3cd6[7]];return [curleft,curtop];} ;this[_0x3cd6[8]]=function (container,destination){var current_position=this[_0x3cd6[5]]($(container)[_0x3cd6[0]](0));var final_position=this[_0x3cd6[5]]($(destination)[_0x3cd6[0]](0));var current_x=current_position[0];var current_y=current_position[1];var final_x=final_position[0]*-1;var final_y=final_position[1]*-1;curPos=destination;if($(_0x3cd6[2])[_0x3cd6[10]](_0x3cd6[9])==_0x3cd6[11]){$(_0x3cd6[2])[_0x3cd6[12]](3600);} ;var content_tween= new Parallel();var parallax= new Parallel();if((Math[_0x3cd6[13]](current_x)-Math[_0x3cd6[13]](final_x))!=0){content_tween[_0x3cd6[14]]= new Tween(canvas[_0x3cd6[15]],_0x3cd6[16],tweenType,current_x,final_x,duration,_0x3cd6[17]);content_tween[_0x3cd6[18]](content_tween[_0x3cd6[14]]);parallax[_0x3cd6[14]]= new Tween(parallax_canvas[_0x3cd6[15]],_0x3cd6[16],tweenType,(current_x/16),(final_x/16),duration,_0x3cd6[17]);parallax[_0x3cd6[18]](parallax[_0x3cd6[14]]);textarea_message+=_0x3cd6[19]+current_x+_0x3cd6[20]+final_x;} ;if((Math[_0x3cd6[13]](current_y)-Math[_0x3cd6[13]](final_y))!=0){content_tween[_0x3cd6[21]]= new Tween(canvas[_0x3cd6[15]],_0x3cd6[22],tweenType,current_y,final_y,duration,_0x3cd6[17]);content_tween[_0x3cd6[18]](content_tween[_0x3cd6[21]]);parallax[_0x3cd6[21]]= new Tween(parallax_canvas[_0x3cd6[15]],_0x3cd6[22],tweenType,current_y/6,final_y/6,duration,_0x3cd6[17]);parallax[_0x3cd6[18]](parallax[_0x3cd6[21]]);textarea_message+=_0x3cd6[23]+current_y+_0x3cd6[20]+final_y;} ;content_tween[_0x3cd6[24]]();parallax[_0x3cd6[24]]();} ;this[_0x3cd6[25]]=function (){this[_0x3cd6[26]]=function (){var width=0;var height=0;if(navigator[_0x3cd6[29]][_0x3cd6[28]](_0x3cd6[27])!=-1){width=document[_0x3cd6[31]][_0x3cd6[30]];height=document[_0x3cd6[31]][_0x3cd6[32]];} else {width=window[_0x3cd6[33]];height=window[_0x3cd6[34]];} ;textarea_message+=_0x3cd6[35]+width+_0x3cd6[20]+height+_0x3cd6[36];return [width,height];} ;dimensions=this[_0x3cd6[26]]();tPos=0;lPos=0;padding=65;columns=3;var elements=[_0x3cd6[37],_0x3cd6[38],_0x3cd6[39],_0x3cd6[40],_0x3cd6[41],_0x3cd6[42]];$[_0x3cd6[45]](elements,function (index,value){width=dimensions[0];height=dimensions[1];$(value)[_0x3cd6[10]](_0x3cd6[44],width+_0x3cd6[17])[_0x3cd6[10]](_0x3cd6[43],height+_0x3cd6[17]);$(value)[_0x3cd6[10]](_0x3cd6[22],tPos+_0x3cd6[17])[_0x3cd6[10]](_0x3cd6[16],lPos+_0x3cd6[17]);lPos+=width+padding;if((index+1)%columns==0){lPos=0;tPos+=height+padding;} ;} );if(curPos){if(run==true){var reLoc=setTimeout(function (){panel[_0x3cd6[8]](_0x3cd6[1],curPos);run=true;} ,800);} ;run=false;} ;} ;var debug=function (message){if(navigator[_0x3cd6[29]][_0x3cd6[28]](_0x3cd6[46])!=-1){alert(message);} else {if(navigator[_0x3cd6[29]][_0x3cd6[28]](_0x3cd6[47])!=-1){alert(message);} else {console[_0x3cd6[48]](message);} ;} ;} ;} ; //On Document Ready $(document).ready(function() { panel = new TransPanel(); //Attach gradient $(".gradient h1").prepend(""); panel.setPageSizes(); //bind click events var click_objects = ['.goto_contact', '.goto_skills', '.goto_work', '.goto_about', '.goto_start']; for(x in click_objects) { var obj = click_objects[x]; $(obj).live('click', {msg: obj}, function(event) { event.preventDefault(); var destination = '#'+event.data.msg.substring(6); panel.goto_page('#container', destination); //Set a cookie to track last page visited createCookie('hyszczak.net', destination, 1); //Not ready yet. //window.location.hash = destination; }); } $("#toggle_debug").click(function() { textarea_message = ""; $("#status_area").toggle(); }); //Rearrange content are placement on window resize window.onresize = panel.setPageSizes; //Scrolling var scrollPos = new Array(); scrollPos['work'] = 0; scrollPos['about'] = 0; scrollPos['skills'] = 0; var downIntervalID; var upIntervalID; $('div.scroll-up').each(function() { $(this).hover(function() { var scrollPos = 0; var id = $(this).parent().attr('id'); var target = id.split('-')[0]; //Mouseover upIntervalID = setInterval(function() { scrollUp(target); }, 20); },function() { //Mouseout clearInterval(upIntervalID); } ); }); $('div.scroll-down').each(function() { $(this).hover(function() { var id = $(this).parent().attr('id'); var target = id.split('-')[0]; //Mouseover downIntervalID = setInterval(function() { scrollDown(target); }, 20); },function() { //Mouseout clearInterval(downIntervalID); } ); }); function scrollDown(section) { scrollPos[section] += 6; $('div#' + section + ' div.inside').scrollTo(scrollPos[section], 0); } function scrollUp(section) { if(scrollPos[section] > 0) { scrollPos[section] -= 6; $('div#' + section + ' div.inside').scrollTo(scrollPos[section], 0); } } $("#submit").click(function(e) { e.preventDefault(); var email_address = $("input[name=email]").val(); var reason = $("select[name=reason]").val(); var message = $("textarea[name=message]").val(); //Email address filter var filter = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/; if(filter.test(email_address)) { //clear the email field $.get('mail.php', {email: email_address, reason: reason, message: message, secret: "sp3shul"}, function(data) { //Clear email field $("input[name=email]").val(""); //Show dialog create_dialog("Thanks!"); }); } }); function create_dialog(title) { //Create dialog content thanks = $('
').attr('id', 'dialog').attr('title', title).appendTo('#container'); $(thanks).html('

I appreciate your interest and will respond promptly.

'); //Open Dialog setTimeout(function() { thanks.dialog({ show: 'scale', hide: 'explode', bigirame: true, modal: true, title: title, resizable: false }); }, 1); }; //Update container position every 250ms //setInterval(panel.trackPosition, 250); }); /* original version getPos = function(obj) { var curleft = 0; var curtop = 0; if(obj.offsetParent) { do { curleft += obj.offsetLeft; curtop += obj.offsetTop; } while (obj = obj.offsetParent); } return [curleft, curtop]; }; */