var LayerHeight;var langCode;
function InitLockClubPage()
{
	var ModuleTable = document.getElementById('Table_Amember');
	ModuleTable.className = 'transON';
	var Module = document.getElementById("LayerDiv_ClubPage");
	var layerTableId = document.getElementById("LayerTable_ClubPage");			
	layerTableId.style.height = "1265px"; 	
	Module.style.display = '';
	Module.style.position = 'absolute';
}
function Lock( TableId, DivTagId, LayerTableId, transClass)
{
	var ModuleTable = document.getElementById(TableId);
	ModuleTable.className = transClass;
	var Module = document.getElementById(DivTagId);
	
	var layerTableId = document.getElementById(LayerTableId);			
	var Height = ModuleTable.clientHeight;	
	var Width = ModuleTable.clientWidth;
	
	if(TableId == 'Table_GiftVoucher' ||TableId == 'Table_CustomerService' || TableId == 'Table_Amember' || TableId == 'DivSearchResult' || TableId == 'TableAuctionList' || TableId == 'TableHowtouse' || TableId == 'TableLastChance' || TableId =='TableFinishedList' || TableId == 'Tbl_AuctionPdInfo' || TableId == 'MoreInfoEditProfile' || TableId == 'DivQuickPoll' || TableId == 'CAS_SignupGMember' || TableId == 'DivInstantWinn' || TableId == 'Table_Merlin' || TableId == 'Table_DTFgame')
	{		
		var area3 = document.getElementById('Area3');
		if(LayerHeight == 1)
		  Height = 65;
		else if(LayerHeight == 2)
		  Height = 33;	
		else
		   Height = 20;
		if(ModuleTable.clientHeight == 0 )
		{
		  Height += area3.clientHeight;
		}
		else
		{
		  if(LayerHeight != 3) // Set LayerHeight = 3 if we want to use area3 height
			Height += ModuleTable.clientHeight;
		  else
		    Height += area3.clientHeight;	
		}
	}
	layerTableId.style.height = Height;
	layerTableId.style.width = Width; 	
	Module.style.display = '';
	Module.style.position = 'absolute';
}
function ShowLockControl(tbId,LockDivId)
{	
	var pos = getElementPos(tbId);
	var xTablepos = pos.x;
	var yTablepos = pos.y;
	var table = document.getElementById(tbId);
	var tbHeight = table.clientHeight;		
	LockDiv = document.getElementById(LockDivId);
	LockDiv.style.width = table.clientWidth - 5; 		
	LockDiv.style.display = '';
	LockDiv.style.position = 'absolute';	
	var LockY = ((tbHeight / 2) + yTablepos ) - ( LockDiv.clientHeight / 2);		
	LockDiv.style.top = LockY;
	LockDiv.style.left = xTablepos;	
	LockDiv.style.display='block';
	LockDiv.style.position = 'absolute';
}
function HideLockControl(LockDivId)
{
	LockDiv = document.getElementById(LockDivId);
	LockDiv.style.display='none';	
}	
var LMStayPlusProductExist;	
var LMEventPlusProductExist;	
var LMFlyPlusProductExist;
function LockLastMinute()
{	
	if( LMActiveTab != null && LMActiveTab == "Left")
		ShowLMStayLock();	
	if( LMActiveTab != null && LMActiveTab == "Right")
		ShowLMEventLock();	
	if( LMActiveTab != null && LMActiveTab == "Fly")
		ShowFlyLock();	
		
}
function SetLockLMValues(LmStayPlusProductExist,LmEventPlusProductExist,LmFlyPlusProductExist)
{
	LMStayPlusProductExist = LmStayPlusProductExist ;	
	LMEventPlusProductExist = LmEventPlusProductExist;
	LMFlyPlusProductExist = LmFlyPlusProductExist;
}
function ShowLMStayLock()
{
	if(LMStayPlusProductExist == 'True')
	{		
		Lock( 'Table_LastMinute1', 'LayerDiv_LM1', 'LayerTable_LM1', 'transPlusON');
		ShowLockControl('Table_LastMinute1','divLock_LM');
	}
}
function ShowLMEventLock()
{		
	if(LMEventPlusProductExist == 'True')
	{
		Lock( 'Table_LastMinute2', 'LayerDiv_LM2', 'LayerTable_LM2', 'transPlusON');
		ShowLockControl('Table_LastMinute2','divLock_LM');
	}
}
function ShowFlyLock()
{
	if(LMFlyPlusProductExist == 'True')
	{
		Lock( 'Table_LastMinute3', 'LayerDiv_LM3', 'LayerTable_LM3', 'transPlusON');
		ShowLockControl('Table_LastMinute3','divLock_LM');
	}
}
function UnlockLastMinute()
{
	Unlock( 'Table_LastMinute1', 'LayerDiv_LM1' );
	Unlock( 'Table_LastMinute2', 'LayerDiv_LM2' );
	HideLockControl('divLock_LM');
}
function LockAuction()
{
	Lock( 'Table_AuctionLeft', 'LayerDiv_Auction', 'LayerTable_Auction', 'transPlusON');
	ShowLockControl('Table_AuctionLeft','divLock_Auction');	
}
function UnlockAuction()
{
	Unlock( 'Table_AuctionLeft', 'LayerDiv_Auction' );
	HideLockControl('divLock_Auction');
}
function UnlockCustomerService()
{
	Unlock( 'Table_CustomerService', 'LayerDiv_CustomerService' );
	HideLockControl('divTeleDetails');
}
function UnlockTipfriend()
{
	Unlock( 'Table_DTFgame', 'LayerDiv_Tipfrnd' );
	HideLockControl('divTipFrnd');
}
function UnlockGift()
{
	Unlock( 'Table_GiftVoucher', 'LayerDiv_GiftVoucher' );
	HideLockControl('divMatrix');
}
function UnlockMerlin()
{
	Unlock( 'Table_Merlin', 'LayerDiv_Merlin' );
	HideLockControl('divMerlinPopupDetails');
}
function LockDutchAuction()
{
	Lock( 'Table_DutchAuction', 'LayerDiv_DutchAuction', 'LayerTable_DutchAuction', 'transPlusON');
	ShowLockControl('Table_DutchAuction','divLock_DutchAuction');	
}
function UnlockDutchAuction()
{
	Unlock( 'Table_DutchAuction', 'LayerDiv_DutchAuction');
	HideLockControl('divLock_DutchAuction');
}
function LockPlusClubOffer()
{
	Lock( 'Tabel_PlusClubOffer', 'LayerDiv_PlusClubOffer', 'LayerTable_PlusClubOffer', 'transPlusON');
	ShowLockControl('Tabel_PlusClubOffer','divLock_PlusClubOffer');	
}
function UnlockPlusClubOffer()
{
	Unlock( 'Tabel_PlusClubOffer', 'LayerDiv_PlusClubOffer' );
	HideLockControl('divLock_PlusClubOffer');
}
function LockPlusOffer()
{
	Lock( 'Div_PlusOffer', 'LayerDiv_PlusOffer', 'LayerTable_PlusOffer', 'transPlusON');
	ShowLockControl('Div_PlusOffer','divLock_PlusOffer');	
}
function UnlockPlusOffer()
{
	Unlock( 'Div_PlusOffer', 'LayerDiv_PlusOffer' );
	HideLockControl('divLock_PlusOffer');
}
function LockPlusService()
{	
	Lock( 'Table_PlusService', 'LayerDiv_PlusService', 'LayerTable_PlusService', 'transPlusON');
	ShowLockControl('Table_PlusService','divLock_PlusService');
}
function UnlockPlusService()
{
	Unlock( 'Table_PlusService', 'LayerDiv_PlusService' );
	HideLockControl('divLock_PlusService')
}
function LockClubPage(LayerSwitch)
{	
    LayerHeight = LayerSwitch;
	Lock( 'Table_Amember', 'LayerDiv_ClubPage', 'LayerTable_ClubPage', 'transON');
}
function UnlockClubPage()
{
	Unlock('Table_Amember', 'LayerDiv_ClubPage');
}
function LockPlusMemberModules(lang)
{
	langCode = lang;
    LockLastMinute();
    if( langCode != "de" && langCode != "no" )
    {
		LockAuction();
	}
	if(langCode == "da" || langCode == "sv")
	{
		LockDutchAuction();		
	}	
	LockPlusClubOffer();	
	if( langCode != "de" )
	{
		LockPlusOffer();
		LockPlusService();
	}
	window.onresize = resizeLockDiv;
}
function UnlockPlusMemberModules(langCode)
{
	UnlockLastMinute();
	if( langCode != "de" && langCode != "no" )
	{
		UnlockAuction();
	}
	if(langCode == "da" || langCode == "sv")
	{
		UnlockDutchAuction();
	}
	UnlockPlusClubOffer();
	UnlockPlusOffer();
	UnlockPlusService();	
}
function LockMcafeeBanner()
{	
	Lock( 'Table_McafeeBanner', 'LayerDiv_McafeeBanner', 'LayerTable_McafeeBanner', 'transPlusON');
	ShowLockControl('Table_McafeeBanner','divLock_McafeeBanner');
}
function UnlockMcafeeBanner()
{
	Unlock( 'Table_McafeeBanner', 'LayerDiv_McafeeBanner' );
	HideLockControl('divLock_McafeeBanner');
}
function resizeLockDiv()
{ 
  if( LMActiveTab == "Left" )
	ShowLMStayLock();
  else
	ShowLMEventLock();
  
  if( langCode != "de" )
	ShowLockControl('Table_AuctionLeft','divLock_Auction');
  if(langCode == "da")
  {
      ShowLockControl('Table_DutchAuction','divLock_DutchAuction');
      ShowLockControl('Table_McafeeBanner','divLock_McafeeBanner');
  }
  
  ShowLockControl('Tabel_PlusClubOffer','divLock_PlusClubOffer');
  
  if( langCode != "de" )
  {  ShowLockControl('Table_PlusService','divLock_PlusService'); ShowLockControl('Div_PlusOffer','divLock_PlusOffer');  }
}
function LockSearchResultPage(AdvancedSearchBtn , ResultsAvailable, bBool)
{	
	Lock( 'DivSearchResult', 'LayerDiv_SearchResultPage', 'LayerTable_SearchResultPage', 'transON');
	var SelectId = getElementsByClassName(document,"select","SearchBoxDropdownCommon_SR");							  
	for (var i=0; i<SelectId.length; i++)
	{
		SelectId[i].style.visibility = "hidden";       
	}  
	var Menu = document.getElementById("ThemeMenu");
	Menu.style.display = 'none';
	if(bBool == '1')
	{
		ShowSearchBoxLayer(AdvancedSearchBtn , ResultsAvailable);
	}
	else
	{
		ShowSaveExtraLayer();
		bShowTema = 1;
	}
			
}
function UnlockLockSearchResult(bBool)
{
	Unlock('DivSearchResult','LayerDiv_SearchResultPage');	
	var Module = document.getElementById("DivSearchBox");
	Module.style.display = 'none';	
	var SelectId = getElementsByClassName(document,"select","SearchBoxDropdownCommon_SR");							  
	for (var i=0; i<SelectId.length; i++)
	{
		SelectId[i].style.visibility = '';       
	}
	if(bBool == '0')
	{
	  bShowTema = 0;
	}
}
function HideSaveExtraLayer()
{
  var nRet = Dtf.WebSite.Default.SetSaveExtra();
  if(nRet.value == "1")
  {
	UnlockLockSearchResult('0');
	var divSaveExtraLayer = document.getElementById('Popup_Save');
	if(divSaveExtraLayer !=null)
	{divSaveExtraLayer.style.display = 'none';}
  }
}
function ShowSaveExtraLayer()
{
	SetSaveExtraLayer();
	window.onresize = resizeSaveTextLayer;
}
function SetSaveExtraLayer()
{
  var ModuleTableNew = document.getElementById('DivSearchResult');
  var posNew = getElementPos('DivSearchResult');
  var clientX = posNew.x;
  var clientY = posNew.y;
  var ModuleWidth = ModuleTableNew.clientWidth;
  var DivWidth;  
  var Popup = document.getElementById('Popup_Save');
  if(Popup != null)
  {
	Popup.style.display='block';
    Popup.style.position = 'absolute';
	DivWidth = Popup.clientWidth;
	Popup.style.top  = clientY+209;
	Popup.style.left = ModuleWidth+ clientX - DivWidth - 250;
  }
}
function resizeSaveTextLayer()
{
	if(document.getElementById('Popup_Save').style.display == 'block')
	{
		SetSaveExtraLayer();
	}
}
function ResizeSearchResultDivPos(AdvancedSearchBtn,ResultsAvailable)
{	 
	var Module = document.getElementById('DivSearchBox');			  
    SetSearchDivTagPos(Module, AdvancedSearchBtn,ResultsAvailable);  
}	
function ShowSearchBoxLayer(AdvancedSearchBtn , ResultsAvailable)
{	
	var Module = document.getElementById('DivSearchBox');
	Module.style.display = '';
	Module.style.position = 'absolute';	
	SetSearchDivTagPos(Module,AdvancedSearchBtn,ResultsAvailable);
	window.onresize = function(){   var Module = document.getElementById('DivSearchBox'); SetSearchDivTagPos(Module, AdvancedSearchBtn,ResultsAvailable); }
}
function LockSlotMachinePage()
{
	var ModuleTable = document.getElementById('Table_Amember');
	ModuleTable.className = 'transON';
	var Module = document.getElementById("LayerDiv_Slotmachine");
	var layerTableId = document.getElementById("LayerTable_Slotmachine");			
	layerTableId.style.height = "1070px"; 	
	Module.style.display = '';
	Module.style.position = 'absolute';
}
function LockCustomerService()
{	
	LayerHeight = 3 // Set LayerHeight = 3 if we want to use area3 height
	Lock( 'Table_CustomerService', 'LayerDiv_CustomerService', 'LayerTable_CustomerService', 'transON');
    document.getElementById('divTeleDetails').style.display = "block";
}	
function LockTipFriend()
{
	LayerHeight = 3 // Set LayerHeight = 3 if we want to use area3 height
	Lock( 'Table_DTFgame', 'LayerDiv_Tipfrnd', 'LayerTable_Tipfrnd', 'transON');
    document.getElementById('divTipFrnd').style.display = "block";
}
function LockGiftVoucher()
{
    LayerHeight = 2;	
    Lock( 'Table_GiftVoucher', 'LayerDiv_GiftVoucher', 'LayerTable_GiftVoucher', 'transON');
    var Module=document.getElementById('divMatrix');    
    SetDivTagPos(Module,'Table_GiftVoucher');
}
function LockMerlin()
{		
	LayerHeight = 3 // Set LayerHeight = 3 if we want to use area3 height
	Lock( 'Table_Merlin', 'LayerDiv_Merlin', 'LayerTable_Merlin', 'transMerlinON');
    document.getElementById('divMerlinPopupDetails').style.display = "block";
}	
function HideDiv()
{	
	document.getElementById('divTeleDetails').style.display = "none";
	UnlockCustomerService();
}
function HideDTFGameDiv() // For DTFgame tip friend
{	
	document.getElementById('divTipFrnd').style.display = "none";
	HideErrorControl();
	UnlockTipfriend();
}
function HideMerlinDiv()
{		
	document.getElementById('divMerlinPopupDetails').style.display = "none";
	UnlockMerlin();
}
function HideGiftVoucher()
{
	document.getElementById('divMatrix').style.display = "none";
	UnlockGift();
	
}
function SetSearchDivTagPos(DivTag, AdvancedSearchBtn,ResultsAvailable)
{	
	var posNew = getElementPos(AdvancedSearchBtn);			
	var clientX = posNew.x;
	var clientY = posNew.y;	  	
	if(ResultsAvailable == "1")
	{			
		DivTag.style.display='block';			
		DivTag.style.left = clientX - 17;
		DivTag.style.top = clientY - 14;			
	}
	else if(ResultsAvailable == "0")
	{
	   DivTag.style.display='block';							
	   DivTag.style.left = clientX - 63;
	   DivTag.style.top = clientY - 9;
	}			
}
function ShowPlusOfferLockControl()
{
	if(PlusLogin != true)
		ShowLockControl('Div_PlusOffer','divLock_PlusOffer');
}
function ShowPlusServiceLockControl(langCode)
{
   if( langCode != "de" && PlusLogin != true)
		{ShowLockControl('Table_PlusService','divLock_PlusService')};
}
function LockPlusOfferSearchResult()
{
  LayerHeight = 0;
  Lock( 'DivSearchResult', 'LayerDiv_SearchResultPage', 'LayerTable_SearchResultPage', 'transON');
  var SelectId = getElementsByClassName(document,"select","SearchBoxDropdownCommon_SR");							  
  for (var i=0; i<SelectId.length; i++)
  {
     SelectId[i].style.visibility = "hidden";       
  }
  bShowTema = 1;  
  if(getElementsByClassName(document,"a","Logout")[0] != null)
	getElementsByClassName(document,"a","Logout")[0].style.display = 'none';
  if(getElementsByClassName(document,"a","Login")[0] != null)	
	getElementsByClassName(document,"a","Login")[0].style.display = 'block';
  
}
function UnLockPlusOfferSearchResult()
{
    bShowTema = 0;
    Unlock('DivSearchResult','LayerDiv_SearchResultPage');
	var SelectId = getElementsByClassName(document,"select","SearchBoxDropdownCommon_SR");							  
	for (var i=0; i<SelectId.length; i++)
    {
        SelectId[i].style.visibility = '';       
    }
    try{getElementsByClassName(document,"td","cssLoginCell")[0].style.display = 'block';}catch(e){};
    if(getElementsByClassName(document,"a","Logout")[0] != null)
		getElementsByClassName(document,"a","Logout")[0].style.display = 'block';
	if(getElementsByClassName(document,"a","Login")[0] != null)	
		getElementsByClassName(document,"a","Login")[0].style.display = 'none';
}

