
	function OpenMenu()
	{
		EffectMove( 'week_special', $('week_special').offsetLeft, 25 ); 
		if( this.parentNode.parentNode.childNodes[1].style.display == "" ){
			this.parentNode.parentNode.childNodes[1].style.display = "block";
		}
		if( this.parentNode.parentNode.childNodes[1].style.visibility == "" ){
			this.parentNode.parentNode.childNodes[1].style.visibility = "hidden";
		}		
		if ( this.parentNode.parentNode.childNodes[1].style.visibility == "hidden" ) 
		{	
			if( IsInitialized == true )
			{							
				if ( LastActiveMenuHeader.id != this.parentNode.parentNode.childNodes[1].id )
				{				
					Effect.BlindUp( LastActiveMenuHeader.id , { duration: 0.4 });
					setTimeout("hideMenuItem('"+LastActiveMenuHeader.id+"')",425);				
				}
			}
			LastActiveMenuHeader = this.parentNode.parentNode.childNodes[1]; 											
			Effect.BlindDown( this.parentNode.parentNode.childNodes[1].id , { duration: 0.4 });
			setTimeout("showMenuItem('"+this.parentNode.parentNode.childNodes[1].id+"')",425);																								
			this.parentNode.parentNode.childNodes[1].style.visibility = "visible";						
			IsInitialized = true;
			return false;
		}
		else
		{
			Effect.BlindUp( this.parentNode.parentNode.childNodes[1].id , { duration: 0.4 });					
			setTimeout("hideMenuItem('"+this.parentNode.parentNode.childNodes[1].id+"')",425);												
			LastActiveMenuHeader = this.parentNode.parentNode.childNodes[1];
			IsInitialized = true;
			return false;
		}		
	}	
	function hideMenuItem( sAObjectName )
	{
		$( sAObjectName ).style.visibility = "hidden";
	}
	function showMenuItem( sAObjectName )
	{
		$( sAObjectName ).style.visibility = "hidden";	
		$( sAObjectName ).style.visibility = "visible";
	}	
	
	function Click()
	{
		try
		{			
			if( bABusy == true )
			{
				return false;
			}
			if( IsInitialized == true )
			{	
				if( this.parentNode.parentNode.className == 'level1') {
					Effect.BlindUp( LastActiveMenuHeader.id , { duration: 0.4 });
					setTimeout("hideMenuItem('"+LastActiveMenuHeader.id+"')",425);					
				}
			}
			EffectMove( 'week_special', $('week_special').offsetLeft, 25 ); 
			if( $('right_mid_bar').offsetLeft != 664 )
			{
				EffectMove( 'right_mid_bar', 664, $('right_mid_bar').offsetTop ); 
			}						
			if( bAOnMain == false )
			{
				if ( navigator.appName == 'Microsoft Internet Explorer' ) {
					document.getElementById('right_picture').style.top = $('RVPageFrame').offsetHeight - $('right_picture').getHeight() + 29 + "px";
				}else {
					document.getElementById('right_picture').style.top = $('RVPageFrame').offsetHeight - $('right_picture').getHeight() -89 + "px";
				}							
			}			
			if( bAOnMain == true && this.className == 'wikilink1' )
			{
				bAOnMain = false;
				ChangeRelatedResources( this.link );				
			}			
			bABusy = true;				
			var sHREF = this.link;
			
			//$('center_img_top').link = sHREF;
			//$('center_img_top').ondblclick = Login;
			
			new Ajax.Request(sHREF,
			{
				method:'get',
				parameters:'data=wikicontent',
				onSuccess: function(transport)
				{
					var response = transport.responseText || "Error";						
					Effect.BlindUp('content_area', { duration: 0.4 });	
					StaticContent = response.substring( response.indexOf('wikipage start',0)+18, response.indexOf('wikipage stop',0)-5 );	

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-16652769-2']);
  _gaq.push(['_trackPageview']); 

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })()					
					
					setTimeout("changeIt('"+sHREF+"')",450);									
				},
				onFailure: function()
				{
					alert('Something went wrong...') 
				}
			});						
			return false;
		}
		catch(E)
		{
			alert('Error: ' + E.description );
		}
	}	
	function Login()
	{
		document.location = this.link + "?do=login";
	}
	function ChangeRelatedResources( sAHref )
	{
		var pictureLeft = $('menuleftpicture');						
		if( pictureLeft.link != root+"menu/picture_two" )
		{
			pictureLeft.link = root+"menu/picture_two";									
			new Ajax.Request(pictureLeft.link,
			{
				method:'get',
				parameters:'data=wikicontent',
				onSuccess: function(transport)
				{
					var response = transport.responseText || "Error";						
					PictureContent[0] = response.substring( response.indexOf('wikipage start',0)+18, response.indexOf('wikipage stop',0)-5 );															
					Effect.Fade('menuleftpicture', { duration: 0.1 });
					setTimeout( "ChangePicture( 'menuleftpicture', true, 0 )", 100 );
				},
				onFailure: function()
				{
					alert('Something went wrong...') 
				}
			});	
		}	
		
		var pictureRight = $('menurightpicture');
		if( pictureRight.link != root+"menu/picture_right_two" )
		{
			pictureRight.link = root+"menu/picture_right_two";						
			new Ajax.Request(pictureRight.link,
			{
				method:'get',
				parameters:'data=wikicontent',
				onSuccess: function(transport)
				{
					var response = transport.responseText || "Error";						
					PictureContent[1] = response.substring( response.indexOf('wikipage start',0)+18, response.indexOf('wikipage stop',0)-5 );															
					Effect.Fade('menurightpicture', { duration: 0.2 });
					setTimeout( "ChangePicture( 'menurightpicture', true, 1 )", 250 );					
				},
				onFailure: function()
				{
					alert('Something went wrong...') 
				}
			});	
		}			
	}
	function ChangePicture( sADivID, bAEffect, iAID )
	{	
		$(sADivID).innerHTML = PictureContent[iAID];					
		setTimeout( "Appear( '"+sADivID+"', "+bAEffect+", "+iAID+" )", 500 );		
	}
	function Appear( sADivID, bAEffect, iAID )
	{		
		if( iAID == 1 ) {			
			var iHeight = $(sADivID).getHeight();			
			if ( navigator.appName == 'Microsoft Internet Explorer' ) {
				$('right_picture').style.top = ( $('RVPageFrame').offsetHeight - iHeight + 79) + "px";		
			}else {
				$('right_picture').style.top = ( $('RVPageFrame').offsetHeight - iHeight - 89) + "px";		
			}			
		}					
		if( bAEffect ) { 
			Effect.Appear( sADivID, { duration: 0.2 });	
		}
	}
	function changeIt( sAHref )
	{	
		$('content_area').innerHTML = StaticContent;					
		Effect.BlindDown('content_area', { duration: 0.4 });		
		for ( i=0; i<document.forms.length ; i++ )
		{		
			document.forms[i].action = sAHref; 
		}	
		setTimeout("timeOut()",400);		
	}	
	function timeOut()
	{	
		bABusy = false;
		$('content_area').style.height = "410px";			
	}
	
function sleep(milliseconds) {
  var start = new Date().getTime();
  for (var i = 0; i < 1e7; i++) {
    if ((new Date().getTime() - start) > milliseconds){
      break;
    }
  }
}

	
