var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
		    string: navigator.userAgent,
		    subString: "Chrome",
		    identity: "Chrome"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();

var LoginRetries = 0;
var loginRetriesAllowed = 3;
var usercontrolpath = "";
var WindowObjectReference = null; // window handle for openRequestedWindow strWindowName parameter
var EditorTemplateSelectorDiv = "";
var EditorTemplateVisible = 'true';
var PageTemplateVisible = 'true';

function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
  var rv = -1; // Return value assumes failure.
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}

//check version of IE6
function checkInternetExporerVersion()
{
  var msg = "You're not using Internet Explorer.";
  var ver = getInternetExplorerVersion();

  if ( ver > -1 )
  {
    if ( ver <= 6.0 ) 
    {
      msg = "You're using a recent copy of Internet Explorer."
      return true;
    }
    else
	{
      msg = "You should upgrade your copy of Internet Explorer.";
      return false;
    }
  }
  
}

//find element by name
function findElementbyUploadControl(name)
{
    var elems = document.getElementsByTagName('*'); 
    var num = elems.length; 
    for(var c=0;c<num;c++)
    {
        var val = elems[c].getAttribute('uploadcontrol'); 
        if(val!=null && val==name)
            return elems[c]; 
    }
}


function openRequestedWindow(strUrl, strWindowName, widthValue, heightValue)
{
  var x = 0, y = 0, w = 0, h = 0; // default values

  if (document.all) {
    x = window.screenTop;
    y = window.screenLeft;
  }
  else if (document.layers) {
    x = window.screen.left;
    y = window.screen.top;
  }
    var paramSet = false;
    var w = 630, h = 460;
    if (typeof widthValue != "undefined") {
        paramSet = true;
        w = widthValue;
    }
    if (typeof heightValue != "undefined") {
        paramSet = true;
        h = heightValue;
    }

    if ( paramSet == false ){
       if (parseInt(navigator.appVersion)>3) {
         if (navigator.appName=="Netscape") {
           w = window.screen.width/2;
           h = window.screen.height/2;
         }
         if (navigator.appName.indexOf("Microsoft")!=-1) {
           w = window.screen.width/2;
           h = window.screen.height/2;
         }
       }
    }


  if(WindowObjectReference == null || WindowObjectReference.closed)
  {
     WindowObjectReference = window.open(strUrl, strWindowName,
         'resizable=yes,scrollbars=yes,status=yes,width='+w+',height='+h+',screenX='+x+',screenY='+y+',top='+y+',left='+x+'');
     //WindowObjectReference.resizeTo(w,h);    
     //WindowObjectReference.moveTo(x,y);
     WindowObjectReference.focus();
  }
  else
  {
     WindowObjectReference.focus();
  }
}

