var i1 = new Image();
//var i2 = new Image();
i1.src = "";
//i2.src = "";
function stdmenu(){
	$(".standard-menu ul ").css({display: "none"}); // Opera Fix
	$(".standard-menu li").mouseover(
		function(){
			$(this).find('ul:first').css({display: "block"});
		});
	$(".standard-menu li").mouseout(
		function(){
			$(this).find('ul:first').css({display: "none"});
		}
	);
	$(".standard-menu > li").mouseover(
		function(){
			$(this).find('a:first').addClass('active');
			
		});
	$(".standard-menu > li").mouseout(
		function(){
			$(this).find('a:first').removeClass('active');
		}
	);
}

function updateMenuAlignment()
{
	$('ul.regionExpanderGroup span.tourName').each(function(e) {
		if($(this).height() > 17)
		{
			$(this).parent().children('span.tourDuration').each(function() {
				this.style.left = '160px';
			} );
		}
	});
}

function experienceExpand(groupid)
{
	$('.regionExpanderGroup').each(
		function() {
			if ($(this).attr('id') != 'expExpGroup_'+groupid)
			{
				$(this).addClass('header-exp');
				$(this).removeClass('header-exp-active');
				$(this).hide('fast');
			}
			else
			{
				$(this).show('slow');
				$(this).addClass('header-exp-active');
			}
		}
	);
}

function regionExpand(groupid)
{
	var first = true;
	$('.regionExpanderGroup').each(function(){
		var id = $(this).attr('id');
		if (id != 'regionExpanderGroup_'+groupid)
		{
			$(this).slideUp('fast');
			if (first == true)
			{
				$('#'+id+'_header').addClass('header-first');
				$('#'+id+'_header').removeClass('header-first-active');
			}
			else
			{
				$('#'+id+'_header').addClass('header');
				$('#'+id+'_header').removeClass('header-active');
			}
		}
		else
		{
			$(this).slideDown('slow');
			if (first == true)
			{
				$('#'+id+'_header').addClass('header-first-active');
			}
			else
			{
				$('#'+id+'_header').addClass('header-active');
			}
		}
		first = false;
	})
	updateMenuAlignment();
}

function runTicker(position, action)
{
	var count = $('.otg_ticker a').length;
	if (position >= count) { position = 0;}
	if (action == 'show')
	{
		$('.otg_ticker a:eq('+position+')').slideDown('slow', function() {
			window.setTimeout(function(){runTicker(position, 'hide')}, 9000);
		});
	}
	if (action == 'hide')
	{
		$('.otg_ticker a:eq('+position+')').slideUp('slow', function () {
			window.setTimeout(function(){runTicker(position+1, 'show')}, 9000);
		});	
	}
}




		
$(document).ready(function(){
	
	$(".grid-100 .item").mouseover(
		function() {
			$(this).children('.slider').slideDown();
		}
	);
	$(".grid-100 .item").mouseout(
		function() {
			$(this).children('.slider').slideUp();
		}
	);

	if(!($.browser.msie && $.browser.version=="6.0"))
	{
		stdmenu();
	}
	updateMenuAlignment();
	//$('.container1-1').pngFix();
	//$('.left-2').pngFix();
	//$('#container1-3').pngFix();
	//$('#container2-3').pngFix();
	//$('.container3-4').pngFix();
	//$('#left-4').pngFix();
	//$('#content-3').pngFix();
	//$('#content-2').pngFix();
	//$('#right-3').pngFix();
	runTicker(0, 'show');

	$(".popup").mouseleave(function(event){
		
				$(this).hide();
		
	});

	$('.headlink').hover(
			function() { $('ul', this).css('display', 'block'); },
			function() { $('ul', this).css('display', 'none'); });
	$('.headlink1232').mouseover(function(){
		$('#'+$(this).attr('layer')).show();
	});
	$(".block-right table.dashboard tr").hover(
	   function()
	   {
			$(this).addClass("highlight");
	   },
	   function()
	   {
			$(this).removeClass("highlight");
		}
	);

	$(".tabs4-controller").mouseover(
		function() {
			if (!($(this).hasClass('selected')))
			{
				$(".tabs4-controller").removeClass('selected');
				$(this).addClass('selected');
				$(".banner-image").hide();
				$("#tabs4-banner-"+$(this).attr('bannerID')).fadeIn('slow');
			}
		}
	);

	$(".pricesTable tr.data").hover(
   function()
   {
    $(this).addClass("highlight");
   },
   function()
   {
    $(this).removeClass("highlight");
   }
  );
 
if(!($.browser.msie && $.browser.version=="6.0"))
	{
	$("img.left-landscape-with-border").wrap("<div class='left-landscape-with-border'></div>").before("<div class='overlay'></div>");
	$("img.right-landscape-with-border").wrap("<div class='right-landscape-with-border'></div>").before("<div class='overlay'></div>");
	$("img.left-portrait-with-border").wrap("<div class='left-portrait-with-border'></div>").before("<div class='overlay'></div>");
	$("img.right-portrait-with-border").wrap("<div class='right-portrait-with-border'></div>").before("<div class='overlay'></div>");
	$("img.left-square-with-border").wrap("<div class='left-square-with-border'></div>").before("<div class='overlay'></div>");
	$("img.right-square-with-border").wrap("<div class='right-square-with-border'></div>").before("<div class='overlay'></div>");
	$("img.full-landscape-with-border").wrap("<div class='full-landscape-with-border'></div>").before("<div class='overlay'></div>");
	}
	var i=new Image();i.src='style/otg2009/top-menu-sub-item-over.png';
	var i=new Image();i.src='style/otg2009/top-menu-sub-item.png';

		

});

