/**--1--**/
function WebForm_PostBackOptions(eventTarget, eventArgument, validation, validationGroup, actionUrl, trackFocus, clientSubmit) {
    this.eventTarget = eventTarget;
    this.eventArgument = eventArgument;
    this.validation = validation;
    this.validationGroup = validationGroup;
    this.actionUrl = actionUrl;
    this.trackFocus = trackFocus;
    this.clientSubmit = clientSubmit;
}
function WebForm_DoPostBackWithOptions(options) {
    var validationResult = true;
    if (options.validation) {
        if (typeof(Page_ClientValidate) == 'function') {
            validationResult = Page_ClientValidate(options.validationGroup);
        }
    }
    if (validationResult) {
        if ((typeof(options.actionUrl) != "undefined") && (options.actionUrl != null) && (options.actionUrl.length > 0)) {
            theForm.action = options.actionUrl;
        }
        if (options.trackFocus) {
            var lastFocus = theForm.elements["__LASTFOCUS"];
            if ((typeof(lastFocus) != "undefined") && (lastFocus != null)) {
                if (typeof(document.activeElement) == "undefined") {
                    lastFocus.value = options.eventTarget;
                }
                else {
                    var active = document.activeElement;
                    if ((typeof(active) != "undefined") && (active != null)) {
                        if ((typeof(active.id) != "undefined") && (active.id != null) && (active.id.length > 0)) {
                            lastFocus.value = active.id;
                        }
                        else if (typeof(active.name) != "undefined") {
                            lastFocus.value = active.name;
                        }
                    }
                }
            }
        }
    }
    if (options.clientSubmit) {
        __doPostBack(options.eventTarget, options.eventArgument);
    }
}
var __pendingCallbacks = new Array();
var __synchronousCallBackIndex = -1;
function WebForm_DoCallback(eventTarget, eventArgument, eventCallback, context, errorCallback, useAsync) {
    var postData = __theFormPostData +
                "__CALLBACKID=" + WebForm_EncodeCallback(eventTarget) +
                "&__CALLBACKPARAM=" + WebForm_EncodeCallback(eventArgument);
    if (theForm["__EVENTVALIDATION"]) {
        postData += "&__EVENTVALIDATION=" + WebForm_EncodeCallback(theForm["__EVENTVALIDATION"].value);
    }
    var xmlRequest,e;
    try {
        xmlRequest = new XMLHttpRequest();
    }
    catch(e) {
        try {
            xmlRequest = new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch(e) {
        }
    }
    var setRequestHeaderMethodExists = true;
    try {
        setRequestHeaderMethodExists = (xmlRequest && xmlRequest.setRequestHeader);
    }
    catch(e) {}
    var callback = new Object();
    callback.eventCallback = eventCallback;
    callback.context = context;
    callback.errorCallback = errorCallback;
    callback.async = useAsync;
    var callbackIndex = WebForm_FillFirstAvailableSlot(__pendingCallbacks, callback);
    if (!useAsync) {
        if (__synchronousCallBackIndex != -1) {
            __pendingCallbacks[__synchronousCallBackIndex] = null;
        }
        __synchronousCallBackIndex = callbackIndex;
    }
    if (setRequestHeaderMethodExists) {
        xmlRequest.onreadystatechange = WebForm_CallbackComplete;
        callback.xmlRequest = xmlRequest;
        xmlRequest.open("POST", theForm.action, true);
        xmlRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
        xmlRequest.send(postData);
        return;
    }
    callback.xmlRequest = new Object();
    var callbackFrameID = "__CALLBACKFRAME" + callbackIndex;
    var xmlRequestFrame = document.frames[callbackFrameID];
    if (!xmlRequestFrame) {
        xmlRequestFrame = document.createElement("IFRAME");
        xmlRequestFrame.width = "1";
        xmlRequestFrame.height = "1";
        xmlRequestFrame.frameBorder = "0";
        xmlRequestFrame.id = callbackFrameID;
        xmlRequestFrame.name = callbackFrameID;
        xmlRequestFrame.style.position = "absolute";
        xmlRequestFrame.style.top = "-100px"
        xmlRequestFrame.style.left = "-100px";
        try {
            if (callBackFrameUrl) {
                xmlRequestFrame.src = callBackFrameUrl;
            }
        }
        catch(e) {}
        document.body.appendChild(xmlRequestFrame);
    }
    var interval = window.setInterval(function() {
        xmlRequestFrame = document.frames[callbackFrameID];
        if (xmlRequestFrame && xmlRequestFrame.document) {
            window.clearInterval(interval);
            xmlRequestFrame.document.write("");
            xmlRequestFrame.document.close();
            xmlRequestFrame.document.write('<html><body><form method="post"><input type="hidden" name="__CALLBACKLOADSCRIPT" value="t"></form></body></html>');
            xmlRequestFrame.document.close();
            xmlRequestFrame.document.forms[0].action = theForm.action;
            var count = __theFormPostCollection.length;
            var element;
            for (var i = 0; i < count; i++) {
                element = __theFormPostCollection[i];
                if (element) {
                    var fieldElement = xmlRequestFrame.document.createElement("INPUT");
                    fieldElement.type = "hidden";
                    fieldElement.name = element.name;
                    fieldElement.value = element.value;
                    xmlRequestFrame.document.forms[0].appendChild(fieldElement);
                }
            }
            var callbackIdFieldElement = xmlRequestFrame.document.createElement("INPUT");
            callbackIdFieldElement.type = "hidden";
            callbackIdFieldElement.name = "__CALLBACKID";
            callbackIdFieldElement.value = eventTarget;
            xmlRequestFrame.document.forms[0].appendChild(callbackIdFieldElement);
            var callbackParamFieldElement = xmlRequestFrame.document.createElement("INPUT");
            callbackParamFieldElement.type = "hidden";
            callbackParamFieldElement.name = "__CALLBACKPARAM";
            callbackParamFieldElement.value = eventArgument;
            xmlRequestFrame.document.forms[0].appendChild(callbackParamFieldElement);
            if (theForm["__EVENTVALIDATION"]) {
                var callbackValidationFieldElement = xmlRequestFrame.document.createElement("INPUT");
                callbackValidationFieldElement.type = "hidden";
                callbackValidationFieldElement.name = "__EVENTVALIDATION";
                callbackValidationFieldElement.value = theForm["__EVENTVALIDATION"].value;
                xmlRequestFrame.document.forms[0].appendChild(callbackValidationFieldElement);
            }
            var callbackIndexFieldElement = xmlRequestFrame.document.createElement("INPUT");
            callbackIndexFieldElement.type = "hidden";
            callbackIndexFieldElement.name = "__CALLBACKINDEX";
            callbackIndexFieldElement.value = callbackIndex;
            xmlRequestFrame.document.forms[0].appendChild(callbackIndexFieldElement);
            xmlRequestFrame.document.forms[0].submit();
        }
    }, 10);
}
function WebForm_CallbackComplete() {
    for (i = 0; i < __pendingCallbacks.length; i++) {
        callbackObject = __pendingCallbacks[i];
        if (callbackObject && callbackObject.xmlRequest && (callbackObject.xmlRequest.readyState == 4)) {
            WebForm_ExecuteCallback(callbackObject);
            if (!__pendingCallbacks[i].async) {
                __synchronousCallBackIndex = -1;
            }
            __pendingCallbacks[i] = null;
            var callbackFrameID = "__CALLBACKFRAME" + i;
            var xmlRequestFrame = document.getElementById(callbackFrameID);
            if (xmlRequestFrame) {
                xmlRequestFrame.parentNode.removeChild(xmlRequestFrame);
            }
        }
    }
}
function WebForm_ExecuteCallback(callbackObject) {
    var response = callbackObject.xmlRequest.responseText;
    if (response.charAt(0) == "s") {
        if ((typeof(callbackObject.eventCallback) != "undefined") && (callbackObject.eventCallback != null)) {
            callbackObject.eventCallback(response.substring(1), callbackObject.context);
        }
    }
    else if (response.charAt(0) == "e") {
        if ((typeof(callbackObject.errorCallback) != "undefined") && (callbackObject.errorCallback != null)) {
            callbackObject.errorCallback(response.substring(1), callbackObject.context);
        }
    }
    else {
        var separatorIndex = response.indexOf("|");
        if (separatorIndex != -1) {
            var validationFieldLength = parseInt(response.substring(0, separatorIndex));
            if (!isNaN(validationFieldLength)) {
                var validationField = response.substring(separatorIndex + 1, separatorIndex + validationFieldLength + 1);
                if (validationField != "") {
                    var validationFieldElement = theForm["__EVENTVALIDATION"];
                    if (!validationFieldElement) {
                        validationFieldElement = document.createElement("INPUT");
                        validationFieldElement.type = "hidden";
                        validationFieldElement.name = "__EVENTVALIDATION";
                        theForm.appendChild(validationFieldElement);
                    }
                    validationFieldElement.value = validationField;
                }
                if ((typeof(callbackObject.eventCallback) != "undefined") && (callbackObject.eventCallback != null)) {
                    callbackObject.eventCallback(response.substring(separatorIndex + validationFieldLength + 1), callbackObject.context);
                }
            }
        }
    }
}
function WebForm_FillFirstAvailableSlot(array, element) {
    var i;
    for (i = 0; i < array.length; i++) {
        if (!array[i]) break;
    }
    array[i] = element;
    return i;
}
var __nonMSDOMBrowser = (window.navigator.appName.toLowerCase().indexOf('explorer') == -1);
var __theFormPostData = "";
var __theFormPostCollection = new Array();
function WebForm_InitCallback() {
    var count = theForm.elements.length;
    var element;
    for (var i = 0; i < count; i++) {
        element = theForm.elements[i];
        var tagName = element.tagName.toLowerCase();
        if (tagName == "input") {
            var type = element.type;
            if ((type == "text" || type == "hidden" || type == "password" ||
                ((type == "checkbox" || type == "radio") && element.checked)) &&
                (element.id != "__EVENTVALIDATION")) {
                WebForm_InitCallbackAddField(element.name, element.value);
            }
        }
        else if (tagName == "select") {
            var selectCount = element.options.length;
            for (var j = 0; j < selectCount; j++) {
                var selectChild = element.options[j];
                if (selectChild.selected == true) {
                    WebForm_InitCallbackAddField(element.name, element.value);
                }
            }
        }
        else if (tagName == "textarea") {
            WebForm_InitCallbackAddField(element.name, element.value);
        }
    }
}
function WebForm_InitCallbackAddField(name, value) {
    var nameValue = new Object();
    nameValue.name = name;
    nameValue.value = value;
    __theFormPostCollection[__theFormPostCollection.length] = nameValue;
    __theFormPostData += name + "=" + WebForm_EncodeCallback(value) + "&";
}
function WebForm_EncodeCallback(parameter) {
    if (encodeURIComponent) {
        return encodeURIComponent(parameter);
    }
    else {
        return escape(parameter);
    }
}
var __disabledControlArray = new Array();
function WebForm_ReEnableControls() {
    if (typeof(__enabledControlArray) == 'undefined') {
        return false;
    }
    var disabledIndex = 0;
    for (var i = 0; i < __enabledControlArray.length; i++) {
        var c;
        if (__nonMSDOMBrowser) {
            c = document.getElementById(__enabledControlArray[i]);
        }
        else {
            c = document.all[__enabledControlArray[i]];
        }
        if ((typeof(c) != "undefined") && (c != null) && (c.disabled == true)) {
            c.disabled = false;
            __disabledControlArray[disabledIndex++] = c;
        }
    }
    setTimeout("WebForm_ReDisableControls()", 0);
    return true;
}
function WebForm_ReDisableControls() {
    for (var i = 0; i < __disabledControlArray.length; i++) {
        __disabledControlArray[i].disabled = true;
    }
}
var __defaultFired = false;
function WebForm_FireDefaultButton(event, target) {
    if (!__defaultFired && event.keyCode == 13 && !(event.srcElement && (event.srcElement.tagName.toLowerCase() == "textarea"))) {
        var defaultButton;
        if (__nonMSDOMBrowser) {
            defaultButton = document.getElementById(target);
        }
        else {
            defaultButton = document.all[target];
        }
        if (defaultButton && typeof(defaultButton.click) != "undefined") {
            __defaultFired = true;
            defaultButton.click();
            event.cancelBubble = true;
            if (event.stopPropagation) event.stopPropagation();
            return false;
        }
    }
    return true;
}
function WebForm_GetScrollX() {
    if (__nonMSDOMBrowser) {
        return window.pageXOffset;
    }
    else {
        if (document.documentElement && document.documentElement.scrollLeft) {
            return document.documentElement.scrollLeft;
        }
        else if (document.body) {
            return document.body.scrollLeft;
        }
    }
    return 0;
}
function WebForm_GetScrollY() {
    if (__nonMSDOMBrowser) {
        return window.pageYOffset;
    }
    else {
        if (document.documentElement && document.documentElement.scrollTop) {
            return document.documentElement.scrollTop;
        }
        else if (document.body) {
            return document.body.scrollTop;
        }
    }
    return 0;
}
function WebForm_SaveScrollPositionSubmit() {
    if (__nonMSDOMBrowser) {
        theForm.elements['__SCROLLPOSITIONY'].value = window.pageYOffset;
        theForm.elements['__SCROLLPOSITIONX'].value = window.pageXOffset;
    }
    else {
        theForm.__SCROLLPOSITIONX.value = WebForm_GetScrollX();
        theForm.__SCROLLPOSITIONY.value = WebForm_GetScrollY();
    }
    if ((typeof(this.oldSubmit) != "undefined") && (this.oldSubmit != null)) {
        return this.oldSubmit();
    }
    return true;
}
function WebForm_SaveScrollPositionOnSubmit() {
    theForm.__SCROLLPOSITIONX.value = WebForm_GetScrollX();
    theForm.__SCROLLPOSITIONY.value = WebForm_GetScrollY();
    if ((typeof(this.oldOnSubmit) != "undefined") && (this.oldOnSubmit != null)) {
        return this.oldOnSubmit();
    }
    return true;
}
function WebForm_RestoreScrollPosition() {
    if (__nonMSDOMBrowser) {
        window.scrollTo(theForm.elements['__SCROLLPOSITIONX'].value, theForm.elements['__SCROLLPOSITIONY'].value);
    }
    else {
        window.scrollTo(theForm.__SCROLLPOSITIONX.value, theForm.__SCROLLPOSITIONY.value);
    }
    if ((typeof(theForm.oldOnLoad) != "undefined") && (theForm.oldOnLoad != null)) {
        return theForm.oldOnLoad();
    }
    return true;
}
function WebForm_TextBoxKeyHandler(event) {
    if (event.keyCode == 13) {
        var target;
        if (__nonMSDOMBrowser) {
            target = event.target;
        }
        else {
            target = event.srcElement;
        }
        if ((typeof(target) != "undefined") && (target != null)) {
            if (typeof(target.onchange) != "undefined") {
                target.onchange();
                event.cancelBubble = true;
                if (event.stopPropagation) event.stopPropagation();
                return false;
            }
        }
    }
    return true;
}
function WebForm_AppendToClassName(element, className) {
    var current = element.className;
    if (current) {
        if (current.charAt(current.length - 1) != ' ') {
            current += ' ';
        }
        current += className;
    }
    else {
        current = className;
    }
    element.className = current;
}
function WebForm_RemoveClassName(element, className) {
    var current = element.className;
    if (current) {
        if (current.substring(current.length - className.length - 1, current.length) == ' ' + className) {
            element.className = current.substring(0, current.length - className.length - 1);
            return;
        }
        if (current == className) {
            element.className = "";
            return;
        }
        var index = current.indexOf(' ' + className + ' ');
        if (index != -1) {
            element.className = current.substring(0, index) + current.substring(index + className.length + 2, current.length);
            return;
        }
        if (current.substring(0, className.length) == className + ' ') {
            element.className = current.substring(className.length + 1, current.length);
        }
    }
}
function WebForm_GetElementById(elementId) {
    if (document.getElementById) {
        return document.getElementById(elementId);
    }
    else if (document.all) {
        return document.all[elementId];
    }
    else return null;
}
function WebForm_GetElementByTagName(element, tagName) {
    var elements = WebForm_GetElementsByTagName(element, tagName);
    if (elements && elements.length > 0) {
        return elements[0];
    }
    else return null;
}
function WebForm_GetElementsByTagName(element, tagName) {
    if (element && tagName) {
        if (element.getElementsByTagName) {
            return element.getElementsByTagName(tagName);
        }
        if (element.all && element.all.tags) {
            return element.all.tags(tagName);
        }
    }
    return null;
}
function WebForm_GetElementDir(element) {
    if (element) {
        if (element.dir) {
            return element.dir;
        }
        return WebForm_GetElementDir(element.parentNode);
    }
    return "ltr";
}
function WebForm_GetElementPosition(element) {
    var result = new Object();
    result.x = 0;
    result.y = 0;
    result.width = 0;
    result.height = 0;
    if (element.offsetParent) {
        result.x = element.offsetLeft;
        result.y = element.offsetTop;
        var parent = element.offsetParent;
        while (parent) {
            result.x += parent.offsetLeft;
            result.y += parent.offsetTop;
            var parentTagName = parent.tagName.toLowerCase();
            if (parentTagName != "table" &&
                parentTagName != "body" && 
                parentTagName != "html" && 
                parentTagName != "div" && 
                parent.clientTop && 
                parent.clientLeft) {
                result.x += parent.clientLeft;
                result.y += parent.clientTop;
            }
            parent = parent.offsetParent;
        }
    }
    else if (element.left && element.top) {
        result.x = element.left;
        result.y = element.top;
    }
    else {
        if (element.x) {
            result.x = element.x;
        }
        if (element.y) {
            result.y = element.y;
        }
    }
    if (element.offsetWidth && element.offsetHeight) {
        result.width = element.offsetWidth;
        result.height = element.offsetHeight;
    }
    else if (element.style && element.style.pixelWidth && element.style.pixelHeight) {
        result.width = element.style.pixelWidth;
        result.height = element.style.pixelHeight;
    }
    return result;
}
function WebForm_GetParentByTagName(element, tagName) {
    var parent = element.parentNode;
    var upperTagName = tagName.toUpperCase();
    while (parent && (parent.tagName.toUpperCase() != upperTagName)) {
        parent = parent.parentNode ? parent.parentNode : parent.parentElement;
    }
    return parent;
}
function WebForm_SetElementHeight(element, height) {
    if (element && element.style) {
        element.style.height = height + "px";
    }
}
function WebForm_SetElementWidth(element, width) {
    if (element && element.style) {
        element.style.width = width + "px";
    }
}
function WebForm_SetElementX(element, x) {
    if (element && element.style) {
        element.style.left = x + "px";
    }
}
function WebForm_SetElementY(element, y) {
    if (element && element.style) {
        element.style.top = y + "px";
    }
}

/**--2--**/

function DDNP_ShowDialog(winurl,msg)
{
	var pointX;
	var pointY;
	var param;
	var returnV;
	var height=400;
	var width=650;
	pointY = (screen.height-height)/2-40;
	pointX =(screen.width-width)/2;
	param = 'dialogLeft:' + pointX +';dialogTop:' + pointY + ';dialogHeight:'+height+'px;dialogWidth:'+width+'px;center:No;help:No;scroll:Yes;resizable:yes;status:No;'
	return window.showModalDialog(winurl,msg,param);
}

function DDNP_openNewWin(strUrl,strName,width,height)
{
	var win;
	if(width == null)
	{
	    width = 600;
	}
	if(height == null)
	{
	    height = 400;
	}
	var top=(screen.height-height)/2-20;
	var left=(screen.width-width)/2;
	win=window.open(strUrl,strName,"toolbar=no,width="+width+",height="+height+",menubar=no,scrollbars=yes,resizable=no,status=no,center=yes,top="+top+",left="+left);
	win.focus();
	DDNP_CancelEvent(event);
}

function DDNP_CancelEvent(cancelledEvent)
{
    cancelledEvent.cancelBubble = true;
    cancelledEvent.returnValue = false;
}
function isIE()
{
    return (window.navigator.appName.toLowerCase().indexOf("microsoft")>=0)
}
function DDNP_GetAbsoluteLocation(element) 
{ 
    if ( arguments.length != 1 || element == null ) 
    { 
        return null; 
    } 
    var elmt = element; 
    var offsetTop = elmt.offsetTop; 
    var offsetLeft = elmt.offsetLeft; 
    var offsetWidth = elmt.offsetWidth; 
    var offsetHeight = elmt.offsetHeight; 
    while( elmt = elmt.offsetParent ) 
    { 
          // add this judge 
        if ( elmt.style.position == 'absolute' || elmt.style.position == 'relative'  
            || ( elmt.style.dislpay == 'none' && elmt.style.display != '' ) ) 
        { 
            break; 
        }  
        offsetTop += elmt.offsetTop; 
        offsetLeft += elmt.offsetLeft; 
    } 
    return { absoluteTop: offsetTop, absoluteLeft: offsetLeft, 
        offsetWidth: offsetWidth, offsetHeight: offsetHeight }; 
}

var gIsIE = isIE();

/**--3--**/
function DDNPCollection()
{
    this.keys = new Array();
    this.values = new Array();
    this.setValue = setValue;
    this.getValue = getValue;
}
function setValue(key,value)
{
    var index = -1;
    var lp = 0;
    for(lp = 0;lp < this.keys.length;lp++)
    {
        if(this.keys[lp] == key)
        {
            index = lp;
        }
    }
    if(index >=0)
    {   
        this.values[index] = value;
    }
    else
    {
        this.keys.push(key);
        this.values.push(value);
    }
    
}

function getValue(key)
{
    var lp = 0;
    for(lp = 0;lp < this.keys.length;lp++)
    {
        if(this.keys[lp] == key)
        {
            return this.values[lp];
        }
    }
    return null;
}

/**--4--**/
var msgCollection = new DDNPCollection ();
var msgImgs = new DDNPCollection ();
function DDNP_moveout(id,anchorId,flag)
{ 
    var el = document.getElementById(id);
    var anchorpos =  msgCollection.getValue(id+"_an_p"); 
    var min = msgCollection.getValue(id+"_in");
    if(min != null)
    {
       clearTimeout(min); 
    }     
    var pos = msgCollection.getValue(id+"_pos");    
    var width = el.offsetWidth;
    var heigth = el.offsetHeight;
    if(arguments.length ==2)
    {
         var anchor = document.getElementById(anchorId);
         anchorpos = DDNP_GetAbsoluteLocation(anchor);
        
         msgCollection.setValue(id+"_an_p",anchorpos);
        
         el.style.visibility = "visible";

         if(el.offsetWidth >= pos.offsetWidth || el.offsetHeight >= pos.offsetHeight)
         {
            return;
         }
        el.style.left = anchorpos.absoluteLeft + anchorpos.offsetWidth;
        if((window.document.body.clientHeight - anchorpos.absoluteTop - window.document.body.scrollTop) < (window.document.body.clientHeight/2))
            el.style.top =  anchorpos.absoluteTop - anchorpos.offsetHeight;
        else
            el.style.top =  anchorpos.absoluteTop + anchorpos.offsetHeight;
            
        var msgContainer = document.getElementById(id + "_msg");
        msgContainer.style.visibility = "visible";
        msgContainer.style.display = "";
        msgContainer.style.overflow = "auto";    
        el.style.overflow = "hidden" ;
            
    }
    var left = new Number(el.style.left.replace(/[A-Za-z]+/g,""));
    var top = new Number(el.style.top.replace(/[A-Za-z]+/g,""));
    
    if(el.offsetWidth < pos.offsetWidth || el.offsetHeight < pos.offsetHeight)
    {
        if((anchorpos.absoluteLeft - window.document.body.scrollLeft)>(window.document.body.clientWidth/2))
            el.style.left =  left - pos.offsetWidth*0.08; 
        if((window.document.body.clientHeight - anchorpos.absoluteTop - window.document.body.scrollTop) < (window.document.body.clientHeight/2))
            el.style.top = top - pos.offsetHeight*0.08;
        
        el.style.width  = width + pos.offsetWidth*0.08; 
        el.style.height = heigth + pos.offsetHeight*0.08; 
        
        var mout= setTimeout ("eval(DDNP_moveout('"+id+"','"+anchorId+"',true))",1);
        msgCollection.setValue(id+"_out",mout)
    } 
    
    
} 
function DDNP_movein(id,flag)
{ 
   var el = document.getElementById(id);
   var elpos = DDNP_GetAbsoluteLocation(el);
   var mout = msgCollection.getValue(id+"_out");
   if(mout!=null)
        clearTimeout(mout); 
    var width = el.offsetWidth;
    var heigth = el.offsetHeight;
    var pos = msgCollection.getValue(id+"_pos");  
    var left = new Number(el.style.left.replace(/[A-Za-z]+/g,""));
    var top = new Number(el.style.top.replace(/[A-Za-z]+/g,""));
    var anchorpos =  msgCollection.getValue(id+"_an_p"); 
    var min = null;
    if(arguments.length == 1)
    {
        var msgContainer = document.getElementById(id + "_msg");
        var border = new Number(el.style.borderWidth.replace(/[A-Za-z]+/g,""));
        if(border.toString() == "NaN")
        {
            border = 0;
        }
        if(gIsIE)
        {
            if(event!=null && event.clientX < 0)
            {
                return;
            }
            if(event!=null && event.clientX>(left+border) && event.clientY>(top+border) && event.clientX < (left+width) && event.clientY < (top+heigth))
            {
                
                return;
            }
             msgContainer.style.visibility = "hidden";
        }
        msgContainer.style.overflow = "hidden";
        el.style.overflow = "hidden"
    }
    if(width>1)
    { 
        el.style.width  = (width - pos.offsetWidth*0.08) < 0?0:width - pos.offsetWidth*0.08; 
        el.style.height = (heigth - pos.offsetHeight*0.08) < 0?0:heigth - pos.offsetHeight*0.08;
        if(anchorpos!=null && (elpos.absoluteLeft) < (anchorpos.absoluteLeft))
            el.style.left =  left +  pos.offsetWidth*0.08; 
        if(anchorpos!=null && (elpos.absoluteTop) < (anchorpos.absoluteTop))
            el.style.top = top +  pos.offsetHeight*0.08;
        min=setTimeout("eval(DDNP_movein('"+id+"',true))",1);
        msgCollection.setValue(id+"_in",min);
   }
   
   if(width == el.offsetWidth && heigth == el.offsetHeight)
   {
        el.style.visibility = "hidden";
        document.getElementById(id+"_msg").style.display = "none";
        if(min != null)
            clearTimeout(min);
   }
} 

function DDNP_initMsgBars(Bars)
{
   var bar = 0;
   var id = "";
   for(bar=0;bar < Bars.length;bar++)
   {
        id = Bars[bar];
        
        var icon =document.getElementById(id+"_icon_img");
        if(icon != null)
        {
            var normalSrc;
            var promptSrc;
            var errorSrc;
            if(gIsIE)
            {
                
                normalSrc = icon.normalSrc;
                promptSrc = icon.promptSrc
                errorSrc = icon.errorSrc;
            }
            else
            {
                normalSrc = icon.getAttribute("normalSrc");
                promptSrc = icon.getAttribute("promptSrc");
                errorSrc = icon.getAttribute("errorSrc");
            }
            
            var normalImg = new Image();
            normalImg.src = normalSrc;
            var promptImg = new Image();
            promptImg.src = promptSrc;
            var errorImg = new Image();
            errorImg.src = errorSrc;
            msgImgs.setValue(id+"_ng",normalImg);
            msgImgs.setValue(id+"_pg",promptImg);
            msgImgs.setValue(id+"_eg",errorImg);
        }
        var el = document.getElementById(id);
        var pos = msgCollection.getValue(id+"_pos");
        pos = DDNP_GetAbsoluteLocation(el);
        msgCollection.setValue(id+"_pos",pos);

        el.style.width = el.offsetWidth;
        el.style.height = el.offsetHeight;
        DDNP_movein(id);
    }
    
}

function DDNP_iconClick(panelId)
{
   var id = panelId +"_icon";
   var lp = 0;
   for(lp=0;lp < DDNP_MsgBars.length;lp++)
   {
        if(DDNP_MsgBars[lp]!=panelId)
        {
            DDNP_movein(DDNP_MsgBars[lp]);
        }
   }

   DDNP_moveout(panelId,id);
   
   var icon =document.getElementById(id+"_img");
   if(icon != null)
        icon.src = msgImgs.getValue(panelId+"_ng").src;
   if(gIsIE)
   {
     DDNP_CancelEvent(event);
   }
  
  
}
function DDNP_ClearMsg(panelId)
{
    var msgContainer = document.getElementById(panelId + "_msg");
    msgContainer.innerHTML = "";
    msgContainer.innerText = "";
}

function DDNP_WriteMsg(panelId,msg,iserrorMsg)
{
    var msgContainer = document.getElementById(panelId + "_msg");
    var icon = document.getElementById(panelId + "_icon_img");
    msgContainer.innerHTML = msg;
    if(icon == null)
    {
        return;
    }
    var normalImg = msgImgs.getValue(panelId+"_ng");
    var promptImg = msgImgs.getValue(panelId+"_pg");
    var errorImg  = msgImgs.getValue(panelId+"_eg");
    if(normalImg == null)
    {
        DDNP_initMsgBars([panelId]);
        normalImg = msgImgs.getValue(panelId+"_ng");
        promptImg = msgImgs.getValue(panelId+"_pg");
        errorImg  = msgImgs.getValue(panelId+"_eg");
    }
    if(msg == null || msg == "")
    {
        icon.src = normalImg.src;
        return;
    }
    if(iserrorMsg)
    {
        icon.src = errorImg.src;
    }
    else
    {
        icon.src = promptImg.src;
    }

}



/**--5--**/

function WebForm_FindFirstFocusableChild(control) {
    if (!control || !(control.tagName)) {
        return null;
    }
    var tagName = control.tagName.toLowerCase();
    if (tagName == "undefined") {
        return null;
    }
    var children = control.childNodes;
    if (children) {
        for (var i = 0; i < children.length; i++) {
            try {
                if (WebForm_CanFocus(children[i])) {
                    return children[i];
                }
                else {
                    var focused = WebForm_FindFirstFocusableChild(children[i]);
                    if (WebForm_CanFocus(focused)) {
                        return focused;
                    }
                }
            } catch (e) {
            }
        }
    }
    return null;
}
function WebForm_AutoFocus(focusId) {
    var targetControl;
    if (__nonMSDOMBrowser) {
        targetControl = document.getElementById(focusId);
    }
    else {
        targetControl = document.all[focusId];
    }
    var focused = targetControl;
    if (targetControl && (!WebForm_CanFocus(targetControl)) ) {
        focused = WebForm_FindFirstFocusableChild(targetControl);
    }
    if (focused) {
        try {
            focused.focus();
            if (__nonMSDOMBrowser) {
                focused.scrollIntoView(false);
            }
            if (window.__smartNav) {
                window.__smartNav.ae = focused.id;
            }
        }
        catch (e) {
        }
    }
}
function WebForm_CanFocus(element) {
    if (!element || !(element.tagName)) return false;
    var tagName = element.tagName.toLowerCase();
    return (!(element.disabled) &&
            (!(element.type) || element.type.toLowerCase() != "hidden") &&
            WebForm_IsFocusableTag(tagName) &&
            WebForm_IsInVisibleContainer(element)
            );
}
function WebForm_IsFocusableTag(tagName) {
    return (tagName == "input" ||
            tagName == "textarea" ||
            tagName == "select" ||
            tagName == "button" ||
            tagName == "a");
}
function WebForm_IsInVisibleContainer(ctrl) {
    var current = ctrl;
    while((typeof(current) != "undefined") && (current != null)) {
        if (current.disabled ||
            ( typeof(current.style) != "undefined" &&
            ( ( typeof(current.style.display) != "undefined" &&
                current.style.display == "none") ||
                ( typeof(current.style.visibility) != "undefined" &&
                current.style.visibility == "hidden") ) ) ) {
            return false;
        }
        if (typeof(current.parentNode) != "undefined" &&
                current.parentNode != null &&
                current.parentNode != current &&
                current.parentNode.tagName.toLowerCase() != "body") {
            current = current.parentNode;
        }
        else {
            return true;
        }
    }
    return true;
}