function GeneralValidateEmail(ControlToValidate,emailerrorflag)
{
   	var theEmailAddress = ControlToValidate.value;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(theEmailAddress))
	{
        //make control white
        ControlToValidate.style.backgroundColor="white";
        toggleLayerOffNormalBackground(emailerrorflag);  
	}
	else
	{
	    ControlToValidate.style.backgroundColor="yellow";
	}

}	
function GeneralValidatePassword(ControlToValidate, passworderrorflag)
{
    var password = ControlToValidate.value;
    if (password.length >=0 && password.length < 5)
    {
	    ControlToValidate.style.backgroundColor="yellow";
    }
    else
    {
	    ControlToValidate.style.backgroundColor="white";
   	    toggleLayerOffNormalBackground(passworderrorflag);
    }
}
function GeneralClearField(ControlToValidate, errorflag)
{
    ControlToValidate.value = "";
	if(errorflag != "" && errorflag != null)
	{
    	toggleLayerOffNormalBackground(errorflag);
    }
}
function GeneralTabtoNextField(jevent,uctrlid,nextfield)
{
    var field = $get(uctrlid + nextfield);
    if(field != null)
    {
        if(event.which || event.keyCode)
        {
            if ((jevent.which == 9) || (jevent.keyCode == 9)) 
            {
                field.focus();
            }
        }
    } 
}
function GeneralDisableEnableHeader(disabled)
{
        var headerlogin = $get("ctl00_LandingPageHeader1_btnHeaderLogin");
        var headerlogout = $get("ctl00_LandingPageHeader1_btnHeaderLogout");
        var headersearchtext = $get("ctl00_LandingPageHeader1_txtSearch");
        var headersearchbtn = $get("ctl00_LandingPageHeader1_btnHeaderSearch");
        var btnsignup = $get("ctl00_ContentPlaceHolder1_btnSignUp");
        
        if(headerlogin != null)
                headerlogin.disabled = disabled;
        
        if(headerlogout != null)
            headerlogout.disabled = disabled;

        if(headersearchtext != null)
            headersearchtext.disabled = disabled;
            
        if(headersearchbtn != null)
            headersearchbtn.disabled = disabled;

        if(btnsignup != null)
            btnsignup.disabled = disabled;

}
function GeneralDisableEnableForm(disabled,excludepath){
        objElems = document.all;
        cname = -1;
        for(i=0;i<objElems.length;i++)
        {
          if(objElems[i].type == 'button' || objElems[i].type == 'image' || objElems[i].type == 'text')
          {
              if(objElems.id != null)
              {
                    cname = objElems.id.indexOf(excludepath);
                    if(cname > -1)
                    {
                      objElems[i].disabled = disabled;
                    }
              }
          }
        }
}
//Returns array elements of a specific type
//usage: var DropdownsArray = GetElementsByType('select-one'); returns all dropdownlists on a page
function GetElementsByType(searchType) {
	var typeElements = new Array();	
	var elements = document.getElementsByTagName('*');
	var elementsLen = elements.length;
	var pattern = new RegExp('(^|\\s)'+searchType+'(\\s|$)');
	for (i = 0, j = 0; i < elementsLen; i++) {
		if ( pattern.test(elements[i].type) ) {
			typeElements[j] = elements[i];
			j++;
		}
	}
	return typeElements;
}

//Returns array elements of a specific type within a container
//usage: var DropdownsArray = GetElementsByType('select-one', 'contentsContainer'); 
//          returns all dropdownlists within the div "contentsContainer"
function GetChildElementsByType(searchType, containerId) 
{
    var elements = document.getElementById(containerId).childNodes;
  	var typeElements = new Array();	
	var elementsLen = elements.length;
	var pattern = new RegExp('(^|\\s)'+searchType+'(\\s|$)');
	for (i = 0, j = 0; i < elementsLen; i++) {
		if ( pattern.test(elements[i].type) ) {
			typeElements[j] = elements[i];
			j++;
		}
	}
	return typeElements;
}

function OpenLoginMenu(uctrlid)
{   
        //disable header controls while in popup
        GeneralDisableEnableHeader(true);
        usercontrolpath = uctrlid;
        toggleLayer('LoginToFalcon');
        var userName = $get(usercontrolpath + "loginemail");
        if(userName != null)
            userName.focus();
}
function OpenUserAgreementMenu()
{
        toggleLayer('UserAgreement');
        var checkbox = $get(usercontrolpath + "chkAgree");
        if(checkbox != null)
            checkbox.checked = false;
}
function OpenCreateNewProject(uctrlid)
{   
        //disable header controls while in popup
        GeneralDisableEnableHeader(true);
        usercontrolpath = uctrlid;
        toggleLayer('CreateNewProjectWizardPopup');
}