function CustomerServiceScript()
{
	LockCustomerService();
	ShowNewCustomerLayer();
}
function TipFriendScript()
{
	LockTipFriend();
	ShowNewTipFriend();
	// clear textbox's
	try{Name1 = getElementsByClassName(document,"input","TxtBox")[0].value = '';}catch(e){}
	try{Email1 = getElementsByClassName(document,"input","TxtBox")[1].value = '';}catch(e){}
	try{Name2 = getElementsByClassName(document,"input","TxtBox")[2].value = '';}catch(e){}
	try{Email2 = getElementsByClassName(document,"input","TxtBox")[3].value = '';}catch(e){}
	try{Name3 = getElementsByClassName(document,"input","TxtBox")[4].value = '';}catch(e){}
	try{Email3 = getElementsByClassName(document,"input","TxtBox")[5].value = '';}catch(e){}
}

function MerlinScript()
{
	LockMerlin();
	ShowNewMerlinLayer();
}
function GiftVoucherScript()
{
	LockGiftVoucher();
	window.onresize = resizeNewGiftLayer;
}
function resizeNewGiftLayer()
{
  var Module=document.getElementById('divMatrix');
  if(Module.style.display == 'block')
  {
	SetDivTagPos(Module,'Table_GiftVoucher');
  }
}
function ShowNewCustomerLayer()
{
  SetNewCustomerLayerPosition();
  window.onresize = resizeNewCustomerLayer;
}
function ShowNewTipFriend()
{
  SetNewTipFriendPosition();
  window.onresize = resizeNewTipfriend;
}
function ShowNewMerlinLayer()
{
	SetNewMerlinLayerPosition();
	window.onresize = resizeNewMerlinLayer;
}
function resizeNewMerlinLayer()
{
  var DivPopup = getElementsByClassName(document,"div","PopupcssMerlinLayer")[0]; 
  if(DivPopup.style.display == 'block')
  {
	SetNewMerlinLayerPosition();
  }
}
function SetNewMerlinLayerPosition()
{
  var posNew = getElementPos('Table_Merlin');
  var clientX = posNew.x;
  var clientY = posNew.y;  
  var DivPopup = getElementsByClassName(document,"div","PopupcssMerlinLayer")[0];
  if(DivPopup!=null)
  {
	DivPopup.style.left = clientX + 125;
	DivPopup.style.top = clientY + 250;     
	DivPopup.style.display = "block";
	DivPopup.style.position= 'absolute';
  }
}
function resizeNewCustomerLayer()
{
  var DivPopup = getElementsByClassName(document,"div","cssNewCustomerLayer")[0]; 
  if(DivPopup.style.display == 'block')
  {
	SetNewCustomerLayerPosition();
  }
}
function resizeNewTipfriend()
{
  var DivPopup = getElementsByClassName(document,"div","Tipfrnd")[0]; 
  if(DivPopup.style.display == 'block')
  {
	SetNewTipFriendPosition();
  }
}
function SetNewCustomerLayerPosition()
{
  var posNew = getElementPos('Table_CustomerService');
  var clientX = posNew.x;
  var clientY = posNew.y;  
  var DivPopup = getElementsByClassName(document,"div","cssNewCustomerLayer")[0];
  if(DivPopup!=null)
  {
	DivPopup.style.left = clientX + 250;
	DivPopup.style.top = clientY + 50;     
	DivPopup.style.display = "block";
	DivPopup.style.position= 'absolute';
  }
}
function SetNewTipFriendPosition()
{
  var posNew = getElementPos('Table_DTFgame');
  var clientX = posNew.x;
  var clientY = posNew.y;  
  var DivPopup = getElementsByClassName(document,"div","Tipfrnd")[0];
  if(DivPopup!=null)
  {
	DivPopup.style.left = clientX + 13;
	DivPopup.style.top = clientY + 50;     
	DivPopup.style.display = "block";
	DivPopup.style.position= 'absolute';
  }
}
/* Edit */
function CloseEditDivTag(DivTagName,AreaTableName,LayerDivName)
{
    var HiddenCtrl = document.getElementById(DivTagName);
    if(HiddenCtrl != null)
    {
		var DivTag = document.getElementById(DivTagName);
		DivTag.style.display='none';
		UnLockAuctionPage(AreaTableName,LayerDivName);
		RestoreMemberDetails('1');
	}
}
function LockQuickPoll()
{
  LayerHeight = 3 // Set LayerHeight = 3 if we want to use area3 height
  Lock( 'DivQuickPoll', 'LayerDiv_QuickPollPage', 'LayerTable_QuickPollPage', 'transON');
}
function UnLockQuickPoll()
{
	 Unlock('DivQuickPoll','LayerDiv_QuickPollPage');
	 HideComparisonTable();
}
function LockInstantWinn()
{
  LayerHeight = 3 // Set LayerHeight = 3 if we want to use area3 height
  Lock( 'DivInstantWinn', 'LayerDiv_InstantWinn', 'LayerTable_InstantWinn', 'transON');
}
function UnLockInstantWinn()
{
	 Unlock('DivInstantWinn','LayerDiv_InstantWinn');
	 HideComparisonTable();
}
function EditMemberDetailsCallBack(ret)
{
	if(ret.value[0] == 1)
	{
		getElementsByClassName(document,"input","EditFirstName")[0].value = ret.value[1];
		getElementsByClassName(document,"input","EditLastName")[0].value = ret.value[2];
		getElementsByClassName(document,"span","EditEmail")[0].innerHTML = ret.value[9];
		getElementsByClassName(document,"select","EditBDayComboBox")[0].value = ret.value[10];
		getElementsByClassName(document,"select","EditBMonthComboBox")[0].value = ret.value[11];	
		getElementsByClassName(document,"select","EditBYearComboBox")[0].value = ret.value[12];
		var RadioBtnElements = getElementsByClassName(document,"span","genederMlightTxt");   
		var maleRdBtn        = RadioBtnElements[0].getElementsByTagName("input")[0];		
		RadioBtnElements     = getElementsByClassName(document,"span","genederFlightTxt");   
		var femalwRdBtn      = RadioBtnElements[0].getElementsByTagName("input")[0];   
		if(ret.value[13] == 1)
		{
			maleRdBtn.checked = true;
			femalwRdBtn.checked = false;
		}
		else
		{
			maleRdBtn.checked = false;
			femalwRdBtn.checked = true;
		}		
		
		var dropCountry = getElementsByClassName(document,"select","EditCountry")[0];
		for(nIndx=0;nIndx<dropCountry.length;nIndx++)
		{
			if(dropCountry.options[nIndx].value == ret.value[6])
			{
				nSelectedIndx = nIndx;
			}
		}
		dropCountry.selectedIndex = nSelectedIndx;
	}
}
function LockUpgradeMember()
{
	ClearErrors();	
	Lock( 'Table_Upgrademember','LayerDiv_EditMember', 'LayerTable_EditMember', 'transON');
   	var posNew = getElementPos('Table_Upgrademember');  
	var DivPopup = getElementsByClassName(document,"div","DivClass")[0];
	window.onresize = resizeEditUpgrade;
	if(DivPopup!=null)
	{
		DivPopup.style.left = posNew.x+190;
		DivPopup.style.top = posNew.y+55;     
		DivPopup.style.display = "block";
		DivPopup.style.position= 'absolute';
	}
	Dtf.WebSite.Default.GetEditMemberDetails(EditMemberDetailsCallBack);
}
function resizeEditUpgrade()
{
  var Module=document.getElementById('DivUpgrade');
  if(Module.style.display == 'block')
  {
	SetDivTagPos(Module,'Table_Upgrademember');
  }
}

