	var strColor = null;
	var strSubColor = null;
	var strRowEnter = "#333333";
    var oDrag = false;
    var oClock = null;
    var oClockSep = null;
    var oWindow = null;
    var oSaveControl = null;
    var oDivMenu = null;
    var oFrameMenu = null;
    var oDivSubMenu = null;
    var oFrameSubMenu = null;
    var oHideMenus = null;
    var oHideSubMenus = null;
    var strWidth1 = "";
    var strWidth2 = "";
	function EnablePostBack(boolTop) {
        if (window.parent == null || window.parent == window)
            window.navigate("/__admin/index.aspx");
        boolTop = true;
        if (boolTop == true) {
	        var oMainTool = Get("divToolbar");
	        var oMainFrame = Get("frmToolbar");
            ToolBarOnTop(oMainTool, oMainFrame);
            DHTMLHelp(oMainTool, oMainFrame);
        }
	    document.frmMain.action = '/' + document.frmMain.action;
	}
	function ToolBarOnTop(oMainTool, oMainFrame) {
	    oMainTool.style.posLeft = 0;
	    oMainTool.style.posTop = 0;
	    oMainTool.style.display = "inline";
	    oMainTool.style.removeExpression("height");
	    oMainTool.style.height = "";
//		oMainTool.style.setExpression("left", "scrollLeft-scrollLeft+document.body.scrollLeft", "JavaScript");
		oMainTool.style.setExpression("top", "scrollTop-scrollTop+document.body.scrollTop", "JavaScript");
		oMainTool.style.setExpression("width", "document.body.clientWidth");
//		oMainFrame.style.setExpression("left", "scrollLeft-scrollLeft+document.body.scrollLeft", "JavaScript");
		oMainFrame.style.setExpression("top", "scrollTop-scrollTop+document.body.scrollTop", "JavaScript");
		oMainFrame.style.setExpression("width", "document.body.clientWidth");
	}
	function DHTMLHelp(oMainTool, oMainFrame) {
	    oMainTool.style.zIndex = 100;
        oMainFrame.style.width = oMainTool.offsetWidth;
        oMainFrame.style.height = parseInt(oMainTool.offsetHeight);
        oMainFrame.style.top = oMainTool.style.top;
        oMainFrame.style.left = oMainTool.style.left;
        oMainFrame.style.zIndex = oMainTool.style.zIndex - 1;
        oMainFrame.style.display = "inline";
	}
	function Get(strObject) {
	    var oObject = document.getElementById(strObject);
	    var oFrames = window.top.frames;
	    if (oObject == null && oFrames.length > 0) {
	        for (var ii=0; ii<oFrames.length; ii++) {
	            oObject = oFrames(ii).document.getElementById(strObject);
	            if (oObject != null)
	                break;
	        }
	    }
	    return oObject;
	}
    function AdminMouseOver(oRow) {
	    strColor = oRow.bgColor;
	    oRow.bgColor = strRowEnter;
	    oRow.style.cursor = "hand";
	    oRow.className = "cmwhite";
	    clearTimeout(oHideMenus);
    }
    function AdminMouseOut(oRow) {
	    oRow.bgColor = strColor;
	    oRow.style.cursor = "default";
	    oRow.className = "cmdefault";
	    clearTimeout(oHideMenus);
	    oHideMenus = setTimeout("HideMenus()",1000);
    }
    function StartClock(oControl, strSeparator) {
	    oClock = document.getElementById(oControl);
	    oClockSep = strSeparator;
	    if (oClock != null)
		    StartClock2();
    }
    function StartClock2() {
	    var oDate = new Date();
	    var hours = oDate.getHours();
	    var minutes = oDate.getMinutes();
	    var seconds = oDate.getSeconds();
	    var strTime = oClockSep;
	    strTime += ((hours > 12) ? hours - 12 : hours);
	    strTime += ((minutes < 10) ? ":0" : ":") + minutes;
	    strTime += ((seconds < 10) ? ":0" : ":") + seconds;
	    strTime += (hours >= 12) ? " PM" : " AM";
	    oClock.innerText = strTime;
	    setTimeout("StartClock2()",1000);
    }
    function RefreshParent() {
        window.top.location.reload();
    }
    function overDrag() {
        // tell onOverDrag handler not to do anything:
        window.event.returnValue = false;
    }
    function enterDrag() {
        // allow target object to read clipboard:
        window.event.dataTransfer.getData('Text');
    }
    function onDrop(strPH, oHidden) {
        oHidden = Get(oHidden);
        oHidden.value = strPH + "_" + oDrag.options[oDrag.selectedIndex].value;
        document.forms[0].submit();
    }
    function ShowMenu(oButton, oDiv, intWidth, intHeight) {
        HideMenus();
	    document.detachEvent("onclick", HideMenus);
	    clearTimeout(oHideMenus);
//        ShowSelects(false);
	    oDiv.style.posLeft = findPosX(oButton) - intWidth;
	    oDiv.style.posTop = findPosY(oButton) - intHeight + 25;
	    oDiv.style.display = "inline";
        oDiv.parentElement.removeChild(oDiv);
        document.body.appendChild(oDiv);
	    oFrameMenu = Get("frmHelper");
	    DHTMLHelp(oDiv, oFrameMenu);
	    oDivMenu = oDiv;
        setTimeout("SetHideMenus()",200);
        return false;
    }
    function ShowSubMenu(oDiv, intWidth, intHeight) {
        var oFrame = window.top.GetFrame(0);
        if (parseInt(oDivMenu.style.posLeft) + parseInt(oDivMenu.style.width) > parseInt(oFrame.document.body.clientWidth) - 250) {
	        oDiv.style.posLeft = parseInt(findPosX(oDivMenu)) - parseInt(oDiv.style.width);
	        oDiv.style.posTop = parseInt(findPosY(oDivMenu)) - parseInt(intHeight);
	    }
        else {
	        oDiv.style.posLeft = parseInt(findPosX(oDivMenu)) + parseInt(intWidth);
	        oDiv.style.posTop = parseInt(findPosY(oDivMenu)) - parseInt(intHeight);
        }
	    oDiv.style.display = "inline";
        oDiv.parentElement.removeChild(oDiv);
        document.body.appendChild(oDiv);
	    oFrameSubMenu = Get("frmSubHelper");
	    DHTMLHelp(oDiv, oFrameSubMenu);
	    oDivSubMenu = oDiv;
        setTimeout("SetHideMenus()",200);
        return false;
    }
    function SetHideMenus() {
	    document.attachEvent("onclick", HideMenus);
    }
    function HideMenus() {
	    document.detachEvent("onclick", HideMenus);
	    if (oDivMenu != null)
		    oDivMenu.style.display = "none";
	    if (oDivSubMenu != null)
		    oDivSubMenu.style.display = "none";
	    if (oFrameMenu != null)
		    oFrameMenu.style.display = "none";
	    if (oFrameSubMenu != null)
		    oFrameSubMenu.style.display = "none";
//        ShowSelects(true);
    }
    function HideSubMenu() {
	    if (oDivSubMenu != null)
		    oDivSubMenu.style.display = "none";
	    if (oFrameSubMenu != null)
		    oFrameSubMenu.style.display = "none";
    }
    function OpenWindow(strType, oObject, strVar, boolWindow, strWidth, strHeight) {
	    if (boolWindow == true && oWindow != null && !oWindow.closed)
		    oWindow.close();
		if (oObject != null && oObject != "")
		    oObject = Get(oObject);
        if (strType == "FILEBROWSER") {
            if (boolWindow == false) {
                if (strVar == "")
                    ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/file_browser.aspx?control=" + oObject.id, strWidth, strHeight);
                else
                    ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/file_browser.aspx?control=" + oObject.id + "&location=" + strVar, strWidth, strHeight);
            }
        }
        else if (strType == "INSERTIMAGE") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/image_browser.aspx?type=INSERT&" + strVar, strWidth, strHeight);
        }
        else if (strType == "UPDATEIMAGE") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/image_browser.aspx?type=UPDATE&" + strVar, strWidth, strHeight);
        }
        else if (strType == "INSERTFLAG") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_flag.aspx?type=INSERT&control=" + oObject.id, strWidth, strHeight);
        }
        else if (strType == "IMAGEPATH") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/image_browser.aspx?control=" + strVar + "&type=PATH", strWidth, strHeight);
        }
        else if (strType == "SUPPORTORDER") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/order.aspx?id=" + oObject.value + "&control=" + strVar, strWidth, strHeight);
        }
        else if (strType == "INSERTLINK") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/link_browser.aspx?type=INSERT&" + strVar, strWidth, strHeight);
        }
        else if (strType == "UPDATELINK") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/link_browser.aspx?type=UPDATE&" + strVar, strWidth, strHeight);
        }
        else if (strType == "LINKPATH") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/link_browser.aspx?control=" + strVar + "&type=PATH", strWidth, strHeight);
        }
        else if (strType == "INSERTTABLE") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_table.aspx?type=INSERT&" + strVar, strWidth, strHeight);
        }
        else if (strType == "TABLEROW") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_table_row.aspx" + strVar, strWidth, strHeight);
        }
        else if (strType == "TABLECELL") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_table_cell.aspx" + strVar, strWidth, strHeight);
        }
        else if (strType == "PAGEBROWSER") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/page_browser.aspx?id=" + oObject.value + strVar, strWidth, strHeight);
        }
        else if (strType == "PAGEORDER") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_order.aspx?id=" + oObject.value + "&control=" + strVar, strWidth, strHeight);
        }
        else if (strType == "CONTROLS") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_controls.aspx?id=" + oObject.value + "&type=" + strVar, strWidth, strHeight);
        }
        else if (strType == "PAGECONTROLS") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_controls.aspx?id=" + strVar + "&type=1", strWidth, strHeight);
        }
        else if (strType == "TEMPLATECONTROLS") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_controls.aspx?id=" + strVar + "&type=0", strWidth, strHeight);
        }
        else if (strType == "ROLES") {
            strVar = Get(strVar);
            if (strVar.selectedIndex == 0)
                alert('Please select a role');
            else {
                if (boolWindow == false)
                    ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_roles.aspx?id=" + oObject.value + "&role=" + strVar.options[strVar.selectedIndex].value, strWidth, strHeight);
            }
        }
        else if (strType == "CSS") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_css.aspx?id=" + strVar, strWidth, strHeight);
        }
        else if (strType == "COLOR") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_color.aspx?control=" + strVar, strWidth, strHeight);
        }
        else if (strType == "CALENDAR") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/manage_calendar.aspx?control=" + strVar, strWidth, strHeight);
        }
        else if (strType == "SHARECONTROL") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/share_control.aspx?id=" + strVar, strWidth, strHeight);
        }
        else if (strType == "ALERT") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_alert.aspx?" + strVar, strWidth, strHeight);
        }
        else if (strType == "ROTATOR") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_rotator_control.aspx?id=" + strVar, strWidth, strHeight);
        }
        else if (strType == "SEARCH") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_search.aspx?id=" + strVar, strWidth, strHeight);
        }
        else if (strType == "SITEMAP") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_sitemap.aspx?id=" + strVar, strWidth, strHeight);
        }
        else if (strType == "EDITJOB") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_job.aspx?id=" + strVar, strWidth, strHeight);
        }
        else if (strType == "MANAGEJOB") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_jobs.aspx?id=" + strVar, strWidth, strHeight);
        }
        else if (strType == "EDITLIST") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_list.aspx?id=" + strVar, strWidth, strHeight);
        }
        else if (strType == "MANAGELIST") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_list_items.aspx?id=" + strVar, strWidth, strHeight);
        }
        else if (strType == "COLUMNLIST") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_list_columns.aspx?id=" + strVar, strWidth, strHeight);
        }
        else if (strType == "LOGIN") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_login.aspx?id=" + strVar, strWidth, strHeight);
        }
        else if (strType == "ROTATORS") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_rotator.aspx?id=" + strVar, strWidth, strHeight);
        }
        else if (strType == "DOCUMENTS") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_documents.aspx?id=" + strVar, strWidth, strHeight);
        }
        else if (strType == "DOCUMENT") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_document.aspx?id=" + strVar, strWidth, strHeight);
        }
        else if (strType == "DOCUMENTSSHARED") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_documents_shared.aspx?id=" + strVar, strWidth, strHeight);
        }
        else if (strType == "DOCUMENTSHARED") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_document_shared.aspx?id=" + strVar, strWidth, strHeight);
        }
        else if (strType == "LEFTNAV") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_left_nav.aspx?id=" + strVar, strWidth, strHeight);
        }
        else if (strType == "TOPNAV") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_top_nav.aspx?id=" + strVar, strWidth, strHeight);
        }
        else if (strType == "HTMLSOURCE") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_source.aspx?control=" + oObject.id, strWidth, strHeight);
        }
        else if (strType == "HTML") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/html.aspx?control=" + oObject.id, strWidth, strHeight);
        }
        else if (strType == "HTMLSWEEP") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_sweep.aspx?control=" + oObject.id, strWidth, strHeight);
        }
        else if (strType == "SPELLCHECK") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/spell_check.aspx?control=" + oObject.id, strWidth, strHeight);
        }
        else if (strType == "PROPERTIES") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_properties.aspx?id=" + strVar, strWidth, strHeight);
        }
        else if (strType == "WIZARD") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_wizard.aspx?id=" + strVar, strWidth, strHeight);
        }
        else if (strType == "FORM") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_form.aspx?id=" + strVar, strWidth, strHeight);
        }
        else if (strType == "FORMS") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_form_controls.aspx?id=" + strVar, strWidth, strHeight);
        }
        else if (strType == "FLASH") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_flash.aspx?id=" + strVar, strWidth, strHeight);
        }
        else if (strType == "FLASHITEMS") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_flash_items.aspx?id=" + strVar, strWidth, strHeight);
        }
        else if (strType == "FORMCONTROLS") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_form_control.aspx?id=" + strVar, strWidth, strHeight);
        }
        else if (strType == "IMAGEMENU") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__sscms/manage_image_menu.aspx?id=" + strVar, strWidth, strHeight);
        }
        else if (strType == "CART") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__ssec/manage_cart.aspx?id=" + strVar, strWidth, strHeight);
        }
        else if (strType == "CATEGORYBROWSER") {
            if (boolWindow == false)
                ShowPanel(false, "/__admin/loading.htm?referrer=/__admin/__ssec/category_browser.aspx?id=" + oObject.value + strVar, strWidth, strHeight);
        }
        return false;
    }
    function GetHTML(strControl) {
        strControl = Get(strControl);
        return strControl.innerHTML;
    }
	function GetFrame(_ii) {
	    var oFrames = window.top.frames;
	    if (oFrames.length > 0) {
            for (var ii=0; ii<oFrames.length; ii++) {
                if (_ii == ii)
                    return oFrames(ii);
            }
	    }
	    return null;
	}
    function UpdateWindow(strValue, strControlValue, strText, strControlText) {
        strControlValue = Get(strControlValue);
        strControlValue.value = strValue;
        if (strText != null && strControlText != null) {
            strControlText = Get(strControlText);
            strControlText.innerText = strText;
        }
    }
    function UpdateDiv(strValue, strControl) {
        strControl = Get(strControl);
        strControl.innerHTML = strValue;
        cleanUp(strControl);
    }
    var URL_Host ='http://' + window.location.hostname + '/';
    var URL_Dir = 'http://' + window.location.hostname +  window.location.pathname;
    URL_Dir = URL_Dir.substr(0,URL_Dir.lastIndexOf("/"));
    var URL = window.location.toString();
    function fixurl(strRef)
    {
	    if (strRef.substr(0,URL_Host.length)==URL_Host)
	    {
		    if(strRef.substr(0,URL_Dir.length)==URL_Dir)
		    {
			    if(strRef.substr(0,URL.length)==URL)
				    strRef =  strRef.substr(URL.length);
			    else
				    strRef =  strRef.substr(URL_Dir.length);
		    }
		    else
			    strRef = '/'+ strRef.substr(URL_Host.length);
	    }
	    return strRef; 
    }

    function cleanUp(oObject)
    {
	    for(ii = 0; ii <= oObject.all.tags('A').length -1; ii++) {               
		    oTemp = oObject.all.tags('A').item(ii);
		    oTemp.href= fixurl(oTemp.href);
	    }
	    for(ii = 0; ii <= oObject.all.tags('IMG').length -1; ii++) {               
		    oTemp = oObject.all.tags('IMG').item(ii);
		    oTemp.src = fixurl(oTemp.src);
	    }
    }
	function ShowPanel(boolEnable, strFile, intWidth, intHeight) {
		var oCover = window.top.document.getElementById('divCover');
		var oFrameCover = window.top.document.getElementById('frmCover');
		var oAnchor = window.top.document.getElementById("divAnchor");
		var oDivLeft = window.top.document.getElementById('divLeftMenu');
		var oFrameLeft = window.top.document.getElementById('frmLeftMenu');
		if(oFrameLeft.style.display == "inline")
		{
		    window.top.strFrameWidth2 = intWidth;
		    oDivLeft = window.top.document.getElementById('divLeftMenu2');
		    oFrameLeft = window.top.document.getElementById('frmLeftMenu2');
		}
		else {
		    window.top.strFrameWidth1 = intWidth;
		    window.top.strFrameWidth2 = "";
		}
	    oDivLeft.style.display = "inline";
	    oDivLeft.style.posTop = 0;
	    oFrameLeft.style.posTop = window.top.document.body.scrollTop + 50;
        oDivLeft.style.height = findPosY(oAnchor);
	    oFrameLeft.style.display = "none";
	    oFrameLeft.src = "";
        if (window.top.strFrameWidth2 == "" || (parseInt(window.top.strFrameWidth2) < parseInt(window.top.strFrameWidth1)))
	        oDivLeft.style.width = window.top.strFrameWidth1 + "px";
	    else
	        oDivLeft.style.width = window.top.strFrameWidth2;
        if (boolEnable == false) {
            if (window.top.strFrameWidth2 == "" || (parseInt(window.top.strFrameWidth1) > parseInt(window.top.strFrameWidth2)))
                oCover.style.posLeft = window.top.strFrameWidth1;
            else
    	        oCover.style.posLeft = window.top.strFrameWidth2;
            oCover.style.display = "inline";
            oCover.style.posTop = 0;
            oCover.style.width = '100%';
            oCover.style.height = findPosY(oAnchor);
            DHTMLHelp(oCover, oFrameCover);
        }
	    oFrameLeft.src = strFile;
	    oFrameLeft.style.display = "inline";
        oFrameLeft.style.posLeft = 10;
        oFrameLeft.style.width = (intWidth - 20) + "px";
        var intWindowHeight = (window.top.document.body.clientHeight);
        if ((intWindowHeight - 50) > intHeight)
            oFrameLeft.style.height = intHeight + "px";
        else
            oFrameLeft.style.height = (intWindowHeight - 100) + "px";
		return false;
	}
	function HidePanel() {
		var oCover = window.top.document.getElementById('divCover');
		var oFrameCover = window.top.document.getElementById('frmCover');
		var oDivLeft = window.top.document.getElementById('divLeftMenu2');
		var oFrameLeft = window.top.document.getElementById('frmLeftMenu2');
		if(oFrameLeft.style.display == "none")
		{
		    oDivLeft = window.top.document.getElementById('divLeftMenu');
		    oFrameLeft = window.top.document.getElementById('frmLeftMenu');
    		oCover.style.display = "none";
            oFrameCover.style.display = "none";
		}
		else
		{
		    if (oCover.style.display == "inline") {
                if (parseInt(window.top.strFrameWidth2) > parseInt(window.top.strFrameWidth1))
                    oCover.style.posLeft = window.top.strFrameWidth1;
		    }
		}
		oFrameLeft.src = "";
		oFrameLeft.style.display = "none";
		oDivLeft.style.width = "0px";
		oDivLeft.style.display = "none";
		return false;
	}
    function findPosX(obj)
    {
	    var curleft = 0;
	    if (obj.offsetParent)
	    {
		    while (obj.offsetParent)
		    {
			    curleft += obj.offsetLeft
			    obj = obj.offsetParent;
		    }
	    }
	    else if (obj.x)
		    curleft += obj.x;
	    return curleft;
    }
    function findWidth(obj)
    {
	    var curleft = 0;
	    if (obj.offsetParent)
	    {
		    while (obj.offsetParent && curleft == 0)
		    {
			    curleft += obj.offsetWidth
			    obj = obj.offsetParent;
		    }
	    }
	    return curleft;
    }
    function findPosY(obj)
    {
	    var curtop = 0;
	    if (obj.offsetParent)
	    {
		    while (obj.offsetParent)
		    {
			    curtop += obj.offsetTop
			    obj = obj.offsetParent;
		    }
	    }
	    else if (obj.y)
		    curtop += obj.y;
	    return curtop;
    }
    function ApproveAll_(strPath) {
        if (oEditing == null) {
            if (confirm('Are you sure you want to approve all of the controls on this page?') == true) {
                strPath += "&type=APPROVE";
                oxml = new ActiveXObject("Microsoft.XMLHTTP");
                oxml.onreadystatechange = ApproveAll_ajax;
                oxml.open("POST", strPath, false);
                oxml.send(null);
	        }
	    }
	    else
            alert('You are currently editing an HTML control on this page.\n\nPlease Save or Cancel your changes before you continue...');
    }
    function ApproveAll_ajax() {
        if (oxml.readyState == 4)
        {
            if (oxml.status == 200) {
                alert('All controls have been approved!');
                window.location.reload();
            }
            else 
                alert('AJAX Error');
        }
    }
    function Publish_(strPath, strPublish) {
        strPath += "&type=PUBLISH";
        oxml = new ActiveXObject("Microsoft.XMLHTTP");
        oxml.onreadystatechange = Publish_ajax;
        oxml.open("POST", strPath, false);
        oxml.send("<ajax>" + strPublish + "</ajax>");
        return false;
    }
    function Publish_ajax() {
        if (oxml.readyState == 4)
        {
            if (oxml.status == 200) {
                alert('The page has been updated!');
                window.location.reload();
            }
            else 
                alert('AJAX Error');
        }
    }
    function Start_(strPath) {
        if (confirm('Are you sure you want to change the start page for this website?') == true) {
            strPath += "&type=START";
            oxml = new ActiveXObject("Microsoft.XMLHTTP");
            oxml.onreadystatechange = Publish_ajax;
            oxml.open("POST", strPath, false);
            oxml.send(null);
        }
        return false;
    }
    function AddPageSchema(intPId, intSchema, strPath) {
        if (confirm('Are you sure you want to replace the current control with this new control?') == true) {
            strPath += "&type=ADDPAGE";
            oxml = new ActiveXObject("Microsoft.XMLHTTP");
            oxml.onreadystatechange = AddSchema_ajax;
            oxml.open("POST", strPath, false);
            oxml.send("<ajax><page>" + intPId + "</page><schema>" + intSchema + "</schema></ajax>");
        }
    }
    function AddSchema_ajax() {
        if (oxml.readyState == 4)
        {
            if (oxml.status == 200) {
                window.location.reload();
            }
            else 
                alert('AJAX Error');
        }
    }
    function AddTemplateSchema(intTId, intSchema, strPath) {
        if (confirm('Are you sure you want to replace the current control with this new control?') == true) {
            strPath += "&type=ADDTEMPLATE";
            oxml = new ActiveXObject("Microsoft.XMLHTTP");
            oxml.onreadystatechange = AddSchema_ajax;
            oxml.open("POST", strPath, false);
            oxml.send("<ajax><template>" + intTId + "</template><schema>" + intSchema + "</schema></ajax>");
        }
    }
	function ShowSelects(bool) {
		var oChildren = document.body.all.tags("SELECT");
		for (ii=0; ii<oChildren.length; ii++) {
			if (bool)
				oChildren(ii).style.visibility = "visible";
			else
				oChildren(ii).style.visibility = "hidden";
		}
	}
	function Preview(oText) {
	    oText = Get(oText);
        try {
            if (oText.value.substring("?") > -1)
                window.open(oText.value + "&preview=true");
            else
                window.open(oText.value + "?preview=true");
        }
        catch(e) {
            alert('There was a problem previewing the page');
        }
        return false;
	}
	function TopMenuSwitch(oElement, strClass) {
		oElement.className = strClass;
		if (oElement != null && oElement.children.length > 0) {
    			for (var ii=0; ii<oElement.children.length; ii++) {
                		TopMenuSwitch(oElement.children(ii), strClass);
	    		}
        	}
	}
	function ShowHideMain(oS, oH1, oH2, oH3, oT) {
	    oS.style.display = "inline";
	    oH1.style.display = "none";
	    oH2.style.display = "none";
	    oH3.style.display = "none";
        setCookie("menu_tab", oT, 30);
	    return false;
	}
    function MM_swapImgRestore() {var i,x,a=document.MM_sr;for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;}
    function MM_preloadImages() {var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)if (a[i].indexOf('#')!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}}
    function MM_findObj(n, d) {var p,i,x;  if(!d) d=document; if((p=n.indexOf('?'))>0&&parent.frames.length) {d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);if(!x && d.getElementById) x=d.getElementById(n); return x;}
    function MM_swapImage() {var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}}
    function MM_openBrWindow(theURL,winName,features) {window.open(theURL,winName,features);}
    function setCookie(name, value, expires, path, domain, secure)
    {
        if (expires != null) {
            var today = new Date();
            today.setTime( today.getTime() );
            expires = new Date( today.getTime() + (expires * 1000 * 60 * 60 * 24));
        }
	    document.cookie= name + "=" + escape(value) +
		    ((expires) ? "; expires=" + expires.toGMTString() : "") +
		    ((path) ? "; path=" + path : "") +
		    ((domain) ? "; domain=" + domain : "") +
		    ((secure) ? "; secure" : "");
    }
    function getCookie(name)
    {
	    var dc = document.cookie;
	    var prefix = name + "=";
	    var begin = dc.indexOf("; " + prefix);
	    if (begin == -1) {
		    begin = dc.indexOf(prefix);
		    if (begin != 0) return null;
	    }
	    else
		    begin += 2;
	    var end = document.cookie.indexOf(";", begin);
	    if (end == -1)
		    end = dc.length;
	    return unescape(dc.substring(begin + prefix.length, end));
    }
    var oLocation;
    function DoSearch(oButton, strLocation)
    {
        var oText = document.getElementById("txtSearch0101");
        if (oText.value == "") {
            alert('Please enter some text to search');
            oText.focus();
            return false;
        }
        oLocation = strLocation + oText.value;
	    setTimeout("DoSearch2()",100);
    }
    function DoSearch2() {
        window.navigate(oLocation);
    }
    function CheckSearch(oText) {
        var oButton = document.getElementById("btnSearch0101");
        if(event.which || event.keyCode){
            if ((event.which == 13) || (event.keyCode == 13)) {
                oButton.click();
                return false;
            }
        }
        else {
            return true;
        }
    }
