$(function() {
	if ($.browser.msie){
	    if (parseInt($.browser.version) < 7)
	        $('body').prepend('<div id="ieUsersMessage">You are using an old web browser that <strong>is not supported by this website</strong>. <br />Download the newer version from the manufacturer - such as <a href="http://www.microsoft.com/poland/windows/internet-explorer/" onclick="target=\'_blank\'">Internet Explorer 8</a> or <a href="http://www.mozilla-europe.org/pl/firefox/" onclick="target=\'_blank\'">Firefox 3</a>.</div>');
	}
	
	$(".insideDepartment ul").innerfade({
		speed: 2000,
		timeout: 5000,
		type: "sequence"
	});
	
	$("#galleryBox ul").innerfade({
		speed: 2000,
		timeout: 5000,
		type: "sequence"
	});
	
	$("#slideTextBox").innerfade({
		speed: 2000,
		timeout: 9000,
		containerheight: 150,
		type: "sequence"
	});
	
	$('ul.testimonialsList li:nth-child(4n)').addClass('last');
	
	if ($('#form').length)
		$('#form').validate({
			errorPlacement:function(error,element){}
		});
	
	
	if ($("#iDlay div").length)
    {
        $("#iDlay div").flash({
    		src: 'swf/gallery-small.swf',
    		id: 'galSmall',
    		wmode: 'transparent',
    		width: 202,
    		height: 131 },
            { version: 8 }
        ); 
    }
    
    if ($("#iGal div").length)
    {
        $("#iGal div").flash({
    		src: 'gallery.swf',
    		id: 'galBig',
    		wmode: 'transparent',
    		width: 680,
    		height: 562 },
            { version: 8 }
        ); 
    }
    
    if ($("#testimonials div").length)
    {
        $("#testimonials div").flash({
    		src: 'swf/scroll.logotypes.swf',
    		id: 'galSmall',
    		wmode: 'transparent',
    		width: 702,
    		height: 62 },
            { version: 8 }
        ); 
    }
	
	var hash = location.hash;
	if (hash != ''){
		
		img_id = hash.replace('#','');
		img = $('.testimonialsList li a#'+img_id).attr('href');
	
		window.onload = function() {
		    Shadowbox.open({
		        content:    img,
		        player:     "img"
		    });
		};
	} 
});

    Shadowbox.init({
		language:   "en",
		players:    ['img', 'html', 'iframe', 'wmp', 'flv']
	});
