$(document).ready(function(){
	loadIntroVid('Color');
	loadIntroVid('Profesional');
	loadIntroVid('Producto');
	$('#introVidColor').show();	
	$('.add-nav').css('background-image', 'url(/Content/Prestigio/Html/General/images/bg-add-nav-color.png)'); 
	
	$('div.short-news').gallery({
		duration: 500,
		autoRotation: 3000,
		listOfSlides: 'li',
		direction: true,
		slideElement: 1
	});
	
});

function loadIntroVid(vidName)
{
		$('#introVid'+ vidName).flash({				 
		src: '/Content/Prestigio/Html/General/introvid/prestigio_' + vidName + '.swf',
		width: 630,
		height: 400,
		allowFullScreen: true,
		wmode: 'transparent',
		base: '/Content/Prestigio/Html/General/introvid/'
	});
}

function setIntroVid(vidName)
{
	$('#introVidColor').hide();
	$('#introVidProfesional').hide();
	$('#introVidProducto').hide();
	$('#introVid'+ vidName).show();
//$('#introVidColor').hide('explode', function(){	$('#introVidProfesional').hide('explode', function() {$('#introVidProducto').hide('explode', function() {$('#introVid'+ vidName).show('explode');});});});
	$('.add-nav').css('background-image', 'url(/Content/Prestigio/Html/General/images/bg-add-nav-' + vidName + '.png)'); 

}


function setBgImage(section)
{
	$('.add-nav').css('background-image', 'url(/Content/Prestigio/Html/General/images/bg-add-nav-' + section + '.png)'); 
}

$(document).ready(function(){

	if (document.referrer == 'xxx')

	{
	$('.meerkat').meerkat({
		height: '599px',
		width: '100%',
		position: 'top',
		close: '.close-meerkat',
		dontShowAgain: '.dont-show',
		animationIn: 'none',
		animationSpeed: 1000,
		cookieExpires: 1,
		delay: 2
	});

		$('#promoVid').flash({				 
		src: '/Content/Prestigio/Html/General/introvid/Banner_flash_Test.swf',
		width: 919,
		height: 599,
		allowFullScreen: true,
		wmode: 'transparent',
		base: '/Content/Prestigio/Html/General/introvid/'
	});
	}
	else
	{
		$('.close-meerkat').hide();
	}
	$('body').css('display','block');
});

	function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else { 
		var expires = "";
	}
	document.cookie = name+"="+value+expires+"; path=/";
	}

	function eraseCookie(name) {
		createCookie(name,"",-1);
	}	
