/*var flashvars = {};
flashvars.height = "500";
flashvars.width = "1005";
flashvars.showstop = "true";
flashvars.allowSciptAccess = "always";

var params = {};
params.menu = "false";
params.allowfullscreen = "true";
params.allowscriptaccess = "always";
params.allownetworking = "internal";
params.wmode = "transparent";
var attributes = {};*/


$(document).ready(function() {

	/*ticker*/
	$('#news').innerfade({		animationtype: 'slide',		speed: 750,		timeout: 4000   	});
	
	/*carousel*/
	jQuery('#carousel_01').jcarousel({		scroll:1,	 visible:1,        wrap: 'last',        initCallback: mycarousel_initCallback    });
	//jQuery('#carousel_03').jcarousel({		scroll:1,		visible:1,        wrap: 'last',        initCallback: mycarousel_initCallback    });
	//jQuery('#mycarousel').jcarousel();
	
	/*carousel*/
	jQuery('#carousel_02').jcarousel({		scroll:1,	auto:5, visible:1,        wrap: 'last',        initCallback: mycarousel_initCallback    });
	//jQuery('#carousel_03').jcarousel({		scroll:1,		visible:1,        wrap: 'last',        initCallback: mycarousel_initCallback    });
	//jQuery('#mycarousel').jcarousel();


/*carousel*/
	jQuery('#carousel_03').jcarousel({		scroll:1,	auto:3, visible:1,        wrap: 'last',        initCallback: mycarousel_initCallback    });
	//jQuery('#carousel_03').jcarousel({		scroll:1,		visible:1,        wrap: 'last',        initCallback: mycarousel_initCallback    });
	//jQuery('#mycarousel').jcarousel();
	//jQuery('#accordion').accordion();
	
	/*tabs*/
	$.tabs("quinie_main");

	/*accordion*/
	/*if($('#accordion').length>0 ){
		jQuery('#accordion').accordion({			header: 'a.head',			alwaysOpen: false,			autoheight: false });
		}

	jQuery('#mycarousel').jcarousel({
        visible: 1,
		scroll:1,
		wrap: 'both',
		initCallback: mycarousel_initCallback

    });*/
	
	$('#carousel_01 li a').click(function(){
			$('.tabs_quinie div').hide();
			var x = $(this).attr('href');
			$(".tabs_quinie #"+x).show();
			return false;
		});

	$('.tabs_quinie div').hide();
	/*shadowbox*/
		/*Shadowbox.init();
		
	$("input[type='checkbox']").custCheckBox();*/

		
});

function mycarousel_initCallback(carousel)
{
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });
    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

/*$(function()
			{

				// initialise the "Select date" link
				$('#date-pick')
					.datePicker(
						// associate the link with a date picker
						{
							createButton:false,
							startDate:'01/01/2009',
							endDate:'31/12/2020'
						}
					).bind(
						// when the link is clicked display the date picker
						'click',
						function()
						{
							updateSelects($(this).dpGetSelected()[0]);
							$(this).dpDisplay();
							return false;
						}
					).bind(
						// when a date is selected update the SELECTs
						'dateSelected',
						function(e, selectedDate, $td, state)
						{
							updateSelects(selectedDate);
						}
					).bind(
						'dpClosed',
						function(e, selected)
						{
							updateSelects(selected[0]);
						}
					);

				var updateSelects = function (selectedDate)
				{
					selectedDate = new Date(selectedDate);
					var d = selectedDate.getDate();
					var m = selectedDate.getMonth();
					var y = selectedDate.getFullYear();
					($('#d')[0]).selectedIndex = d - 1;
					($('#m')[0]).selectedIndex = m;
					($('#y')[0]).selectedIndex = y - 2009;
				}
				// listen for when the selects are changed and update the picker
				$('#d, #m, #y')
					.bind(
						'change',
						function()
						{
							var d = new Date(
										$('#y').val(),
										$('#m').val()-1,
										$('#d').val()
									);
							$('#date-pick').dpSetSelected(d.asString());
						}
					);

				// default the position of the selects to today
				var today = new Date();
				($('#d')[0]).selectedIndex = today.getDate() - 1;
				($('#m')[0]).selectedIndex = today.getMonth();
				($('#y')[0]).selectedIndex = today.getFullYear() - 2009;

				// and update the datePicker to reflect it...
				$('#d').trigger('change');




				$('#date-pick2')
					.datePicker(
						// associate the link with a date picker
						{
							createButton:false,
							startDate:'01/01/2009',
							endDate:'31/12/2020'
						}
					).bind(
						// when the link is clicked display the date picker
						'click',
						function()
						{
							updateSelects2($(this).dpGetSelected()[0]);
							$(this).dpDisplay();
							return false;
						}
					).bind(
						// when a date is selected update the SELECTs
						'dateSelected',
						function(e, selectedDate, $td, state)
						{
							updateSelects2(selectedDate);
						}
					).bind(
						'dpClosed',
						function(e, selected)
						{
							updateSelects2(selected[0]);
						}
					);

				var updateSelects2 = function (selectedDate)
				{
					selectedDate = new Date(selectedDate);
					var d = selectedDate.getDate();
					var m = selectedDate.getMonth();
					var y = selectedDate.getFullYear();
					($('#d2')[0]).selectedIndex = d - 1;
					($('#m2')[0]).selectedIndex = m;
					($('#y2')[0]).selectedIndex = y - 2009;
				}
				// listen for when the selects are changed and update the picker
				$('#d2, #m2, #y2')
					.bind(
						'change',
						function()
						{
							var d = new Date(
										$('#y2').val(),
										$('#m2').val()-1,
										$('#d2').val()
									);
							$('#date-pick2').dpSetSelected(d.asString());
						}
					);

				// default the position of the selects to today
				var today2 = new Date();
				($('#d2')[0]).selectedIndex = today2.getDate() - 1;
				($('#m2')[0]).selectedIndex = today2.getMonth();
				($('#y2')[0]).selectedIndex = today2.getFullYear() - 2009;

				// and update the datePicker to reflect it...
				$('#d2').trigger('change');


			});

function mycarousel_initCallback(carousel)
{
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto();
    });
    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto();
    });
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};
*/

//Shadowbox.loadSkin('classic', '../js/src/skin');
//Shadowbox.loadLanguage('es', '../js/src/lang');
//Shadowbox.loadPlayer([], '../js/src/player');
/*Shadowbox.loadSkin('classic', 'js/src/skin');
Shadowbox.loadLanguage('es', 'js/src/lang');
Shadowbox.loadPlayer([], 'js/src/player');*/

