$(document).ready(function(){
	
	var TopAddress = $('#showcaseHolder').height()+125;
	
		
	if($('#showcaseHolder').height() < $('#subMenu').height() || $('#subMenu').height() < 125 )
		var TopAddress = 507;
	$('#address').css({'top':TopAddress});
   
   	$("#showcaseHolder .showcase .overlay").fadeTo(0, 0.6);
   
	/*$("#showcaseHolder .showcase ").hover(
		function () {
			$(this).find('.overlay').stop().fadeTo('normal', 0.6);
		}, function () {
			$(this).find('.overlay').stop().fadeTo('normal', 0);
	});*/
	
	
	 $("input[type=file]").filestyle({ 
		 image: "/img/browse.gif",
		 imageheight : 29,
		 imagewidth : 29,
		 width : 150
 	});
	 
	 
	 
	 $('#imageSlider').cycle({
	    fx:      'fade',
	    timeout:  4000,
		random:  1
	});
	 
   	
});


function toggleSlideInBox()
{
	
	if ($("#slideInBox").css('width') == '55px') {
			
		$("#slideInBox").css('width', '700px');		
		$("#slideInBoxContent").animate({
			left: 0
			
		}, 1500);	
		
	}
	else {	
	
		$("#slideInBoxContent").animate({
			left: -550			
		}, 1500, 'linear', function(){$("#slideInBox").css('width', '55px')})		
		
	}		
	
	$('#slideInBox').toggleClass("open");
	$('#slideInBox').toggleClass("closed");
		
}

var selectedNewsThumbId = 'thumb0';

function changeMainNewsImage(id, img)
{
	$('#mainNewsImage').attr("src",img);
	
	$('#'+selectedNewsThumbId).show();
	$('#'+id).hide();
	
	selectedNewsThumbId = id;		
}

function openRealFileSelector(id)
{
	$('#'+id).click();	
}

function setFakeFileData(target, source)
{	
	var value = $('#'+source).val();	
	$('#'+target).attr("value", value);
}

function showReactionForm(){
	$('#jobContactForm').slideDown("slow");	
	$('#reactionBtn').hide();
}

