﻿
var _cultureListCombobox = null;
var _cssStyleSelectJQ = null;
var _animationTypeSelectJQ = null;
var _animationType = "slide";

	$(
		function()
		{
			var comboboxSettings = {animationSpeed: 100};
			
			_cultureListCombobox = $('.cultureList').combobox(
				{
					  comboboxContainerClass: "comboboxContainer", 
					  comboboxValueContainerClass: "comboboxValueContainer", 
					  comboboxValueContentClass: "comboboxValueContent", 
					  comboboxDropDownClass: "comboboxDropDownContainer", 
					  comboboxDropDownButtonClass: "comboboxDropDownButton", 
					  comboboxDropDownItemClass: "comboboxItem", 
					  comboboxDropDownItemHoverClass: "comboboxItemHover", 
					  comboboxDropDownGroupItemHeaderClass: "comboboxGroupItemHeader", 
					  comboboxDropDownGroupItemContainerClass: "comboboxGroupItemContainer", 
					  width: "100",
					  animationType: "fade"
				});		
			
		});

var interval;
$(document).ready(function() {
   // startPicsRotations();
   
   interval = setTimeout('startPicsRotations()', 100);
});

startPicsRotations = function()
{
    interval = null;
 
    try
    {
        var rotationImages = document.getElementById('RotationImages');
        
        if (rotationImages)
        {
            rotationImages.style.display = 'block';
               
            var bannerHeight = $('#RotationImages img').height();
            
            if (bannerHeight == 0)
                bannerHeight = 259;
               
            //Home Banners
            $('#RotationImages').height( bannerHeight );
            
            $.fn.cycle.defaults.timeout = 4000;
            
            $('#RotationImages').cycle({
                fx:    'fade',
		        spped: 'fast'
            });
        }
    } catch(exc1) {}
    
    try
    {
        var rotationPartenaires = $('#RotationPartenaires');
        
        if (rotationPartenaires)
        {    
            //Footer Images
            $('#RotationPartenaires').height( $('#RotationPartenaires img').height() );
            
            $('#RotationPartenaires').cycle({
                fx:    'fade',
		        spped: 'fast'
            });
        }
    } catch(exc2) {}
}

function expandNews(link, newsDivId) {
    $("#" + newsDivId).toggle();
    if ($("#" + newsDivId).css("display") == "block") {
        $("#" + link.id + " img").attr("src", "/images/collapse.jpg");
    }
    else {
        $("#" + link.id + " img").attr("src", "/images/expand.jpg");
    }
}

function registerPopHover(callerId, divId) {
    var caller = $("#" + callerId);
    caller.hover(function() { popCallout(this, divId); }, function() { hide(divId); });
    caller.click(function() { hide(divId); });
}

function popCallout(callerObj, divId) {
    
    var div = $("#" + divId);
    var caller = $("#" + callerObj.id);
    //    div.css({ 'top': caller.position().top - (div.height() + caller.parent().height() + callerHeight(caller)), 'left': caller.position().left });
    div.css({ 'top': 365 - div.height(), 'left': caller.position().left });
    
    /*div.css({ 'height': div.height() + 'px' });
    div.css({ 'background-position': 'left bottom' });*/
    div.show();
}

function callerHeight(caller) {
    if (caller.height() == 0)
        return 20;
    return caller.height();
}

function hide(divId) {
    var div = $("#" + divId);
    div.hide();
}

function show(divId) {
    var div = $("#" + divId);
    div.show();
}

function hideDivs(className) {
    $("." + className).hide();
}

function radioGroupClick(radio) {
    $(".radio > input").each(function() { this.checked = false; });
    radio.checked = true;
}