
function showElement(layer){
var myLayer = document.getElementById(layer);
if(myLayer.style.display=="none"){
myLayer.style.display="block";
myLayer.backgroundPosition="top";
} else { 
myLayer.style.display="none";
}
}

// jQuery:::
$(function(){
			
			
			
			/*
			################################################################################
			#------------------------------------------------------------------------------#
			#  SCROLL PAGE UP
			#------------------------------------------------------------------------------#
			################################################################################
			*/
			/*
			$("#scrollUp").click(function(){
					if( $.browser.opera ){
					$("html").animate({scrollTop: 0},3000);
					}else {
						$("html,body").animate({scrollTop: 0},3000); 
					}
			});
			
			  
             $('#scrollDown').click(function () {
                 $('html, body').animate({
                     scrollTop: $(document).height()
                 },
                 3000);
                 return false;
			});	
			*/
			
			/*
			################################################################################
			#------------------------------------------------------------------------------#
			#  RIGHT Tabs pop
			#------------------------------------------------------------------------------#
			################################################################################
			*/	

				
			
			$('.leftOut').hover(function(){			
				$(this).stop().animate({'right': myPhpVar},400);
				
			
			}, function(){
			
				$(this).stop().animate({'right':'-168px'},1000);
				
			});
			
			
			
		// do ghost type for element
		$("#contactPageMessage").ghostType();
		
			/*
			################################################################################
			#------------------------------------------------------------------------------#
			#  BOTTOM MENU
			#------------------------------------------------------------------------------#
			################################################################################
			*/
		
	
			$('#dock2').Fisheye(
				{
					maxWidth: 80,
					items: 'a',
					itemsText: 'span',
					container: '.dock-container2',
					itemWidth: 35,
					proximity: 80,
					alignment : 'left',
					valign: 'bottom',
					halign : 'center'
				}
			)
			
			// slide dock UP and Nown on mouse hover
			$('.dock-container2').hover(function(){			
				$('#slidebox').stop().animate({'height': '160px'},400);
			
			
			}, function(){
			
				$('#slidebox').stop().animate({'height':'40px'},800);
				
			});
		
			
	
			
});




			
	







/*
################################################################################
#------------------------------------------------------------------------------#
#  Slide out bottom dock and Hinde right menu on scroll -- 
#------------------------------------------------------------------------------#
################################################################################
*/
/* when reaching the element with id "last" we want to show the slidebox. Let's get the distance from the top to the element */

/*
$(window).scroll(function(){		
		
		
		var distanceTop = $('#last').offset().top - $(window).height();
		
		if  ($(window).scrollTop() > distanceTop){
			$('#dock2').stop(true).css({'visibility':'visible'},800);
			$('#slidebox').stop(true).css({'visibility':'visible'},400);			
			$('.leftOut').stop(true).animate({'right':'-230px'},800);
		}else{ 
			$('#dock2').stop(true).animate({'visibility':'hidden'},400);			
			$('#slidebox').stop(true).animate({'visibility':'hidden'},800);
			$('.leftOut').stop(true).animate({'right':'-150px'},400);
			}

			
	});
	*/
	



/*
################################################################################
#------------------------------------------------------------------------------#
#  Ghost typer plugin
#------------------------------------------------------------------------------#
################################################################################
*/	


(function( $ ){

    $.fn.ghostType = function() {



        return this.each(function() {



            var $this = $(this);

            var str = $this.html();

            $this.empty().show();

            str = str.split("");

            str.push("_");



            // increase the delay to ghostType slower

            var delay = 30;



            $.each(str, function (i, val) {

                if (val == "^") {

                    // Do nothing. This will add to the delay.

                }

                else {

                    $this.append('<span>' + val + '</span>');

                    $this.children("span").hide().fadeIn(100).delay(delay * i);



                }

            });

            $this.children("span:last").css("textDecoration", "blink");



        });



    };

})( jQuery );


