var giftNewsActiveCtrl;
var giftNewsActivePopup;

function GiftNewsClick(ctrl,popupId)
{

	if(ctrl!=null)
		ctrl.blur();

	var deactivate=false;

	if(giftNewsActiveCtrl!=null)
	{
		giftNewsActiveCtrl.className='modHeadEllos1980-divGiftNews';

		if(giftNewsActiveCtrl==ctrl || ctrl==null)
			deactivate=true;
	}

	if(!deactivate)
	{
		ctrl.className='modHeadEllos1980-divGiftNewsActive'
		giftNewsActiveCtrl = ctrl;
	}
	else
	{
		giftNewsActiveCtrl = null;
		giftNewsActivePopup.fadeOut();
		giftNewsActivePopup = null;
	}

	var popup=null;

	if ( (popupId != null) && (popupId != "") )
		popup = $("#"+popupId);

	if ( giftNewsActivePopup != null )
		giftNewsActivePopup.fadeOut();

	if( (giftNewsActiveCtrl != null) && (popup != null) )
	{        
		popup.fadeIn();
		var topPosition = giftNewsActiveCtrl.offsetTop + giftNewsActiveCtrl.offsetHeight;
		popup.css('top',topPosition+'px');    
		giftNewsActivePopup=popup;
	}

}


function OpenNewsLetterWarning(windowTitle)
{
	newsLetterWarning = dhtmlmodal.open('newsLetterWarningLayer', 'iframe', '/modules/moduleHeaderEllos1980/newsLetterWarningLayer.aspx', windowTitle, 'width=405px,height=253px,center=1,resize=0,scrolling=0')
}