function CancelEditUpgrade()
{
	Unlock('Table_Upgrademember','LayerDiv_EditMember');
	HideLockControl('DivUpgrade');
}
function ClearErrors()
{
	getElementsByClassName(document,"img","DefaultErrorImage")[0].style.display = "none";  
	document.getElementById("DivSignupBError").style.display = "none";
	getElementsByClassName(document,"img","DefaultErrorImage")[0].style.display = "none"; 
	document.getElementById('SignUpBError1').style.display = "none";
	document.getElementById('ImgErrName').style.display = "none";
	document.getElementById('SignUpBError7').style.display = "none";
	document.getElementById('SignUpBError8').style.display = "none";
	document.getElementById("ImgErrLName").style.display = "none";
	document.getElementById('SignUpBError6').style.display = "none";
	document.getElementById('ImgErrNation').style.display = "none";
	document.getElementById('SignUpBError5').style.display = "none";
	document.getElementById('ImgErrGender').style.display = "none";     
	document.getElementById('SignUpBError4').style.display = "none";
	document.getElementById('ImgErrDate').style.display = "none";
}
function SaveEditUpgrade(langcode)
{
   ClearErrors();	
   getElementsByClassName(document,"img","DefaultErrorImage")[0].style.display = "block";  
    //FirstName
   var txtNameBox = getElementsByClassName(document,"input","EditFirstName")[0];      
   var validNameBox = validateIsEmpty(txtNameBox);   
   if(validNameBox)
   {   
		validNameBox  = IsValidString(txtNameBox.value);		
   }   
   //LastName
    txtLastNameBox = getElementsByClassName(document,"input","EditLastName")[0];      		
   validLastNameBox = validateIsEmpty(txtLastNameBox);
   if(validLastNameBox)
   {   		
		validLastNameBox  = IsValidString(txtLastNameBox.value);		
   }		
	//DropDown
	var DropDownElements = getElementsByClassName(document,"select","EditCountry");   
	var DropDownNational = DropDownElements[0];   
	var validNational   = validateDropDown(DropDownNational);     	
	//DOB
	var DropDownDay = getElementsByClassName(document,"select","EditBDayComboBox")[0];
   var DropDownMonth = getElementsByClassName(document,"select","EditBMonthComboBox")[0];
   var DropDownYear= getElementsByClassName(document,"select","EditBYearComboBox")[0];   
   var validReqDate = validateReqDate(DropDownDay,DropDownMonth,DropDownYear)
   if(validReqDate)
   var validDate = IsValidDate(DropDownDay,DropDownMonth,DropDownYear); 
   //Gender
   var RadioBtnElements = getElementsByClassName(document,"span","genederMlightTxt");   
   var maleRdBtn        = RadioBtnElements[0].getElementsByTagName("input")[0];
   var lblmale          = RadioBtnElements[0].getElementsByTagName("label")[0];
   RadioBtnElements     = getElementsByClassName(document,"span","genederFlightTxt");   
   var femalwRdBtn      = RadioBtnElements[0].getElementsByTagName("input")[0];
   var lblfemale        = RadioBtnElements[0].getElementsByTagName("label")[0];   
   var validGender = validateGenderBtns(maleRdBtn,femalwRdBtn);           
   if(validNameBox && validGender && validNational && validDate && validLastNameBox)
   {
		var FirstName = txtNameBox.value;
		var LastName  = txtLastNameBox.value;
		var dayIndex   = DropDownDay.selectedIndex;
		var monthIndex = DropDownMonth.selectedIndex;
		var yearIndex  = DropDownYear.selectedIndex;		
		var day = DropDownDay.options[dayIndex].text;
		var month = DropDownMonth.options[monthIndex].value;
		var year = DropDownYear.options[yearIndex].text;		
		sexId = 1;
		if(maleRdBtn.checked == true)
			sexId = 1;
		else if(femalwRdBtn.checked == true)   
			sexId = 0;
		var nationIndex = DropDownNational.selectedIndex;     
		CountryId = DropDownNational.options[nationIndex].value;
		EditUpgradeMember(FirstName,LastName,CountryId,year,month,day,sexId);			
   }
   else
   {
			document.getElementById("DivSignupBError").style.display = "block";
			getElementsByClassName(document,"img","DefaultErrorImage")[0].style.display = "block"; 
			getElementsByClassName(document,"img","ErrorTickImage")[0].style.display = "none"; 
			if( !validNameBox )
			{
				document.getElementById('SignUpBError1').style.display = "block";
				document.getElementById('ImgErrName').style.display = "block";
			}
			if(!validLastNameBox  )
			{
				document.getElementById('SignUpBError7').style.display = "block";
				document.getElementById("ImgErrLName").style.display = "block";
			}
			if( !validNational )
			{
				document.getElementById('SignUpBError6').style.display = "block";
				document.getElementById('ImgErrNation').style.display = "block";
			} 
			if( !validGender )  //Gender RadioButtons
			{
				document.getElementById('SignUpBError5').style.display = "block";
				document.getElementById('ImgErrGender').style.display = "block";     
			}     
			if( validReqDate && !validDate )
			{
				document.getElementById('SignUpBError4').style.display = "block";
				document.getElementById('ImgErrDate').style.display = "block";
			}      
			if( !validReqDate )
			{
				document.getElementById('SignUpBError8').style.display = "block";
				document.getElementById('ImgErrDate').style.display = "block";     
			}
   }
   
}
function EditUpgradeMember(EditName,LastName,CountryId,year,month,day,sexId)
{
	AjaxPro.timeoutPeriod = 60*1000;	
	Dtf.WebSite.Default.SaveEditMemberProfile(EditName,LastName,CountryId,year,month,day,sexId,EditUpgradeMemberCallBack,null,null, null, LoginTimeout, null);	
}
function EditUpgradeMemberCallBack(ret)
{
	if(ret != null)
	{
		getElementsByClassName(document,"img","DefaultErrorImage")[0].style.display = "none";  
		document.getElementById("DivSignupBError").style.display = "none";
		getElementsByClassName(document,"img","DefaultErrorImage")[0].style.display = "none"; 
		document.getElementById('SignUpBError1').style.display = "none";
		document.getElementById('ImgErrName').style.display = "none";
		document.getElementById('SignUpBError7').style.display = "none";
		document.getElementById('SignUpBError8').style.display = "none";
		document.getElementById("ImgErrLName").style.display = "none";
		document.getElementById('SignUpBError6').style.display = "none";
		document.getElementById('ImgErrNation').style.display = "none";
		document.getElementById('SignUpBError5').style.display = "none";
		document.getElementById('ImgErrGender').style.display = "none";     
		document.getElementById('SignUpBError4').style.display = "none";
		document.getElementById('ImgErrDate').style.display = "none";
		if( ret.value[0] == 1 )
		{
			if(ret.value[1] != "")
				location.href = ret.value[1];
		}
		else if( ret.value[0] == -1 )
		{
			if(ret.value[1] != "")
				location.href = ret.value[1];
		}
		else if( ret.value[0] == -2 )
		{
			if(ret.value[1] != "")
				location.href = ret.value[1];
		}
		else if( ret.value[0] == -3 )
		{
			if(ret.value[1] != "")
				location.href = ret.value[1];
		}
		else if( ret.value[0] == -4 )
		{
			if(ret.value[1] != "")
				location.href = ret.value[1];
		}
	}
}