$(function(){

$("img.alp").hover(function(){ 
		$(this).fadeTo(100,0.5); 
	},function() {
		$(this).fadeTo(100,1); 
	});


//smooth scroll
$('a[href*=#]').click(function() {
	var duration=700;
	var easing='easeOutExpo';
	var newHash=this.hash;
	var target=$(this.hash).offset().top;
	var oldLocation=window.location.href.replace(window.location.hash, '');
	var newLocation=this;
	if(oldLocation+newHash==newLocation){
		$('html:not(:animated),body:not(:animated)').animate({ scrollTop: target }, duration, easing, function() {
			window.location.href=newLocation;
		});
		return false;
	}
});

//rollover
var postfix = '_ov';
$('img.rollover').not('[src*="'+ postfix +'."]').each(function() {
		var img = $(this);
		var src = img.attr('src');
		var src_on = src.substr(0, src.lastIndexOf('.'))
		           + postfix
		           + src.substring(src.lastIndexOf('.'));
		$('<img>').attr('src', src_on);
		img.hover(function() {
			img.attr('src', src_on);
		}, function() {
			img.attr('src', src);
		});
	});
	

	//$("#header-inner").hide();
	//$("div.imgNav").hide();
	$("#info").hide();
//	$("#info").css('visibility','hidden');
	
	$("#globalNav ul li ul li ul").hide();
	$("#globalNav ul li ul").hide();
	$("#globalNav").hide();
	
	$(".fadein").hide();

});  //End of doccument ready ////////////




// POPUP

var MacIe = navigator.userAgent.indexOf( "Mac" ) > -1 &&  navigator.userAgent.indexOf( "MSIE" ) > -1;
var JsWin;

function popwin( JsUrl, JsWinName, JSWidth, JSHeight ){
	JSWidth = parseInt( JSWidth );
	JSHeight = parseInt( JSHeight );
	if( !MacIe ){ JSWidth = JSWidth + 16; }
	if( MacIe ){ JSWidth = JSWidth - 1 ; }
	JsProperty = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=" + JSWidth + ",height=" + JSHeight;
	JsWin = window.open( JsUrl, JsWinName, JsProperty );
	if( MacIe ){ return; }
	JsWin.focus();
}

function popwin2( JsUrl, JsWinName, JSWidth, JSHeight ){
	JSWidth = parseInt( JSWidth );
	JSHeight = parseInt( JSHeight );
	JsProperty = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=" + JSWidth + ",height=" + JSHeight;
	JsWin = window.open( JsUrl, JsWinName, JsProperty );
	if( MacIe ){ return; }
	JsWin.focus();
}