function FalconLoginUser(uctrlpath)
{
    var email = null;
    var password = null;
    email = $get(usercontrolpath + "loginemail").value;
    password = $get(usercontrolpath + "loginpassword").value;
    if(email == null)
    {
        email = "";
    }
    if(password == null)
    {
        password = "";
    }
    
    var rememberme = $get(usercontrolpath + "chkRememberMe");
    Sys.Services.AuthenticationService.login(email,password, false, null,'Dashboard.aspx', OnWSLoginRequestComplete, onWSLoginError);
}
function OnWSLoginRequestComplete(validCredentials, userContext, methodName)
{
    var email = $get(usercontrolpath + "loginemail").value;
    var password = $get(usercontrolpath + "loginpassword").value;
    if (validCredentials == true)
    {
        toggleLayer('LoginToFalcon');

        GeneralClearField(email, 'emailerrorLogin');
        GeneralClearField(password, 'passworderrorLogin');
        GeneralDisableEnableHeader(false);
    }
    else
    {
        LoginRetries++;
        if (LoginRetries >= loginRetriesAllowed)
        {
            GeneralClearField(email, 'emailerrorLogin');
            GeneralClearField(password, 'passworderrorLogin');
            toggleLayertoNextForm('LoginToFalcon','LoginPopupLimit');
        }
        else
        {
            toggleLayerOnNormalBackground('emailerrorLogin');  
            toggleLayerOnNormalBackground('passworderrorLogin');
        }
    }
}

function onWSLoginError(error, userContext, methodName)
{
    alert("Login Error " + userContext);
}



function toggleLayer( whichLayer )
{  
	var elem, vis;  
	if( document.getElementById ) // this is the way the standards work    
		elem = document.getElementById( whichLayer );  
	else if( document.all ) // this is the way old msie versions work      
		elem = document.all[whichLayer];  
	else if( document.layers ) // this is the way nn4 works    
		elem = document.layers[whichLayer];  
		vis = elem.style;  
	// if the style.display value is blank we try to figure it out here  
	if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)    
		vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';  
		vis.display = (vis.display==''||vis.display=='block')?'none':'block';
		
	toggleDimBackground();	
}
function toggleLayerNormalBackground( whichLayer )
{  
	var elem, vis;  
	if( document.getElementById ) // this is the way the standards work   
	 {
        elem = document.getElementById(whichLayer);
	 }
	else if( document.all ) // this is the way old msie versions work      
		elem = document.all[whichLayer];  
	else if( document.layers ) // this is the way nn4 works    
		elem = document.layers[whichLayer];  
		vis = elem.style;  
	// if the style.display value is blank we try to figure it out here  
	if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)    
		vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';  
		vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}
function toggleLayerOffNormalBackground( whichLayer )
{  
	var elem, vis;  
	if( document.getElementById ) // this is the way the standards work    
		elem = document.getElementById( whichLayer );  
	else if( document.all ) // this is the way old msie versions work      
		elem = document.all[whichLayer];  
	else if( document.layers ) // this is the way nn4 works    
		elem = document.layers[whichLayer];  
		vis = elem.style;  
	// if the style.display value is blank we try to figure it out here  
	if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)    
		vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'none':'none';  
		vis.display = (vis.display==''||vis.display=='block')?'none':'none';
}
function toggleLayerOnNormalBackground( whichLayer )
{  
	var elem, vis;  
	if( document.getElementById ) // this is the way the standards work    
		elem = document.getElementById( whichLayer );  
	else if( document.all ) // this is the way old msie versions work      
		elem = document.all[whichLayer];  
	else if( document.layers ) // this is the way nn4 works    
		elem = document.layers[whichLayer];  
		vis = elem.style;  
	// if the style.display value is blank we try to figure it out here  
	if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)    
		vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'block';  
		vis.display = (vis.display==''||vis.display=='block')?'block':'block';
}
function toggleLayertoNextForm( whichLayer, nextform )
{  
	var elem, vis;  
	if( document.getElementById ) // this is the way the standards work    
		elem = document.getElementById( whichLayer );  
	else if( document.all ) // this is the way old msie versions work      
		elem = document.all[whichLayer];  
	else if( document.layers ) // this is the way nn4 works    
		elem = document.layers[whichLayer];  
		vis = elem.style;  
	// if the style.display value is blank we try to figure it out here  
	if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)    
		vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';  
		vis.display = (vis.display==''||vis.display=='block')?'none':'block';
		
	whichLayer = nextform;
	if( document.getElementById ) // this is the way the standards work    
		elem = document.getElementById( whichLayer );  
	else if( document.all ) // this is the way old msie versions work      
		elem = document.all[whichLayer];  
	else if( document.layers ) // this is the way nn4 works    
		elem = document.layers[whichLayer];  
		vis = elem.style;  
	// if the style.display value is blank we try to figure it out here  
	if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)    
		vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';  
		vis.display = (vis.display==''||vis.display=='block')?'none':'block';
	
}
function toggleDimBackground()
{     
}

