/*	When document is full loaded (ready) init
 *  dom element's behaviours and animations 
 */

$url = 'http://dmtecgroup.eu/';

$.ifixpng($url+'images/pixel.gif');

sIFR.activate(myriadprocond);

sIFR.replace(myriadprocond, {
  selector: 'h1',
  wmode: 'transparent',
  css: {
	'.sIFR-root': {
		'color': '#000000',
		'font-weight': 'lighter',
		'font-size': '18px'
	}
  }
});

$(document).ready(function(){
	//Transparency fix for IE6
	$('a#logo1, a#logo2, div#server1, div#server2, div#sponsors_content img, div.akredytacje img').ifixpng();
	
		$('.sponsors_fader').cycle({
			fx: 'scrollDown',
			speed: 2000,
			timeout: 7000
		});
	
	if ($.browser.msie & $.browser.version < 7) {
		$('.highlight').css({
			'background': 'none'
		});
		
		$('#menu1').css({
			'background': 'transparent url(' + $url + 'images/bt_menu1_ie.png) no-repeat 0 0'
		});
		$('#menu2').css({
			'background': 'transparent url(' + $url + 'images/bt_menu2_ie.png) no-repeat 0 0'
		});
		$('#menu3').css({
			'background': 'transparent url(' + $url + 'images/bt_menu3_ie.png) no-repeat 0 0'
		});
		$('#menu4').css({
			'background': 'transparent url(' + $url + 'images/bt_menu4_ie.png) no-repeat 0 0'
		});
		$('#menu5').css({
			'background': 'transparent url(' + $url + 'images/bt_menu5_ie.png) no-repeat 0 0'
		});
		$('#menu6').css({
			'background': 'transparent url(' + $url + 'images/bt_menu6_ie.png) no-repeat 0 0'
		});
		$('#menu7').css({
			'background': 'transparent url(' + $url + 'images/bt_menu7_ie.png) no-repeat 0 0'
		});
		$('#menu8').css({
			'background': 'transparent url(' + $url + 'images/bt_menu8_ie.png) no-repeat 0 0'
		});
		$('#menu9').css({
			'background': 'transparent url(' + $url + 'images/bt_menu9_ie.png) no-repeat 0 0'
		});
		
		$('#menu1').hover(function(){
			$(this).addClass('menu_hover');
		}, function(){
			$(this).removeClass('menu_hover');
		});
		
		$('#menu2').hover(function(){
			$(this).addClass('menu_hover');
		}, function(){
			$(this).removeClass('menu_hover');
		});
		
		$('#menu3').hover(function(){
			$(this).addClass('menu_hover');
		}, function(){
			$(this).removeClass('menu_hover');
		});
		
		$('#menu4').hover(function(){
			$(this).addClass('menu_hover');
		}, function(){
			$(this).removeClass('menu_hover');
		});
		
		$('#menu5').hover(function(){
			$(this).addClass('menu_hover');
		}, function(){
			$(this).removeClass('menu_hover');
		});
		
		$('#menu6').hover(function(){
			$(this).addClass('menu_hover');
		}, function(){
			$(this).removeClass('menu_hover');
		});
		
		$('#menu7').hover(function(){
			$(this).addClass('menu_hover');
		}, function(){
			$(this).removeClass('menu_hover');
		});
		
		$('#menu8').hover(function(){
			$(this).addClass('menu_hover');
		}, function(){
			$(this).removeClass('menu_hover');
		});
		
		$('#menu9').hover(function(){
			$(this).addClass('menu_hover');
		}, function(){
			$(this).removeClass('menu_hover');
		});
		
	}
	else {
	
		$('#menu1').hover(function(){
			$('#menu1_h').stop(true, false);
			$(this).addClass('menu_hover');
			$('#menu1_h').animate({
				opacity: 1
			}, 300);
		}, function(){
			$(this).removeClass('menu_hover');
			$('#menu1_h').animate({
				opacity: 0
			}, 300);
		});
		
		$('#menu2').hover(function(){
			$('#menu2_h').stop(true, false);
			$(this).addClass('menu_hover');
			$('#menu2_h').animate({
				opacity: 1
			}, 300);
		}, function(){
			$(this).removeClass('menu_hover');
			$('#menu2_h').animate({
				opacity: 0
			}, 300);
		});
		
		$('#menu3').hover(function(){
			$('#menu3_h').stop(true, false);
			$(this).addClass('menu_hover');
			$('#menu3_h').animate({
				opacity: 1
			}, 300);
		}, function(){
			$(this).removeClass('menu_hover');
			$('#menu3_h').animate({
				opacity: 0
			}, 300);
		});
		
		$('#menu4').hover(function(){
			$('#menu4_h').stop(true, false);
			$(this).addClass('menu_hover');
			$('#menu4_h').animate({
				opacity: 1
			}, 300);
		}, function(){
			$(this).removeClass('menu_hover');
			$('#menu4_h').animate({
				opacity: 0
			}, 300);
		});
		
		$('#menu5').hover(function(){
			$('#menu5_h').stop(true, false);
			$(this).addClass('menu_hover');
			$('#menu5_h').animate({
				opacity: 1
			}, 300);
		}, function(){
			$(this).removeClass('menu_hover');
			$('#menu5_h').animate({
				opacity: 0
			}, 300);
		});
		
		$('#menu6').hover(function(){
			$('#menu6_h').stop(true, false);
			$(this).addClass('menu_hover');
			$('#menu6_h').animate({
				opacity: 1
			}, 300);
		}, function(){
			$(this).removeClass('menu_hover');
			$('#menu6_h').animate({
				opacity: 0
			}, 300);
		});
		
		$('#menu7').hover(function(){
			$('#menu7_h').stop(true, false);
			$(this).addClass('menu_hover');
			$('#menu7_h').animate({
				opacity: 1
			}, 300);
		}, function(){
			$(this).removeClass('menu_hover');
			$('#menu7_h').animate({
				opacity: 0
			}, 300);
		});
		
		$('#menu8').hover(function(){
			$('#menu8_h').stop(true, false);
			$(this).addClass('menu_hover');
			$('#menu8_h').animate({
				opacity: 1
			}, 300);
		}, function(){
			$(this).removeClass('menu_hover');
			$('#menu8_h').animate({
				opacity: 0
			}, 300);
		});
		
		$('#menu9').hover(function(){
			$('#menu9_h').stop(true, false);
			$(this).addClass('menu_hover');
			$('#menu9_h').animate({
				opacity: 1
			}, 300);
		}, function(){
			$(this).removeClass('menu_hover');
			$('#menu9_h').animate({
				opacity: 0
			}, 300);
		});
		
	}
	
});
