﻿var IsDirty=false;function MasterPageBase_AsyncInit()
{MasterPageBase_Init(true);}
var progressDivInitialWidth;var progressDivInitialHeight;var progressDivInitialMarginLeft;function MasterPageBase_Init()
{var progressDiv=$get('FillProgressDiv');if(progressDiv!=null)
{progressDivInitialWidth=166;progressDivInitialHeight=30;progressDivInitialMarginLeft='45%';}
var manager=Sys.WebForms.PageRequestManager.getInstance();if(manager!=null)
{manager.add_beginRequest(MasterPageBase_BeginRequest);}
if(!IsDirty)
{IsDirty=eval($get('PageIsDirty').value);var radWindow=GetRadWindow();if(radWindow!=null)
{radWindow.IsDirty=IsDirty;}}}
function MasterPageBase_BeginRequest(sender,args)
{var postBackElement=args.get_postBackElement();var progressDiv=$get('FillProgressDiv');if(progressDiv!=null)
{progressDiv.style.width=progressDivInitialWidth+'px';progressDiv.style.height=progressDivInitialHeight+'px';progressDiv.style.marginLeft=progressDivInitialMarginLeft;progressDiv.style.top=0;progressDiv.style.left=0;var ajaxUpdatedControlID=postBackElement.getAttribute('ajaxUpdatedControlID');if(ajaxUpdatedControlID==null)
ajaxUpdatedControlID=getParent(postBackElement).getAttribute('ajaxUpdatedControlID');if(ajaxUpdatedControlID!=null&&ajaxUpdatedControlID.length>0)
{var updatedElementIDs=ajaxUpdatedControlID.split(',');for(var i=0;i<updatedElementIDs.length;i++)
{var updatedElement=$get(updatedElementIDs[i]);if(updatedElement!=null)
{progressDiv.style.display='block';progressDiv.style.marginLeft='0';Cover(updatedElement,progressDiv,false);}}}
else
{}}}
function PostCommitScript(customPostCommitScript)
{{var commitButtonClickedHiddenInput=$get('CommitButtonClicked');var commitButtonClicked=commitButtonClickedHiddenInput!=null&&eval(commitButtonClickedHiddenInput.value);if(commitButtonClicked&&customPostCommitScript!=null&&customPostCommitScript.length>0)
{var messagesPanelID=$get('TemplateUserMessagesID').value;var messagesPanel=messagesPanelID.length>0?$get(messagesPanelID):null;if(messagesPanel==null)
{eval(customPostCommitScript);}}}
commitButtonClickedHiddenInput.value='false';}
function CancelButton_Click(url)
{var dialogWindow=GetRadWindow();if(dialogWindow!=null)
{CloseRadWindow();}
else
{window.location.href=url;}
return CancelEvent();}
var topPanel;var titlePanel;var sideBarPanel;var contentPanel;var buttonPanel;var footPanel;var oldTopPanelHeight;var oldSideBarPanelWidth;function MasterPageBase_SetupComponents(topPanelId,titlePanelId,sideBarPanelId,contentPanelId,buttonPanelId,footPanelId)
{if(topPanelId!=null&&topPanelId.length>0)
topPanel=$get(topPanelId);if(titlePanelId!=null&&titlePanelId.length>0)
titlePanel=$get(titlePanelId);if(sideBarPanelId!=null&&sideBarPanelId.length>0)
sideBarPanel=$get(sideBarPanelId);if(contentPanelId!=null&&contentPanelId.length>0)
contentPanel=$get(contentPanelId);if(buttonPanelId!=null&&buttonPanelId.length>0)
buttonPanel=$get(buttonPanelId);if(footPanelId!=null&&footPanelId.length>0)
footPanel=$get(footPanelId);}
function Window_Load()
{addResizeEvent(Window_Resize);if(BrowserDetect.browser!='Explorer')
document.body.style.overflow='hidden';if(topPanel!=null)
{var collapsed=readCookie('TopPanelCollapsed');if(collapsed!=null)
collapsed=eval(collapsed);else
collapsed=false;if(BrowserDetect.browser!='Explorer'){try{topPanel.firstChild.style.width='100%';}
catch(exc){}
try{topPanel.firstChild.style.overflow='visible';}
catch(exc){}
try{if(!collapsed)
topPanel.style.overflow='visible';else
topPanel.style.overflow='hidden';}
catch(exc){}}
else{if(collapsed)
$get('innerSpan').style.display="none"
else
$get('innerSpan').style.display="block"}
topPanel.onresize=TopPanel_Resize;}
Window_Resize();setTimeout("ScrollToFragment()",500);}
function ScrollToElement(theElement)
{var selectedPosX=0;var selectedPosY=0;while(theElement!=null&&theElement!=contentPanel)
{selectedPosY+=theElement.offsetTop;theElement=theElement.offsetParent;}
if(contentPanel!=null)
contentPanel.scrollTop=selectedPosY;else
window.scrollTo(selectedPosX,selectedPosY);}
function ScrollToFragment()
{if(location.hash!=null&&location.hash!='')
{var element=$get(location.hash.substring(1));if(element==null)
element=$get(location.hash);if(element!=null)
ScrollToElement(element);}}
function Window_Resize()
{setTimeout("ResizeContentPanel()",300);}
function TopPanel_Resize(e)
{var topPanelHeight=topPanel.offsetHeight;if(topPanelHeight!=oldTopPanelHeight)
{oldTopPanelHeight=topPanelHeight;ResizeContentPanel();}}
function SideBarPanel_Resize()
{if(BrowserDetect.browser=='Explorer'&&BrowserDetect.version<7)
return;var sideBarPanelWidth=sideBarPanel.offsetWidth;if(sideBarPanelWidth!=oldSideBarPanelWidth)
{oldSideBarPanelWidth=sideBarPanelWidth;ResizeContentPanel();}}
function ResizeContentPanel()
{var pageHeight=livePageHeight();var pageWidth=livePageWidth();var headHeight=0;if(topPanel!=null)
headHeight+=topPanel.offsetHeight+$get(topPanel.id+'Divider').offsetHeight;if(titlePanel!=null)
headHeight+=titlePanel.offsetHeight;var footHeight=0;if(buttonPanel!=null)
footHeight+=(BrowserDetect.browser!='Explorer'&&buttonPanel.offsetHeight==0)?23:buttonPanel.offsetHeight;if(footPanel!=null)
footHeight+=footPanel.offsetHeight;var mainHeight=pageHeight-headHeight-footHeight;if(BrowserDetect.browser=='Explorer'&&BrowserDetect.version>7)
mainHeight-=36;else
mainHeight-=14;if(mainHeight<=99)
{mainHeight=100;}
if(contentPanel!=null)
{contentPanel.style.height=mainHeight+'px';}
if(sideBarPanel!=null)
{sideBarPanel.style.height=mainHeight+'px';}
if(contentPanel!=null)
{var contentWidth=contentPanel.offsetWidth;contentResized(contentWidth,mainHeight);}}
function TopPanel_Click()
{var collapsed=readCookie('TopPanelCollapsed');if(collapsed!=null)
collapsed=eval(collapsed);else
collapsed=false;collapsed=!collapsed;createCookie('TopPanelCollapsed',(collapsed)+'',1);if(BrowserDetect.browser!="Explorer")
{if(!collapsed){try{topPanel.style.overflow='visible';}
catch(exc){}}
else{try{topPanel.style.overflow='hidden';}
catch(exc){}}
ResizeHeightForMozilla();}
else
{setTimeout("$get('innerSpan').style.display = "+collapsed+"? 'none' : 'block'",300);}}
var ResizeHeightIntervalID=0;var ResizeHeightLastHeight=0;function ResizeHeightForMozilla()
{ResizeHeightLastHeight=topPanel.offsetHeight;ResizeHeightIntervalID=setInterval("ResizeHeightInterval()",250);}
function ResizeHeightInterval()
{var topPanelHeight=topPanel.offsetHeight;if(topPanelHeight==ResizeHeightLastHeight)
{clearInterval(ResizeHeightIntervalID);ResizeContentPanel();}
ResizeHeightLastHeight=topPanelHeight;}
function GetRadWindow()
{var oWindow=null;if(window.radWindow)oWindow=window.radWindow;else if(window.frameElement&&window.frameElement.radWindow)oWindow=window.frameElement.radWindow;return oWindow;}
function CloseRadWindow()
{var oWindow=GetRadWindow();if(oWindow!=null)
oWindow.Close();}
function RefreshRadWindowParent()
{var oWindow=GetRadWindow();if(oWindow!=null&&oWindow.BrowserWindow!=null)
oWindow.BrowserWindow.location.reload();}
