﻿function initMenu() {
  $('#serv ul').hide();
  $('#serv li a').click(
    function() {
      var checkElement = $(this).next();
      if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
        return false;
        }
      if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
        $('#serv ul:visible').slideUp('slow');
        checkElement.slideDown('slow');
        return false;
        }
      }
    );
  }
$(document).ready(function() {initMenu();});

// preload images ---------------------------------------------------------------------------------------------
jQuery.preloadImages = function() {
  for(var i = 0; i<arguments.length; i++)   {
    jQuery("<img>").attr("src", arguments[i]);
  }
}
// ------------------------------------------------------------------------------------------------------------

// ------------------------------------------------------------------------------------------------------------

function insertFlash(src,width,height,wmode,menu,flashVars) {
	
	var pwmode = (wmode==null)? "" : wmode;
	var pmenu = (menu==null)? true : false;
	var pflashVars = (flashVars==null)? "" : flashVars;
	
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+width+'" height="'+height+'">');
	document.write('<param name="movie" value="'+src+'">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="flashVars" value="'+pflashVars+'">');
	document.write('<param name="wmode" value="'+pwmode+'">');
	document.write('<param name="menu" value="'+pmenu+'">');
	document.write('<embed src="'+src+'" width="'+width+'" height="'+height+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" flashvars="'+pflashVars+'" wmode="'+pwmode+'" menu="'+pmenu+'"></embed>');
	document.write('</object>');
	
}

// ------------------------------------------------------------------------------------------------------------

$(document).ready(function() {
 $("a.group, a.group2").fancybox({
 'zoomOpacity' : true,
 'overlayShow' : true,
 'zoomSpeedIn' : 1000,
 'zoomSpeedOut' : 1000
 });
 $("a.box").fancybox({
 'zoomOpacity' : true,
 'overlayShow' : true,
 'zoomSpeedIn' : 800,
 'zoomSpeedOut' : 800,
 'frameWidth' : 700,
 'zoomSpeedIn' : 0,
 'zoomSpeedOut' : 0,
 'hideOnContentClick' : false
 });
});

// ------------------------------------------------------------------------------------------------------------
			$(document).ready(function(){
				$('.boxgrid.captionfull').hover(function(){
					$(".cover", this).stop().animate({top:'46px'},{queue:false,duration:160});
				}, function() {
					$(".cover", this).stop().animate({top:'66px'},{queue:false,duration:160});
				});
				$('.boxgrid.caption').hover(function(){
					$(".cover", this).stop().animate({top:'35px'},{queue:false,duration:160});
				}, function() {
					$(".cover", this).stop().animate({top:'50px'},{queue:false,duration:160});
				});
			});
// ------------------------------------------------------------------------------------------------------------
$(function () {
    var tabContainers = $('div.tabs > div');
    
    $('div.tabs ul.tabNavigation a').click(function () {
        tabContainers.hide().filter(this.hash).show();
        
        $('div.tabs ul.tabNavigation a').removeClass('selected');
        $(this).addClass('selected');
        
        return false;
    }).filter(':first').click();
});
