// MENY
jQuery(document).ready(function(){
	
	
	if (jQuery('div.driftsMelding span strong').text().length > 10) { jQuery('div.driftsMelding').show(); }
	
	jQuery("div.meny ul li.level1").hover(function(){
		jQuery(this).addClass("aktiv"); 
		}, function () {
		jQuery(this).removeClass("aktiv");
	});

	jQuery('div.meny ul li.level1').hover(
		function() { 
			jQuery('ul', this).delay(0).show(1); 
		},
		function() { 
			jQuery('ul', this).clearQueue().hide(); 
		}
	);


/*	$(function() {
		var zIndexNumber = 1000;
		$('div').each(function() {
			$(this).css('zIndex', zIndexNumber);
			zIndexNumber -= 10;
		});
	});*/


	// TOGGLE
	$(".toggle").click(function() {
		$(".hidden, .kasse").toggle();
	});	
});

jQuery(document).ready(function(){
		$('.slideshow')
		.cycle({
		    fx:     'fade',
		    speed:   1000,
		    timeout: 6000,
		    pager:  '#nav' ,
		    pause:  '1'
		});

		$('.tickerScroll')
		.cycle({
		    fx:     'scrollLeft',
		    speed:   1000,
		    timeout: 6000,
		    pause:  '1'
		});


		// SEARCH FIELD VALUE SWAP
		$(function() {
		    swapValues = [];
		    $(".inputSok").each(function(i){
		        swapValues[i] = $(this).val();
		        $(this).focus(function(){
		            if ($(this).val() == swapValues[i]) {
		                $(this).val("");
		            }
		        }).blur(function(){
		            if ($.trim($(this).val()) == "") {
		                $(this).val(swapValues[i]);
		            }
		        });
		    });
		});


});



function openTimpex(pakke_nr)   {
    timp=window.open("http://www.transportsiden.no/sporing/FrbrsokBilde.aspx?transp=cpo&frbrnr="+pakke_nr,"timpex","toolbar=no,location=no,dependent=yes,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,height=555,width=700");
    return false;
}






