function fn_Check(){
	var sQuery = location.search;
	//alert(sQuery);
	if(sQuery != "") {
		switch(sQuery){
			case "?tourdepartures":
				setTimeout("window.location = 'http://www.remarkableadventuresnz.co.nz/pricing_departures.asp'",5000);
				break;
				
			case "?tourprices":
				setTimeout("window.location = 'http://www.remarkableadventuresnz.co.nz/pricing_departures.asp'",5000);
				break;
				
			case "?downloadabletripnotes":
				setTimeout("window.location = 'http://www.remarkableadventuresnz.co.nz/downloads.asp'",5000);
				break;
				
			case "?nzadventureodyssey":
				setTimeout("window.location = 'http://www.remarkableadventuresnz.co.nz/nz_adventure_odyssey.asp'",5000);
				break;
				
			case "?midlifeadventures":
				setTimeout("window.location = 'http://www.remarkableadventuresnz.co.nz/midlife_adventures.asp'",5000);
				break;
				
			case "?southernodyssey":
				setTimeout("window.location = 'http://www.remarkableadventuresnz.co.nz/southern_odyssey.asp'",5000);
				break;
		}
	}
}
function showChildren(targ, classToAdd){
	var c = classToAdd;
	if(!c){c='on';}
	var me = $(targ);
	var par = me.parent();
	me.addClass(c);
	var childUL=$('ul',targ).filter(function(idx){return idx == 0;});	
	if(childUL.length >0){	
	    var maxX = 	par.offset().left + par.innerWidth();		
		var newX =0;		
		if(me.offset().left + childUL.outerWidth(true) > maxX){
			newX = me.innerWidth() - (childUL.outerWidth(true) -1) ;		
		}		
	    childUL.css('left',newX.toString()+'px');
	    if($.browser.msie&&$.browser.version<8){childUL.css('top',me.outerHeight()+'px');}
	}	
}
function hideChildren(targ, classToAdd){
	var c = classToAdd
	if(!c){c='on';}
	$(targ).removeClass(c);
}

$(document).ready(function(){
    $('.top_level > li').hover(function(){showChildren(this,'over');},function(){hideChildren(this,'over');});

});

