$(function() {
	$('div#jcycle-packages-push').each(function() { $(this).cycle({ 
		fx:     'scrollHorz', 
		speed:  1000, 
		timeout: 0, 
		next:   '#next-push', 
		prev:   '#previous-push',
		cleartypeNoBg:true
		});
	});		
	
	$('#mycarousel').each(function() { 
		$(this).jcarousel({scroll:5});
		//var id = $("div.jcarousel-copy").attr('id');	
		$("div.jcarousel-copy").hide();
		$('a.jtoggle').click(function(){
			var href = $(this).attr("href");
			$(".jcarousel-copy").hide();
			$(href).show();
			return false;
			});
	 });
	if (LANG != 'ru') {
		$("div#title-wrapper h1").sifr( { strSWF: '/fonts/sabon.swf', strColor: '#9E7D3D', intPadding: [0, 0, 0, 0], strCase: 'upper', strWmode:'transparent'} );
		$("div#right-content h1").sifr( { strSWF: '/fonts/sabon.swf', strColor: '#9E7D3D', intPadding: [0, 0, 0, 0], strCase: 'upper', strWmode:'transparent'} );
		$("div#title-wrapper h2").sifr( { strSWF: '/fonts/sabon.swf', strColor: '#939598', intPadding: [0, 4, 0, 0], strCase: 'upper', strWmode:'transparent'} );
		$("div#content h3").sifr( { strSWF: '/fonts/sabon.swf', strColor: '#797A7D', intPadding: [0, 0, 0, 0], strCase: 'upper', strWmode:'transparent'} );
		$("div.push-content h3").sifr( 
			{ strSWF: '/fonts/sabon.swf', strColor: '#9E7D3D', intPadding: [0, 0, 0, 0], strCase: 'upper', strWmode:'transparent'}, 
			{ expressInstall: true }
		);
		$("div#content ul.vcalendar h4").sifr( { strSWF: '/fonts/sabon.swf', strColor: '#9E7D3D', intPadding: [0, 0, 0, 0], strCase: 'upper', strWmode:'transparent'} );
	}
//home page flash
	$("div#home-flash").flash(
		{src:"/flash/homepage.swf",
		 width:600,
		 height:475,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"7"});
//home page push marketing flash
	$("div#push-marketing").each( function() {
		var lang = $(this).attr("class");
		$(this).flash(
			{src:"/"+lang+"/flash/push-marketing.swf",
			 width:243,
			 height:136,
			 wmode:"transparent",
			 quality:"high"},
			 {version:"7"});			
	});

//German home page push marketing flash
	$("div#push-marketing-de").each( function() {
		var lang = $(this).attr("class");
		$(this).flash(
			{src:"/"+lang+"/flash/push-marketing.swf",
			 width:243,
			 height:136,
			 wmode:"transparent",
			 quality:"high"},
			 {version:"7"},
			function(htmlOptions) { //Use this to specify a query string, take out if not needed.
				htmlOptions.flashvars.analyticsId = "UA-1266134-34";
				$(this).html($.fn.flash.transform(htmlOptions));
			});
		});

$("div#german-push-sommer").each( function() {
		var lang = $(this).attr("class");
		$(this).flash(
			{src:"/"+lang+"/flash/btn-sommer.swf",
			 width:200,
			 height:110,
			 wmode:"transparent",
			 quality:"high"},
			{version:"7"},
			function(htmlOptions) { //Use this to specify a query string, take out if not needed.
				htmlOptions.flashvars.analyticsId = "UA-1266134-34";
				$(this).html($.fn.flash.transform(htmlOptions));
			});
		});

$("div#german-push-personal").each( function() {
		var lang = $(this).attr("class");
		$(this).flash(
			{src:"/"+lang+"/flash/midweekbutton.swf",
			 width:200,
			 height:110,
			 wmode:"transparent",
			 quality:"high"},
			{version:"7"},
			function(htmlOptions) { //Use this to specify a query string, take out if not needed.
				htmlOptions.flashvars.analyticsId = "UA-1266134-34";
				$(this).html($.fn.flash.transform(htmlOptions));
			});
		});



//spa-flash masthead 
	$("body.spa-flash div#masthead").flash(
		{src:"/flash/spaMasthead.swf",
		 width:695,
		 height:504,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"7"},
			function(htmlOptions) { //Use this to specify a query string, take out if not needed.
				htmlOptions.flashvars.xmlfile = "/xml/images.xml";
				$(this).html($.fn.flash.transform(htmlOptions));						
		});

// Flash Signup form
$("div#flash-signup").each( function() {
    var lang = $(this).attr("class");
    $(this).flash(
        {src:"/flash/email-form-"+lang+".swf",
         width:248,
         height:463,
         wmode:"transparent",
         quality:"high"},
         {version:"8"}
    );
});
        
        
//Photo gallery
		$("div#postcard-gallery").flash(
		{src:"/flash/photo_gallery.swf",
		 width:466,
		 height:416,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"},
			function(htmlOptions) { //Use this to specify a query string, take out if not needed.
				htmlOptions.flashvars.configFile = "/flash/xml/gallery_config_"+LANG+".xml";
				htmlOptions.flashvars.xmlFile = "/flash/xml/images-photogallery.xml";
				$(this).before($.fn.flash.transform(htmlOptions));						
		});

/*---------------Calendar of Events ------------------*/
$(".vcalendar").eventPreview();

//msn map
$('#map').each(function() { $(this).msnMap(
	{
		listView : true
	}									   
); });


//hover
// Adds hover class for IE and animation for drop down nav - remove if not needed
	
	$("ul#nav-primary li").hover(
       function(){ $("ul", this).show(); }, 
        function() { 
			$("ul", this).hide();  
		} 
    );
    if (document.all) {
        $("ul#nav-primary li").hoverClass("sfhover");
    }


});


// Function to add/remove "over" class for drop down nav - remove if not needed
$.fn.hoverClass = function(c) {
	return this.each(function(){
		$(this).hover( 
			function() { $(this).addClass(c);  },
			function() { $(this).removeClass(c); }
		);
	});

};   

function pushPop(urlRequest, wname) {
	window.open(urlRequest,wname,'height=440,width=620,toolbar=no,scrollbars=no');	
}

// For flash pop-up
var newwindow;
function openNewWindow (url, name, attributes) {
	newwindow=window.open(url,name,attributes);
	if (window.focus) {newwindow.focus()}
}

