$(document).ready(function(){
	initResize();
	doResize();
	initHeight();
	doHeight();
	initWidth();
	doWidth();
	
	$("#slider").easySlider({
					auto: false,
					continuous: true 
	});
	
	$("#overflow").hide();
	$("#overflow").fadeIn(2000);
	$("#slider").hide();
	$("#slider").fadeIn(2000);
	
	/*$("#slider").jCarouselLite({
        btnNext: ".next",
        btnPrev: ".prev",
		easing: "easeinout",
    	speed: 700,
		visible: 1
    });*/
	$(".prev").html('');
	$(".next").html('');
	
	$(".preload").hover(function(){$(".boxcaption").animate({bottom:'0px'},{queue:false,duration:500})},
										 
	function(){$(".boxcaption").animate({bottom:'-200px'},{queue:false,duration:500})});
	$(".boxcaption").hover(function(){$(".boxcaption").animate({bottom:'0px'},{queue:false,duration:500})},
										 
	function(){$(".boxcaption").animate({bottom:'-200px'},{queue:false,duration:500})})
});

function initResize(){
	$(window).resize(function(){
		doResize();
	});
}
function doResize(){
	if ( $(window).width() <1252 ){
		$(".contentWelcome ").css({
			position:"absolute",
			left:"500px",
			bottom:"0px"
			
});	
		$(".home_info ").css({
			position:"absolute",
			left:"480px",
			top:"125px"
		});	
				
	}else{
		$(".contentWelcome").css({
			position:"absolute",
			left:"730px",
		    bottom:"0px"
		});	
		$(".home_info").css({
			position:"absolute",
			left:"650px",
		    top:"110px"
		});	
	}
}


function initHeight(){
	$(window).resize(function(){
		doHeight();
	});
}
function doHeight(){
	
	if($(window).height() <700 ){
		$("#overflow").css('overflow-y', 'auto');	
		$("#slider ul li img").not($(".noResize")).css('height', '550px');
		$("#slider ul li").css('overflow', 'auto');
		$("#slider li").css('height','600px');
		$("#navInner").css('height','75px');
		$("#profile_text").css('fontSize', '12px');
		$('#career_text').css('fontSize', '12px');
		
	}
	
	
	/*if($(window).height() <700 ){
		$("#overflow").css('overflow-y', 'auto');	
		$("#slider ul li img").css('height', '550px');
		$("#slider ul li").css('overflow', 'auto');
		$("#slider li").css('height','600px');
		$("#navInner").css('height','75px');
		$("#profile_text").css('fontSize', '12px');
		$('#career_text').css('fontSize', '12px');
		
	}*/
	/*if($(window).height() >650 && $(window).height() <700){
		$("#overflow").css('overflow-y', 'hidden');	
		$("#slider ul li img").css('height', '600px');
	}if ( $(window).height() >700 && $(window).height() < 820 ){
		$("#overflow").css('overflow-y', 'hidden');	
		$("#slider ul li img").css('height', '650px');
	}if( $(window).height() >820 ){
		$("#overflow").css('overflow-y', 'hidden');	
		$("#slider ul li img").css('height', '700px');
	}*/
}

function initWidth(){
	$(window).resize(function(){
		doWidth();
	});
}
function doWidth(){
	/*if ($(window).width() >750 && $(window).width() < 960 ){
		$("#overflow").css('overflow-x', 'hidden');	
		$("#slider ul li").css('width', '800px');	
		$("#slider ul li").css('overflow', 'hidden');	
	}
	
	
	if($(window).width() >960 && $(window).width() < 1300){
		$("#overflow").css('overflow-x', 'hidden');	
		$("#slider ul li").css({width: '1000px'});
		$("#slider ul li").css('overflow', 'hidden');
		
	}
	if($(window).width() >1300 && $(window).width() < 1500){
		$("#overflow").css('overflow-x', 'hidden');	
		$("#slider ul li").css({width: '1200px'});
		$("#slider ul li").css('overflow', 'hidden');
		
	}
	
	if($(window).width() >1500 ){
		$("#overflow").css('overflow-x', 'hidden');	
		$("#slider ul li").css({width: '1500px'});
		$("#slider ul li").css('overflow', 'hidden');
		
	}*/
}

/*$(function () {
	$('img.preload').hide();//hide all the images on the page
	
	$('img.preload').css({
			visibility:"visible"
	});	

	$('div.contentWelcome').css({
			visibility:"visible"
	});
		
});*/

/*var i = 0;//initialize
var int=0;//Internet Explorer Fix
$(window).bind("load", function() {//The load event will only fire if the entire page or document is fully loaded
	var int = setInterval("doThis(i)",500);//500 is the fade in speed in milliseconds
	});

function doThis() {
	var imgs = $('img.preload').length;//count the number of images on the page
	if (i >= imgs) {// Loop the images
		clearInterval(int);//When it reaches the last image the loop ends
	}
	$('img.preload:hidden').eq(0).fadeIn(500);//fades in the hidden images one by one
	i++;//add 1 to the count
}*/
jQuery(function(){
			jQuery('ul.sf-menu').superfish();
		});
