function AddToBookmarks(url, title) {
	window.external.AddFavorite(url,title); 
}

function Cover(bottom, top, ignoreSize) {
    var location = Sys.UI.DomElement.getLocation(bottom);
    top.style.position = 'absolute';
    
    if (!ignoreSize) {
        top.style.height = bottom.offsetHeight + 'px';
        top.style.width = bottom.offsetWidth + 'px';
        top.style.top = location.y + 'px';
        top.style.left = location.x + 20 + 'px';
    } else {
        top.style.top = location.y + 'px';
        top.style.left = location.x + 'px';
    }
}

function validateUserName(text) {
     UserNameAvailabilityChecker.IsUserNameValid(text.value, validateUserNameCmplt);
}

function validateUserNameCmplt(result) {
    if (result)
        usernameOutput.style.display = "none";
    else
        usernameOutput.style.display = "inline";
}

var TRange = null

function findInPage(str) {
    if (str == null || str == '')
        return;

    if (parseInt(navigator.appVersion) < 4)
        return;
    
    var strFound;
    
    if (navigator.appName == 'Netscape') {
        strFound = self.find(str);
    
        if (!strFound) {
            strFound = self.find(str, 0, 1);
            
            while (self.find(str, 0, 1)) continue
        }
    }
    
    if (navigator.appName.indexOf('Microsoft') != -1) {
        if (TRange != null) {
            TRange.collapse(false);
            strFound = TRange.findText(str);
    
            if (strFound)
                TRange.select();
        }
    
        if (TRange == null || strFound == 0) {
            TRange = self.document.body.createTextRange();
            strFound = TRange.findText(str);
            
            if (strFound)
                TRange.select();
        }
    }
    
    if (!strFound)
        alert('String "' + str + '" not found!')
}