$(document).ready(function() {


// RESIZE CONTACT PAGE  ///////////////////////////////////////////////////////////////  


    $(window).bind('resize', function() {
$('div.fullscreen').css(($.browser.msie && $.browser.version < 7 ? '' : 'min-') + 'height', $(window).height() + 'px');
    }).trigger('resize');






// LOCAL-SCROLL  ///////////////////////////////////////////////////////////////  

	$.localScroll();

    
    
    
    
    
// TOOL-TIP    ///////////////////////////////////////////////////////////////  
    
        
	//Select all anchor tag with rel set to tooltip
	$('a[rel=tooltip]').mouseover(function(e) {
		
		//Grab the title attribute's value and assign it to a variable
		var tip = $(this).attr('title');	
		
		//Remove the title attribute's to avoid the native tooltip from the browser
		$(this).attr('title','');
		
		//Append the tooltip template and its value
		$(this).append('<div id="tooltip"><div class="tipHeader"></div><div class="tipBody">' + tip + '</div><div class="tipFooter"></div></div>');		
				
		//Show the tooltip with faceIn effect
		$('#tooltip').fadeIn('500');
		$('#tooltip').fadeTo('10',0.9);
		
	}).mousemove(function(e) {
	
		//Keep changing the X and Y axis for the tooltip, thus, the tooltip move along with the mouse
		$('#tooltip').css('top', e.pageY + 10 );
		$('#tooltip').css('left', e.pageX + 20 );
		
	}).mouseout(function() {
	
		//Put back the title attribute's value
		$(this).attr('title',$('.tipBody').html());
	
		//Remove the appended tooltip template
		$(this).children('div#tooltip').remove();
		
	});
	
	
	
	
	
	
// zooming-image-and-fading-caption    ///////////////////////////////////////////////////////////////  

	 
    //move the image in pixel
    var move = 0;
     
    //zoom percentage, 1.2 =120%
    var zoom = 1;
 
    //On mouse over those thumbnail
    $('.box').hover(function() {
         
        //Set the width and height according to the zoom percentage
        width = '274px';
        height = '304px';
        //width = $('.box').width() * zoom;
        //height = $('.box').height() * zoom;
         
        //Move and zoom the image
        $(this).find('img').stop(false,true).animate({'width':width, 'height':height, 'top':move, 'left':move}, {duration:200});
         
        //Display the caption
        $(this).find('div.caption').stop(false,true).fadeIn(300);
    },
    function() {
        //Reset the image
        $(this).find('img').stop(false,true).animate({'width':'274px', 'height':'304px', 'top':'0', 'left':'0'}, {duration:200});  
        // $(this).find('img').stop(false,true).animate({'width':$('.box').width(), 'height':$('.box').height(), 'top':'0', 'left':'0'}, {duration:400});  

        //Hide the caption
        $(this).find('div.caption').stop(false,true).fadeOut(300);
    });
 









 });
 
 
 
 
 