function ToggleElementVisibility(objectToToggle) 
{
	var element = document.getElementById(objectToToggle);
	if ( element.style.display != 'none' ) 
	{
		element.style.display = 'none';
	}
	else 
	{
		element.style.display = '';
	}
}

//Specifically set visibility of an element to visible
function ShowElement(objectToShow) 
{
	var element = document.getElementById(objectToShow);
	element.style.display = '';
}

//Specifically set visibility of an element to hidden
function HideElement(objectToHide) 
{
	var element = document.getElementById(objectToHide);
	element.style.display = 'none';
}

function MM_swapImgRestore() { //v3.0
  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_swapImage() { //v3.0
  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_preloadImages() { //v3.0
  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) { //v4.01
  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 SetControlStyleInvalid(control)
{
    control.style.backgroundColor="yellow";  
}

function SetControlStyleValid(control)
{
    control.style.backgroundColor="white";  
}

//clientid of the page navigation panel div
//that is initialized in PageNavigationPanel.cs
var PageNavigationPanelDiv;
//clientid of the Template Selection panel div
//that is initialized in TemplateSelectionPanel.cs
var TemplatePanelDiv;

function ShowPopup(hoveritem)
{
    if(hoveritem == PageNavigationPanelDiv)
    {
        EditorTemplateVisible = 'true';
	    hp = document.getElementById(hoveritem);
	    hp.style.visibility = "Visible";
	    
	    PageTemplateVisible = 'false';
	    hp = document.getElementById(TemplatePanelDiv);
	    hp.style.visibility = "Hidden";	
	    
    }
    if(hoveritem == TemplatePanelDiv)
    {
        EditorTemplateVisible = 'true';
	    hp = document.getElementById(hoveritem);
	    hp.style.visibility = "Visible";
	    
	    PageTemplateVisible = 'false';
	    hp = document.getElementById(PageNavigationPanelDiv);
	    if(hp != null)
	    {
	        hp.style.visibility = "Hidden";	
	    }
    }
    
}

function HideControl(DivID)
{
    hp = document.getElementById(DivID);
	hp.style.visibility = "Hidden";	
}
function ShowControl(DivID)
{
    hp = document.getElementById(DivID);
	hp.style.visibility = "Visible";	
}

function ShowRadWindow(clientID, navUrl)
{
    var radWindow = $find(clientID);
    if (navUrl != null && navUrl != "")
    {
        radWindow.setUrl(navUrl);
    }
    radWindow.show();
}


//function to parse the url for querystring and return array.

function getQueryString ()
{
 var pos = String (document.location).indexOf('?');
 var q = '';
 if (pos != -1)
 {
    q = String (document.location).substring(pos + 1);
    if (!q) 
        return '';
 }
 return String(q);
}

// Sends user to given URL and appends a ReturnUrl if there was one in the querystring
function goToUrlAppendReturnUrl(url)
{
    var queryString = getQueryString();
    if (queryString != '')
    {
        window.location = url + '?' + queryString;
    }
    else
    {
        window.location = url;
    }
}

String.prototype.trim = function()
{ 
    return this.replace(/^\s+|\s+$/g,'');
}

//Moved from master.Master
function Menu() {

    if (navigator.appVersion.indexOf("MSIE") == -1) {
        return;
    }
    var i, k, g, lg, r = /\s*hvr/, nn = '', c, cs = 'hvr', bv = 'PrimaryNavigation';
    for (i = 0; i < 10; i++) {
        g = document.getElementById(bv + nn); if (g) {
            lg = g.getElementsByTagName("li");
            if (lg) {
                for (k = 0; k < lg.length; k++) {
                    lg[k].onmouseover = function() {
                        c = this.className;
                        cl = (c) ? c + ' ' + cs : cs;
                        this.className = cl;
                    };
                    lg[k].onmouseout = function() {
                        c = this.className;
                        this.className = (c) ? c.replace(r, '') : '';
                    };
                }
            }
        } nn = i + 1;
    }
}
//End Moved from master.Master


//Moved from UserWelcomeMenu.ascx
        function OpenHelpWindow(windowUrl) {
            window.open(windowUrl, "_blank");
        }

        function HideFlash() {
            var aEmbeds = document.getElementsByTagName("embed");
            for (i = 0; i < aEmbeds.length; i++) {
                if (aEmbeds[i].type.match('flash') != null) {
                    aEmbeds[i].hide();
                }
            }

            var aObjects = document.getElementsByTagName("object");
            for (i = 0; i < aObjects.length; i++) {
                if (aObjects[i].codeBase.match('swflash') != null) {
                    aObjects[i].style.display = "none";
                }
            }
        }
        function ShowFlash() {
            var aEmbeds = document.getElementsByTagName("embed");
            for (i = 0; i < aEmbeds.length; i++) {
                if (aEmbeds[i].type.match('flash') != null) {
                    aEmbeds[i].show();
                }
            }

            var aObjects = document.getElementsByTagName("object");
            for (i = 0; i < aObjects.length; i++) {
                if (aObjects[i].codeBase.match('swflash') != null) {
                    aObjects[i].style.display = "";
                }
            }
        }

        var returnUrl = '';

        //Used premultiple product support
        function CreatePhotoBookSignIn(themeCategoryId) {
            CreatePhotoBookSignIn(themeCategoryId, null);
        }

        //Used premultiple product support                                
        function CreatePhotoBookSignUp(themeCategoryId) {
            CreatePhotoBookSignUp(themeCategoryId, null);
        }

        function CreatePhotoBookSignIn(themeCategoryId, productTypeId) {
            if (productTypeId == null) {
                productTypeId = "1";
            }

            returnUrl = '/themes/inkubookdefault/Inkubook/Photobook/CreateProject.aspx?ThemeCategoryID=' + themeCategoryId + "&ProductTypeID=" + productTypeId;
            escapedReturnUrlQuerystring
                                = 'ReturnUrl=%2fthemes%2finkubookdefault%2fInkubook%2fPhotobook%2fCreateProject.aspx%3fThemeCategoryID%3d' + themeCategoryId +
                                    '%26ProductTypeID%3d' + productTypeId;
         
            //JustGo Set in UserWelcomMenu.ascx
            if (JustGo) {
                window.location = returnUrl;
            }
            else {
                window.location = '/Themes/InkubookDefault/Common/login.aspx?' + escapedReturnUrlQuerystring;
            }
        }

        function CreatePhotoBookSignUp(themeCategoryId, productTypeId) {
            if (productTypeId == null) {
                productTypeId = "1";
            }

            returnUrl = '/themes/inkubookdefault/Inkubook/Photobook/CreateProject.aspx?ThemeCategoryID=' + themeCategoryId + "&ProductTypeID=" + productTypeId; ;
            escapedReturnUrlQuerystring
                                = 'ReturnUrl=%2fthemes%2finkubookdefault%2fInkubook%2fPhotobook%2fCreateProject.aspx%3fThemeCategoryID%3d' + themeCategoryId +
                                    '%26ProductTypeID%3d' + productTypeId;
            
            //JustGo Set in UserWelcomMenu.ascx
            if (JustGo) {
                window.location = returnUrl;
            }
            else {
                window.location = '/themes/InkubookDefault/user/createuser.aspx?' + escapedReturnUrlQuerystring;
            }
        }

        function ShowLogin() {
            window.location = '/themes/inkubookdefault/common/login.aspx';
        }

        //End Moved from UserWelcomeMenu.ascx

        function SlideDivOpen() {
            $("OptionsFlyout").show(1000);
            

        }
        function SlideDivClose() {
            $("OptionsFlyout").hide("blind", { direction: "horizontal" }, 1000);

        }        
