		var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65"; 
		$(document).keydown(function(e) { 
		  kkeys.push( e.keyCode ); 
		  if ( kkeys.toString().indexOf( konami ) >= 0 ){ 
		    $(document).unbind('keydown', arguments.callee); 
		    //alert("KONAMI!!");
	      /*$(document).pageSlide({
	          width: "300px"
	      });*/
		  } 
		}); 
		
		/*
			Resize aA text - temporary test
			$(document).click(function(){
			var ourText = $('p');
			var currFontSize = ourText.css('fontSize');
			var finalNum = parseFloat(currFontSize, 10);
			var stringEnding = currFontSize.slice(-2);
			finalNum += 1;
			ourText.css('fontSize', finalNum + stringEnding);
		});*/
		
		// Coda Slider
		jQuery(window).bind("load", function() {
			jQuery("div#slider1").codaSlider( { tabLocation:"below", showArrows:false } );
			jQuery("div#slider2").codaSlider( { tabLocation:"above", showArrows:false } );
		});
		
	
		if (jQuery.support.scriptEval) {	// Actually, right now this equals to 'if([... != Internet Explorer...])'
			// Preload images for Form Buttons
			var imgpath = 'skn/img/';
			var bases = ['send_btn', 'send_btn_el', 'submit_btn', 'submit_btn_el'];
			var types = ['', '_hover', '_down', '_disabled'];
			var arr = [];
			for (var b in bases) {
				for (var t in types) {
					arr.push( imgpath + bases[b] + types[t] + ".gif" );
				}
			}
			
			var bases = ['Search_Button_1_en_CCA3AD20', 'Search_Button_1_el_CCA3AD20'];
			for (var b in bases) {
				for (var t in types) {
					arr.push( imgpath + bases[b] + types[t] + ".png" );
				}
			}
			$.preloadImages(arr);
		}
		
		jQuery(document).ready(function() {
			// Mega menus -----------------------------------
			// Trigger hover event
      function addMega(){
        $(this).addClass("hovering");
        var x = $(this).offset().left - $('#mainNav').offset().left;
        
        // If the window is small and does not fit the mega menu at the right side, bring the menu to the left
        var div = $(this).children(":eq(1)");
        var offset = $(this).offset();
        var diff = offset.left + div.outerWidth() - $(window).width();
        if (diff > 0)
        	x -= (diff + 10);	// add some padding, as whitespace
        
        div.css("left", x).css("position", "absolute");
        
				if (jQuery.support.opacity) {
					div.css("opacity", "0");
					div.stop(true).animate({opacity:1}, {duration:100, easing:"swing"});
				}
      }
 
 			// Trigger out event
      function removeMega(){
        $(this).removeClass("hovering");
      }
	    var megaConfig = {
	         interval: 300,
	         sensitivity: 4,
	         over: addMega,
	         timeout: 300,
	         out: removeMega
	    };
	    $("li.mega").hoverIntent(megaConfig);
	    // End of mega menus -------------------------------
	    
	    
	    // Forms - Usability features when having field errors
	    var errors = $('.inlineError');
	    // If there are errors in the submitted form, place the focus on the first field that has error
	    if (errors.size() > 0) {
	    	$('form .inlineError:first').parent().find(':input').focus();
	    	$('form .inlineError').parent().find(':input').addClass("error");
	    }
	    // else focus on the first element of the form
	    else
	    	$('.first-form-field input:visible:enabled:first').focus();	// Cannot use $('form input:visible:enabled:first').focus();, because on simple pages will focus on the Search field
	    
	    // Create hover, down and disable images for Form submit buttons ---------------
	    function findImgButSrcDetails(btn) {
	    	var src = btn.attr("src");
	    	var base = src;
	    	var ind = src.lastIndexOf(".");
	    	var ext = '';
	    	if (ind > 0) {
	    		ext = src.substr(ind);
	    		base = src.substr(0, ind);
	    	}
	    	base = base.replace("_hover", "");
	    	base = base.replace("_down", "");
	    	base = base.replace("_disabled", "");
	    	return { base:base, ext:ext}
	    }
	    function imgButtonHover() {
	    	var obj = findImgButSrcDetails($(this));
	    	if ($(this).hasClass("search")) {
	    		obj.base = obj.base.replace("skn/", "");
	    		obj.base = obj.base.replace("img/", "skn/img/");
	    	}
	    	$(this).attr("src", obj.base + "_hover" + obj.ext);
	    }
	    function imgButtonNormal() {
	    	var obj = findImgButSrcDetails($(this));
	    	if ($(this).hasClass("search")) {
	    		obj.base = obj.base.replace("skn/", "");
	    		obj.base = obj.base.replace("img/", "skn/img/");
	    	}
	    	$(this).attr("src", obj.base + obj.ext);
	    }
	    function imgButtonDown() {
	    	var obj = findImgButSrcDetails($(this));
	    	if ($(this).hasClass("search")) {
	    		obj.base = obj.base.replace("skn/", "");
	    		obj.base = obj.base.replace("img/", "skn/img/");
	    	}
	    	$(this).attr("src", obj.base + "_down" + obj.ext);
	    }
	    function imgButtonDisabled() {
	    	var btn = $('input.img-button');
	    	btn.click(function() { return false; } );
	    	if (btn.hasClass("search")) return;
	    	
	    	var obj = findImgButSrcDetails(btn);
	    	btn.attr("src", obj.base + "_disabled" + obj.ext);
				$('input.img-button').unbind("mouseout", imgButtonNormal);
				$('input.img-button').unbind("mouseover", imgButtonHover);
				$('input.img-button').unbind("mousedown", imgButtonDown);
	    }
			$('input.img-button').bind("mouseover", imgButtonHover);
			$('input.img-button').bind("mouseout", imgButtonNormal);
			$('input.img-button').bind("mousedown", imgButtonDown);
			$('form').submit(imgButtonDisabled);
	    // End of images for Form submit buttons ---------------------------------------
	    
			
			/* Textarea Auto resize */
			$('textarea').css("max-height", "240px").elastic();
			
			
			/* Using jQuery to Show/Hide Form Elements Based on a Checkbox Selection */
			//Hide div w/id extra
      $(".extra").css("opacity", "0");
			
			// Add onclick handler to checkbox w/id checkme
      $(".checkme").click(function(){
	     	var chkbox = $(this).find("input[type='checkbox']:first");
	      var id = $(this).attr("class");
	      var tmp = id.split(" ");
	      id = tmp[tmp.length - 1];
	      id = id.substr(id.indexOf("_") + 1);
		    
		    var width = $("input[id$='" + id + "']").parent().width() - 1;	// explained later (crazy workaround for Chrome)
		    
		    if (chkbox.is(":checked")) {
		    	//show the hidden div
		      $("input[id$='" + id + "']").parent().stop(true).animate({opacity:1}, 150, "linear", function() {$(this).css("width", width + "px"); } );	// On Chrome, without the callback the div disappears after anim is complete!!
		    } else {
		      //otherwise, hide it
		      $("input[id$='" + id + "']").parent().stop(true).animate({opacity:0}, 150, "linear");
		    }
      });
      
			
   		// Carousel
			var params = {start:global_otherProjectsCarouselIndex,
										scroll:4,
										wrap: 'last'};
		  jQuery('#mycarousel').jcarousel(params);
		  
		  $('a.top').click(function(event)	{
		  	$.scrollTo( '#header', 1000 );
		  });	
		  
		  $('a.toContent').click(function(event)	{
		  	$.scrollTo( '#content', 1000 );
		  });	
		
			// pageSlide
      /*$('a.pageslide').pageSlide({
          width: "300px"
      });*/
		
			// Fade-in ZEFXIS logo
			if (jQuery.support.opacity) {
				var hid = "#headerFade";
				$('<span class="fake-hover"></span>').css("opacity", "0").prependTo($(hid));
				$(hid + " a").bind("mouseover",function(){
					$(hid +" .fake-hover").stop(true).animate({opacity:1}, {duration:400, easing:"swing"});
				});
				$(hid +" a").bind("mouseout",function(){
					$(hid +" .fake-hover").stop(true).animate({opacity:0}, {duration:400, easing:"swing"});
				});
			}
		
		
	    // Twitter feed
	    var div = $("#twitter");
	    if (div.length > 0) {
		    div.getTwitter({
					userName: "Zefxis",
					numTweets: 2,
					loaderText: "Loading tweets...",
					slideIn: false,
					showHeading: false,
					showProfileLink: false
				});
			}
		
		
			animatedcollapse.addDiv('webdesignprojectstoggle', 'fade=1, speed=500')
			animatedcollapse.addDiv('corpidentityprojectstoggle', 'fade=1, speed=500')
			animatedcollapse.addDiv('seoprojectstoggle', 'fade=1, speed=500')
			animatedcollapse.addDiv('gameprojectstoggle', 'fade=1, speed=500')
			
			animatedcollapse.ontoggle = function($, divobj, state){
				if (divobj != null && (divobj.id=="webdesignprojectstoggle" || divobj.id=="corpidentityprojectstoggle" || divobj.id=="seoprojectstoggle" || divobj.id=="gameprojectstoggle")) {
					document.getElementById(divobj.id+"-button").src=(state=="block")? "../skn/img/moreprojects_button_pressed.gif" : "../skn/img/moreprojects_button.gif"
				}
			}
			animatedcollapse.init()
		
		});	// close document ready function