﻿var IsShowCatcher = false;

function ShowCatcher()
{
	document.location.href = "/club";
}

function ShowMailCatcher()
{
	self.scrollTo(0, 0)	;
	
	var target = $('Catcher');
	var fx = new Fx.Styles(target, {duration: 1000, wait: false}).addEvent('onComplete',function() { NoBorderCatcher();TryRedirect(); });
	fx.options.transition = Fx.Transitions['Bounce']['easeOut'];
	fx.options.duration = 1000;
	if (!IsShowCatcher)
	{
		//$("frcatcher").src = "/catcher/catcher.aspx?SHOW=YES";
		IsShowCatcher = true;
		
		if ($('frpub_300x250pre'))
			$('frpub_300x250pre').style.visibility = "hidden";
		
		if ($('frpub_300x250post'))
			$('frpub_300x250post').style.visibility = "hidden";
		
		if ($('frpub_300x250'))
			$('frpub_300x250').style.visibility = "hidden";
			
		if ($('frpub_728x90'))
			$('frpub_728x90').style.visibility = "hidden";
			
		if ($('frpub_660x250'))
			$('frpub_660x250').style.visibility = "hidden";
			
		if ($('frpub_468x60'))
			$('frpub_468x60').style.visibility = "hidden";
			
		target.style.borderLeft = "solid 1px";
		target.style.borderRight = "solid 1px";
		target.style.borderBottom = "solid 1px";
		fx.start({'height': 559});
	}
	else
	{
		IsShowCatcher = false;
		fx.start({'height': 0});
		
	}
}

function NoBorderCatcher()
{
	if (!IsShowCatcher)
	{
		 $('Catcher').style.border = "none"	;
		 if ($('frpub_300x250pre'))
			$('frpub_300x250pre').style.visibility = "visible";
			
		if ($('frpub_300x250post'))
			$('frpub_300x250post').style.visibility = "visible";
			
		if ($('frpub_300x250'))
			$('frpub_300x250').style.visibility = "visible";
			
		if ($('frpub_728x90'))
			$('frpub_728x90').style.visibility = "visible";
			
		if ($('frpub_660x250'))
			$('frpub_660x250').style.visibility = "visible";
		
		if ($('frpub_468x60'))
			$('frpub_468x60').style.visibility = "visible";
	}
}

function TryRedirect()
{
	
	try
	{

		if (!document.frames)
			top.frcatcher.TryRedirect();
		else
		{
			var myframe = document.frames["frcatcher"];
			
			
			if (IsShowCatcher)
				myframe.TryRedirect();
		}
	}
	catch(err)
	{
	}
}

