// JavaScript Document 
$(function(){
	if($.browser.msie && parseInt($.browser.version) == 7)
	{
	  $('#faderText').hide().show();
	}
		
	$.preloadImages("http://www.tallemu.com/img/box1.jpg", "http://www.tallemu.com/img/box2.jpg", "http://www.tallemu.com/img/box3.jpg", "http://www.tallemu.com/img/box4.jpg", "http://www.tallemu.com/img/box5.jpg", "http://www.tallemu.com/img/box6.jpg", "http://www.tallemu.com/img/box.jpg", "http://www.tallemu.com/img/box7.jpg", "http://www.tallemu.com/img/box8.jpg", "http://www.tallemu.com/img/box9.jpg", "http://www.tallemu.com/img/box10.jpg", "http://www.tallemu.com/img/box11.jpg", "http://www.tallemu.com/img/box12.jpg"); 
		
	$("ul.sf-menu").supersubs({ 
		minWidth:    12,   // minimum width of sub-menus in em units 
		maxWidth:    27,   // maximum width of sub-menus in em units 
		extraWidth:  1     // extra width can ensure lines don't sometimes turn over 
						   // due to slight rounding differences and font-family 
	}).superfish();  // call supersubs first, then superfish, so that subs are 
					 // not display:none when measuring. Call before initialising 
					 // containing tabs for same reason. 
	
	setTimeout(function(){
		$('#fader').innerfade({ speed: 5, timeout: 900, type: 'sequence', containerheight: '358px' });
	}, 2000);
	
	$('#sideFader').innerfade({ speed: 1000, timeout: 3000, type: 'sequence', containerheight: '132px' });
	
	$('a[rel*=facebox]').facebox({ close_image : 'img/closelabel.gif' });
	


	$('h4.keyToggle').css({
		cursor: 'pointer',
		backgroundImage: 'url(/img/bg-feature.jpg)'
	}) .toggle(
	   function(){
		$('#keyWrap').slideDown(1500);
		$('h4.keyToggle').css('background-image', 'url(/img/bg-feature1.jpg)');
	  },
	  function(){
		$('#keyWrap').slideUp(250);
		$('h4.keyToggle').css('background-image', 'url(/img/bg-feature.jpg)');
	  }
	); 
	if($("a[rel^='prettyPhoto']").is('*')) {
		$("a[rel^='prettyPhoto']").prettyPhoto();
	}
	
	if($('#contactForm').is('*')) {
		$('#contactForm').validate();
	}
	
}); 
jQuery.preloadImages = function()
{
  for(var i = 0; i<arguments.length; i++)
  {
    jQuery("<img>").attr("src", arguments[i]);
  }
}
 