element block and removes // previous instances of the identical script. var found = false; for (var child = 0; child < head.childNodes.length; child++) { var control = head.childNodes[child]; if (typeof(control.tagName) == "string") { if (control.tagName.toUpperCase() == "SCRIPT") { if (script.src.length > 0) { if (script.src == control.src) { found = true; break; } } else if (script.innerHTML.length > 0) { if (script.innerHTML == control.innerHTML) { found = true; break; } } } } } if (found) { head.removeChild(control); } var scriptAddedToHead = false; if (typeof script.readyState != "undefined" && !window.opera) { script.onreadystatechange = function() { if (script.readyState != "complete" && script.readyState != "loaded") { return; } else { Anthem_LoadPageScript(result, index + 1); } } } else { if (isExternalScript) // if it's an external script, only execute the next script when the previous one is loaded. { script.onload = function() { Anthem_LoadPageScript(result, index + 1); } } else // I didn't find a way for script blocks to fire some onload event. So in this case directly call the Anthem_LoadPageScript for the next script. { document.getElementsByTagName('head')[0].appendChild(script); scriptAddedToHead = true; Anthem_LoadPageScript(result, index + 1); } } // Now we append the new script and move on to the next script. // Note that this is a recursive function. It stops when the // index grows larger than the number of scripts. if (!scriptAddedToHead) document.getElementsByTagName('head')[0].appendChild(script); } } catch (e) { Anthem_DebugError("Error adding page script to head. " + e.name + ": " + e.message); } } } function Anthem_EvalClientSideScript(result) { if (result.script) { for (var i = 0; i < result.script.length; ++i) { try { eval(result.script[i]); } catch (e) { alert("Error evaluating client-side script!\n\nScript: " + result.script[i] + "\n\nException: " + e); } } } } //Fix for bug #1429412, "Reponse callback returns previous response after file push". //see http://sourceforge.net/tracker/index.php?func=detail&aid=1429412&group_id=151897&atid=782464 function Anthem_Clear__EVENTTARGET() { var form = Anthem_GetForm(); Anthem_SetHiddenInputValue(form, "__EVENTTARGET", ""); } function Anthem_InvokePageMethod(methodName, args, clientCallBack, clientCallBackArg) { Anthem_Clear__EVENTTARGET(); // fix for bug #1429412 return Anthem_CallBack(null, "Page", null, methodName, args, clientCallBack, clientCallBackArg, true, true); } function Anthem_InvokeMasterPageMethod(methodName, args, clientCallBack, clientCallBackArg) { Anthem_Clear__EVENTTARGET(); // fix for bug #1429412 return Anthem_CallBack(null, "MasterPage", null, methodName, args, clientCallBack, clientCallBackArg, true, true); } function Anthem_InvokeControlMethod(id, methodName, args, clientCallBack, clientCallBackArg) { Anthem_Clear__EVENTTARGET(); // fix for bug #1429412 return Anthem_CallBack(null, "Control", id, methodName, args, clientCallBack, clientCallBackArg, true, true); } function Anthem_PreProcessCallBack( control, e, eventTarget, causesValidation, validationGroup, imageUrlDuringCallBack, textDuringCallBack, enabledDuringCallBack, preCallBackFunction, callBackCancelledFunction, preProcessOut ) { var valid = true; if (causesValidation && typeof(Page_ClientValidate) == "function") { valid = Page_ClientValidate(validationGroup); } if (typeof(WebForm_OnSubmit) == "function") { valid = WebForm_OnSubmit(); } if (valid) { var preCallBackResult = true; if (typeof(preCallBackFunction) == "function") { preCallBackResult = preCallBackFunction(control, e); } if (typeof(preCallBackResult) == "undefined" || preCallBackResult) { var inputType = control.getAttribute("type"); inputType = (inputType == null) ? '' : inputType.toUpperCase(); if (inputType == "IMAGE" && e != null) { var form = Anthem_GetForm(); if (e.offsetX) { // IE Anthem_SetHiddenInputValue(form, eventTarget + ".x", e.offsetX); Anthem_SetHiddenInputValue(form, eventTarget + ".y", e.offsetY); } else { // FireFox + ??? var offset = GetControlLocation(control); Anthem_SetHiddenInputValue(form, eventTarget + ".x", e.clientX - offset.x + 1 + window.pageXOffset); Anthem_SetHiddenInputValue(form, eventTarget + ".y", e.clientY - offset.y + 1 + window.pageYOffset); } } if (imageUrlDuringCallBack || textDuringCallBack) { var nodeName = control.nodeName.toUpperCase(); if (nodeName == "INPUT") { if (inputType == "CHECKBOX" || inputType == "RADIO" || inputType == "TEXT") { preProcessOut.OriginalText = GetLabelText(control.id); SetLabelText(control.id, textDuringCallBack); } else if (inputType == "IMAGE") { if (imageUrlDuringCallBack) { preProcessOut.OriginalText = control.src; control.src = imageUrlDuringCallBack; } else { preProcessOut.ParentElement = control.parentElement ? control.parentElement : control.parentNode; if (preProcessOut.ParentElement) { preProcessOut.OriginalText = preProcessOut.ParentElement.innerHTML; preProcessOut.ParentElement.innerHTML = textDuringCallBack; } } } else if (inputType == "SUBMIT" || inputType == "BUTTON") { preProcessOut.OriginalText = control.value; control.value = textDuringCallBack; } } else if (nodeName == "SELECT" || nodeName == "SPAN") { preProcessOut.OriginalText = GetLabelText(control.id); SetLabelText(control.id, textDuringCallBack); } else { preProcessOut.OriginalText = control.innerHTML; control.innerHTML = textDuringCallBack; } } // Disable the control during callback if required control.disabled = (typeof(enabledDuringCallBack) == "undefined") ? false : !enabledDuringCallBack; return true; } else { // Callback cancelled if (typeof(callBackCancelledFunction) == "function") { callBackCancelledFunction(control, e); } return false; } } else { // Validation failed return false; } } function Anthem_PreProcessCallBackOut() { // Fields this.ParentElement = null; this.OriginalText = ''; } function Anthem_PostProcessCallBack( result, control, e, eventTarget, clientCallBack, clientCallBackArg, imageUrlDuringCallBack, textDuringCallBack, postCallBackFunction, preProcessOut ) { if (typeof(postCallBackFunction) == "function") { postCallBackFunction(control, e); } // Re-enable the control if it was disabled during callback control.disabled = false; var inputType = control.getAttribute("type"); inputType = (inputType == null) ? '' : inputType.toUpperCase(); if (inputType == "IMAGE") { var form = Anthem_GetForm(); Anthem_RemoveHiddenInput(form, eventTarget + ".x"); Anthem_RemoveHiddenInput(form, eventTarget + ".y"); } if (imageUrlDuringCallBack || textDuringCallBack) { var nodeName = control.nodeName.toUpperCase(); if (nodeName == "INPUT") { if (inputType == "CHECKBOX" || inputType == "RADIO" || inputType == "TEXT") { SetLabelText(control.id, preProcessOut.OriginalText); } else if (inputType == "IMAGE") { if (imageUrlDuringCallBack) { control.src = preProcessOut.OriginalText; } else { preProcessOut.ParentElement.innerHTML = preProcessOut.OriginalText; } } else if (inputType == "SUBMIT" || inputType == "BUTTON") { control.value = preProcessOut.OriginalText; } } else if (nodeName == "SELECT" || nodeName == "SPAN") { SetLabelText(control.id, preProcessOut.OriginalText); } else { control.innerHTML = preProcessOut.OriginalText; } } if (typeof(clientCallBack) == "function") { clientCallBack(result, clientCallBackArg); } } function Anthem_FireCallBackEvent( control, e, eventTarget, eventArgument, causesValidation, validationGroup, imageUrlDuringCallBack, textDuringCallBack, enabledDuringCallBack, preCallBackFunction, postCallBackFunction, callBackCancelledFunction, includeControlValuesWithCallBack, updatePageAfterCallBack ) { // Cancel the callback if the control is disabled. Although most controls will // not raise their callback event if they are disabled, the LinkButton will. // This check is for the LinkButton. See SourceForge Patch 1639700. if (control.disabled) return; var preProcessOut = new Anthem_PreProcessCallBackOut(); var preProcessResult = Anthem_PreProcessCallBack( control, e, eventTarget, causesValidation, validationGroup, imageUrlDuringCallBack, textDuringCallBack, enabledDuringCallBack, preCallBackFunction, callBackCancelledFunction, preProcessOut ); if (preProcessResult) { var eventType = e.type; Anthem_FireEvent( eventTarget, eventArgument, function(result) { Anthem_PostProcessCallBack( result, control, eventType, eventTarget, null, null, imageUrlDuringCallBack, textDuringCallBack, postCallBackFunction, preProcessOut ); }, null, includeControlValuesWithCallBack, updatePageAfterCallBack ); } } function AnthemListControl_OnClick( e, causesValidation, validationGroup, textDuringCallBack, enabledDuringCallBack, preCallBackFunction, postCallBackFunction, callBackCancelledFunction, includeControlValuesWithCallBack, updatePageAfterCallBack ) { var target = e.target || e.srcElement; if (target.nodeName.toUpperCase() == "LABEL" && target.htmlFor != '') return; var eventTarget = target.id.split("_").join("$"); Anthem_FireCallBackEvent( target, e, eventTarget, '', causesValidation, validationGroup, '', textDuringCallBack, enabledDuringCallBack, preCallBackFunction, postCallBackFunction, callBackCancelledFunction, true, true ); } // Returns the top, left control location in FireFox function GetControlLocation(control) { var offsetX = 0; var offsetY = 0; var parent; for (parent = control; parent; parent = parent.offsetParent) { if (parent.offsetLeft) { offsetX += parent.offsetLeft; } if (parent.offsetTop) { offsetY += parent.offsetTop; } } return { x: offsetX, y: offsetY }; } function GetLabelText(id) { var labels = document.getElementsByTagName('label'); for (var i = 0; i < labels.length; i++) { if (labels[i].htmlFor == id) { return labels[i].innerHTML; } } return null; } function SetLabelText(id, text) { var labels = document.getElementsByTagName('label'); for (var i = 0; i < labels.length; i++) { if (labels[i].htmlFor == id) { labels[i].innerHTML = text; return; } } } // Used by encodeURIComponentNew to mimic function encodeURIComponent in // IE 5.5+, Netscape 6+, and Mozilla function utf8(wide) { var c, s; var enc = ""; var i = 0; while(i=0xDC00 && c<0xE000) continue; if (c>=0xD800 && c<0xDC00) { if (i>=wide.length) continue; s= wide.charCodeAt(i++); if (s<0xDC00 || c>=0xDE00) continue; c= ((c-0xD800)<<10)+(s-0xDC00)+0x10000; } // output value if (c<0x80) enc += String.fromCharCode(c); else if (c<0x800) enc += String.fromCharCode(0xC0+(c>>6),0x80+(c&0x3F)); else if (c<0x10000) enc += String.fromCharCode(0xE0+(c>>12),0x80+(c>>6&0x3F),0x80+(c&0x3F)); else enc += String.fromCharCode(0xF0+(c>>18),0x80+(c>>12&0x3F),0x80+(c>>6&0x3F),0x80+(c&0x3F)); } return enc; } var hexchars = "0123456789ABCDEF"; function toHex(n) { return hexchars.charAt(n>>4)+hexchars.charAt(n & 0xF); } var okURIchars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-"; // Mimics function encodeURIComponent in IE 5.5+, Netscape 6+, and Mozilla function encodeURIComponentNew(s) { var s = utf8(s); var c; var enc = ""; for (var i= 0; i

出诊查询

首页 > 出诊动态 > 出诊查询
出诊医生搜索: