	
	
	var animating = false;
	
	
	function showAjaxBox(url, title) {
		if(animating == true) return false;
		animating = true;
		
		$('#ajax').stop();
		
		$.get(url, function(data) {
			$('#ajax_title').html(title);
			$('#ajax_contents').html(data);
			
			$('#ajax').fadeIn(0, function(){
				animating = false;
				//$(document).height = "400px";
			})
		});
		
		if(! $.browser.safari) {
			$('body').css("overflow","hidden");
		}
		
		$('#drop').css("opacity","0");
		$('#drop').css("display","block");
		$('#drop').fadeTo(0, 0.75);		
		
		window.scrollTo(0,0);	
	}
	
	function hideAjaxBox(){
		if(animating == true) return false;
		animating = true; 
		
		$('#ajax').stop();
		$('#ajax').fadeOut(0, function(){
			animating = false;
			
			$('#ajax_title').html("");
			$('#ajax_contents').html("");
		});
		
		if(! $.browser.safari) {
			$('body').css("overflow","auto");
		}
		
		$('#drop').fadeOut(0);
		$('#drop').click(function(){ void(0) });
	};
	
	
	
	function showLogin(){
		if(animating == true) return false;
		animating = true;
	
		$('#jslogin').stop();
		$('#jslogin').fadeIn(0, function(){
			animating = false;
			$(document).height = "400px";
		});
		
		$('body').css("overflow","hidden");
		
		$('#drop').css("opacity","0");
		$('#drop').css("display","block");
		$('#drop').fadeTo(0, 0.75);	
		window.scrollTo(0,0);
	}
	
	function hideLogin(){
		if(animating == true) return false;
		animating = true; 
		
		$('#jslogin').stop();
		$('#jslogin').fadeOut(0, function(){ animating = false });
			
		$('body').css("overflow","auto");
		
		$('#drop').fadeOut(0);
		$('#drop').click(function(){ void(0) });
	}
	
	function showLicense(){
		if(animating == true) return false;
		animating = true;
	
		$('#license_q').stop();
		$('#license_q').fadeIn(0,function(){
			animating = false;
			$(document).height = "400px";
		});
		
		$('body').css("overflow","hidden");
		
		$('#drop').css("opacity","0");
		$('#drop').css("display","block");
		$('#drop').fadeTo(0, 0.75);	
		window.scrollTo(0,0);	
	}
	
	function hideLicense(){
		if(animating == true) return false;
		animating = true; 
		
		$('#license_q').stop();
		$('#license_q').fadeOut(0, function(){ animating = false });
		
		$('body').css("overflow","auto");
		
		$('#drop').fadeOut(0);
		$('#drop').click(function(){ void(0) });
	}
	
	function showPicpro(){
		if(animating == true) return false;
		animating = true;
	
		$('#picture-pro').stop();
		$('#picture-pro').fadeIn(0, function(){
			animating = false;
			$(document).height = "400px";
		});
		
		$('body').css("overflow","hidden");
		
		$('#drop').css("opacity","0");
		$('#drop').css("display","block");
		$('#drop').fadeTo(0, 0.75);	
		window.scrollTo(0,0);		
	}
	
	function hidePicpro(){
		if(animating == true) return false;
		animating = true; 
		
		$('#picture-pro').stop();
		$('#picture-pro').fadeOut(0, function(){ animating = false });
		
		$('body').css("overflow","auto");
		
		$('#drop').fadeOut(0);
		$('#drop').click(function(){ void(0) });
	}
	
	function showStart(){
		if(animating == true) return false;
		animating = true;
	
		$('#start').stop();
		$('#start').fadeIn(0, function(){
			animating = false;
			$(document).height = "400px";
		});
		
		$('body').css("overflow","hidden");
		
		$('#drop').css("opacity","0");
		$('#drop').css("display","block");
		$('#drop').fadeTo(0, 0.75);		
		window.scrollTo(0,0);	
	}
	
	function hideStart(){
		if(animating == true) return false;
		animating = true; 
		
		$('#start').stop();
		$('#start').fadeOut(0, function(){ animating = false });
		
		$('body').css("overflow","auto");
		
		$('#drop').fadeOut(0);
		$('#drop').click(function(){ void(0) });
	}
	
	
	function positionDrop(){
		if($.browser.msie && ($.browser.version < 7)){ // Nobody likes you, Internet Explorer
			if(document.documentElement){
				scrTop = document.documentElement.scrollTop + "px";
			} else {
				scrTop = document.body.scrollTop + "px";
			}
			
			$('#drop').css("top", scrTop);
			//$('#drop').css("height", $(document).height());
		}   
	}
	
	function setElementOpacity(oElem, nOpacity)
	{
		var p = getOpacityProperty();
		(setElementOpacity = p=="filter"?new Function('oElem', 'nOpacity', 'nOpacity *= 100;	var oAlpha = oElem.filters["DXImageTransform.Microsoft.alpha"] || oElem.filters.alpha;	if (oAlpha) oAlpha.opacity = nOpacity; else oElem.style.filter += "progid:DXImageTransform.Microsoft.Alpha(opacity="+nOpacity+")";'):p?new Function('oElem', 'nOpacity', 'oElem.style.'+p+' = nOpacity;'):new Function)(oElem, nOpacity);
	}
	
	function getOpacityProperty()
	{
		var p;
		if (typeof document.body.style.opacity == 'string') p = 'opacity';
		else if (typeof document.body.style.MozOpacity == 'string') p =  'MozOpacity';
		else if (typeof document.body.style.KhtmlOpacity == 'string') p =  'KhtmlOpacity';
		else if (document.body.filters && navigator.appVersion.match(/MSIE ([\d.]+);/)[1]>=5.5) p =  'filter';
		
		return (getOpacityProperty = new Function("return '"+p+"';"))();
	}
	
	function fadeOpacity(sElemId, sRuleName, bBackward)
	{
		var elem = document.getElementById(sElemId);
		if (!elem || !getOpacityProperty() || !fadeOpacity.aRules[sRuleName]) return;
		
		var rule = fadeOpacity.aRules[sRuleName];
		var nOpacity = rule.nStartOpacity;
		
		if (fadeOpacity.aProc[sElemId]) {clearInterval(fadeOpacity.aProc[sElemId].tId); nOpacity = fadeOpacity.aProc[sElemId].nOpacity;}
		if ((nOpacity==rule.nStartOpacity && bBackward) || (nOpacity==rule.nFinishOpacity && !bBackward)) return;
	
		fadeOpacity.aProc[sElemId] = {'nOpacity':nOpacity, 'tId':setInterval('fadeOpacity.run("'+sElemId+'")', fadeOpacity.aRules[sRuleName].nDalay), 'sRuleName':sRuleName, 'bBackward':Boolean(bBackward)};
	}
	
	fadeOpacity.addRule = function(sRuleName, nStartOpacity, nFinishOpacity, nDalay){fadeOpacity.aRules[sRuleName]={'nStartOpacity':nStartOpacity, 'nFinishOpacity':nFinishOpacity, 'nDalay':(nDalay || 30),'nDSign':(nFinishOpacity-nStartOpacity > 0?1:-1)};};
	
	fadeOpacity.back = function(sElemId){fadeOpacity(sElemId,fadeOpacity.aProc[sElemId].sRuleName,true);};
	
	fadeOpacity.run = function(sElemId)
	{
		var proc = fadeOpacity.aProc[sElemId];
		var rule = fadeOpacity.aRules[proc.sRuleName];
		
		proc.nOpacity = Math.round(( proc.nOpacity + .1*rule.nDSign*(proc.bBackward?-1:1) )*10)/10;
		setElementOpacity(document.getElementById(sElemId), proc.nOpacity);
		
		if (proc.nOpacity==rule.nStartOpacity || proc.nOpacity==rule.nFinishOpacity) clearInterval(fadeOpacity.aProc[sElemId].tId);
	}
	fadeOpacity.aProc = {};
	fadeOpacity.aRules = {};
	fadeOpacity.addRule('actionMess', 1, 0, 30);
