var LD_Event={realEvent:function(event){return window.event||event;},element:function(event){var evt=this.realEvent(event);return evt.srcElement||evt.target;},toElement:function(event){var evt=this.realEvent(event);return event.toElement;}};if(window.addEventListener){Event.prototype.__defineGetter__("toElement",function(){var node;if(this.type=="mouseout"){node=this.relatedTarget;}else if(this.type=="mouseover"){node=this.target;}
if(!node){return;}
while(node.nodeType!=1){node=node.parentNode;}
return node;});};var LD_Class={create:function(){return function(){this.initialize.apply(this,jQuery.makeArray(arguments));}}}
Function.prototype.bind=function(){var __method=this,args=jQuery.makeArray(arguments),object=args.shift();return function(){__method.apply(object,args.concat(jQuery.makeArray(arguments)));}}
Function.prototype.bindEvent=function(){var __method=this,args=jQuery.makeArray(arguments),object=args.shift();return function(event){__method.apply(object,[window.event||event].concat(args));}}
if(typeof(HTMLElement)!="undefined"){HTMLElement.prototype.contains=function(obj){while(obj!=null&&typeof(obj.tagName)!="undefind"){if(obj==this)
return true;obj=obj.parentNode;}
return false;}}
function LD_loadImages(){if(argments.length===0)return;for(var i=0,n=arguments.length;i<n;i++){if(arguments[i]&&arguments[i].constructor===Array){arguments.callee(arguments[i]);}else{new Image().src=arguments[i];}}}
function getId(id){if(document.getElementById(id)){return document.getElementById(id);}else{return false;}}
function LD_createEditor(event,elementName,width,height,basePath){if(!arguments.callee[elementName]){arguments.callee[elementName]=new jtbcEditor(elementName);arguments.callee[elementName].tEditUBBMode=0;arguments.callee[elementName].tInit("LD_createEditor['"+elementName+"']",basePath+'inc/js/jtbceditor/');}}
function LD_setError(message){getId('error').innerHTML=message;getId('error').style.display='block';}
function LD_clearError(){getId("error").innerHTML='&nbsp;';}
function checkDeleteForm(elementForm){if(jQuery("input[name='id[]']").isAllNotChecked()){LD_alert(undefined,'请至少选中一条记录！');return false;}
LD_confirm(undefined,'您确定删除选中的记录吗',{},function(){elementForm.submit();})}
function LD_alert(title,content,_options,callback){if(jQuery.isUndefined(title))title='错误提示';var buttonOk=function(){if(jQuery.isFunction(callback))callback();jQuery(this).dialog('close');}
var options={bgiframe:true,resizable:false,draggable:false,height:140,modal:true,overlay:{backgroundColor:'#000',opacity:0.5},buttons:{'确定':buttonOk}};if(typeof _options=='object'){jQuery.extend(options,_options);}
if(!jQuery('#ui_dialog').get(0)){jQuery('body').append('<div id="ui_dialog" title="'+title+'"><p id="ui_dialog_content">'+content+'</p></div>')
jQuery("#ui_dialog").dialog(options);jQuery('#ui_dialog_content').dialog('open');}else{jQuery('#ui_dialog').dialog('option','title',title);jQuery('#ui_dialog_content').html(content);jQuery('#ui_dialog').dialog('option','buttons',{'确定':buttonOk});jQuery('#ui_dialog').dialog('open');}}
function setHome(obj,vrl){try{obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl);}
catch(e){if(window.netscape){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");}catch(e){alert("抱歉！您的浏览器不支持直接设为首页。请在浏览器地址栏输入“about:config”并回车然后将[signed.applets.codebase_principal_support]设置为“true”，点击“加入收藏”后忽略安全提示，即可设置成功。");}
var prefs=Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);prefs.setCharPref('browser.startup.homepage',vrl);}}}
function addFavorite(){try{window.external.AddFavorite(window.location,document.title);}catch(e){try{window.sidebar.addPanel(document.title,window.location,"");}catch(ee){alert('您的浏览器不支持此操作！');}}}
function LD_confirm(title,content,_options,onDefinite,onCancel){if(jQuery.isUndefined(title)||title===null)title='提示';var buttonOk=function(){if(jQuery.isFunction(onDefinite))onDefinite();jQuery(this).dialog('close');}
var buttonCancel=function(){if(jQuery.isFunction(onCancel))onCancel();jQuery(this).dialog('close');}
var options={bgiframe:true,resizable:false,draggable:false,height:140,modal:true,overlay:{backgroundColor:'#000',opacity:0.5},buttons:{'取消':buttonCancel,'确定':buttonOk}};if(typeof _options=='object')jQuery.extend(options,_options);if(!jQuery('#ui_dialog').get(0)){jQuery('body').append('<div id="ui_dialog" title="'+title+'"><p id="ui_dialog_content">'+content+'</p></div>')
jQuery("#ui_dialog").dialog(options);jQuery('#ui_dialog_content').dialog('open');}else{jQuery('#ui_dialog').dialog('option','title',title);jQuery('#ui_dialog_content').html(content);jQuery('#ui_dialog').dialog('option','buttons',{'取消':buttonCancel,'确定':buttonOk})
jQuery('#ui_dialog').dialog('open');}}
function LD_focusToElement(element){jQuery(element).focus();}
function LD_fxMultiply(a,b){var f1=String(a).split(".").length>1?String(a).split(".")[1].length:0;var f2=String(b).split(".").length>1?String(b).split(".")[1].length:0;var aa=String(a).replace(/^0*|\./g,'');var bb=String(b).replace(/^0*|\./g,'');return Number(aa)*Number(bb)/Math.pow(10,f1+f2);}
function LD_fxDiv(arg1,arg2){var t1=0,t2=0,r1,r2;try{t1=arg1.toString().split(".")[1].length}catch(e){}
try{t2=arg2.toString().split(".")[1].length}catch(e){}
with(Math){r1=Number(arg1.toString().replace(".",""))
r2=Number(arg2.toString().replace(".",""))
return(r1/r2)*pow(10,t2-t1);}}
function LD_fxAdd(arg1,arg2){var r1,r2,m;try{r1=arg1.toString().split(".")[1].length}catch(e){r1=0}
try{r2=arg2.toString().split(".")[1].length}catch(e){r2=0}
m=Math.pow(10,Math.max(r1,r2))
return(arg1*m+arg2*m)/m}
function LD_fxComp(arg1,arg2){var r1,r2,m,n;try{r1=arg1.toString().split(".")[1].length}catch(e){r1=0}
try{r2=arg2.toString().split(".")[1].length}catch(e){r2=0}
m=Math.pow(10,Math.max(r1,r2));n=(r1>=r2)?r1:r2;return((arg1*m-arg2*m)/m).toFixed(n);}
function LD_fx(intString){return Math.round(intString*100)/100;}
function setImagePreview(inputFile,objTarget){inputFile=$(inputFile);objTarget=$(objTarget);if($.browser.msie){inputFile.select();var imgSrc=document.selection.createRange().text;objTarget.get(0).filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src=imgSrc;}else if($.browser.mozilla){var imgSrc='<img id="photo" src="'+inputFile.get(0).files[0].getAsDataURL()+'"/>';objTarget.html(imgSrc);}}
function check_upload_img(objpath){var img=/(\.jpg|\.gif|\.png|\.bmp|image\/jpeg|\.jpeg)$/i;if(!objpath.match(img)){return false;}else{return true;}}
function select_city(province_id,setId,prompt_option,filter){if(prompt_option===undefined)prompt_option="--选择城市--";if(filter===undefined)filter=function(){return true;};var city_element=document.getElementById(setId);city_element.options.length=0;city_element.options[city_element.options.length]=new Option(prompt_option,'');if(province_id==""){city_element.disabled=true;return;}else city_element.disabled=false;for(i=0,n=city.length;i<n;i++){if(city[i][0]==province_id&&filter(city[i])){city_element.options[city_element.options.length]=new Option(city[i][2],city[i][1]);}}}
function select_sections(sections_id,setId){var select_sections=document.getElementById(setId);select_sections.options.length=0;select_sections.options[select_sections.options.length]=new Option('--二级科室--','');if(sections_id==""){select_sections.disabled=true;return;}else{select_sections.disabled=false;}
for(i=0,n=sections.length;i<n;i++){if(sections[i][0]==sections_id){select_sections.options[select_sections.options.length]=new Option(sections[i][2],sections[i][1]);}}}
function tabs_nav(obj_div){var valNegInt=/^\d+$/;　　
var nav_doctor=$(obj_div);var nav_li_item=$(obj_div+" li");var nav_a_item=$(obj_div+" li a");nav_a_item.click(function(){return false;});var timeout=null;var pre=nav_li_item[0];nav_li_item.hover(function(){timeout=setTimeout((function(){if(pre){$(pre).removeClass("current");}
var target=pre.getElementsByTagName("a");var view_div=$(target[0]).attr("href");$(view_div).css({display:"none"});var target=this.getElementsByTagName("a");view_div=$(target[0]).attr("href");$(view_div).css({display:"block"});$(this).addClass("current");pre=this;}).bind(this),100);},function(){if(!isNaN(timeout)){clearTimeout(timeout);timeout=null;}})
if(valNegInt.test(arguments[1])){var tmp=$(obj_div+" li.current");pre=tmp.get(0);if(pre){$(pre).removeClass("current");}
target=pre.getElementsByTagName("a");view_div=$(target[0]).attr("href");$(view_div).hide();var target=nav_li_item[arguments[1]].getElementsByTagName("a");view_div=$(target[0]).attr("href");$(view_div).show();$(nav_li_item[arguments[1]]).addClass("current");pre=nav_li_item[arguments[1]];}}
function set_current(o)
{var lis=$("#"+o+" li");var pre=lis[0];var timeout=null;lis.hover(function(){timeout=setTimeout((function(){if(pre)$(pre).removeClass("current");$(this).addClass("current");pre=this;}).bind(this),100);},function(){if(!isNaN(timeout)){clearTimeout(timeout);timeout=null;}});}
function doctorSlider(){var goLeft=document.getElementById('btnLeft');var goRight=document.getElementById('btnRight');var ul=document.getElementById('silde_doctor');var lis=ul.getElementsByTagName('li');var stopSlider=true;ul.style.width=182*lis.length+'px';ul.style.left="0px";var maxLeft=-(parseInt(ul.style.width)-910);var targetLeft=0;goLeft.onclick=function(){if(stopSlider){targetLeft+=910;if(targetLeft>0){targetLeft=0;}
sliderLeft();}}
goRight.onclick=function(){if(stopSlider){targetLeft-=910;if(targetLeft<maxLeft){targetLeft=maxLeft;}
sliderRight();}}
function sliderLeft(){var xpos=parseInt(ul.style.left);stopSlider=false;if(xpos==0||xpos==targetLeft){stopSlider=true;return;}else{if(xpos<targetLeft){var dist=Math.ceil((targetLeft-xpos)/10);xpos=xpos+dist;}else{var dist=Math.ceil((xpos-targetLeft)/10);xpos=xpos-dist;}
ul.style.left=xpos+'px';setTimeout(function(){sliderLeft()},15);}}
function sliderRight(){var xpos=parseInt(ul.style.left);stopSlider=false;if(xpos==maxLeft||xpos==targetLeft){stopSlider=true;return;}else{if(xpos<targetLeft){var dist=Math.ceil((targetLeft-xpos)/10);xpos=xpos+dist;}else{var dist=Math.ceil((xpos-targetLeft)/10);xpos=xpos-dist;}
ul.style.left=xpos+'px';setTimeout(function(){sliderRight()},15);}}}
function find_id(obj,str){var on=false;while(obj&&jQuery.isElement(obj)){if(obj.getAttribute('id')==str){on=true;break;}
obj=obj.parentNode;}
return on;}
function delCookie(objclear,path){$.get(path);var objclear=$("#"+objclear);objclear.html("<LI class=\"no_border\">暂无浏览记录</LI>");}
function showError(selector,message,callback){if(message===undefined||message=='')throw'错误提示语句不能为空';if(selector==undefined)selector='#error';alert(message);if(jQuery.isFunction(callback))callback(selector,message);}
function getWindowInfo()
{var scrollX=0,scrollY=0,width=0,height=0,contentWidth=0,contentHeight=0;if(typeof(window.pageXOffset)=='number')
{scrollX=window.pageXOffset;scrollY=window.pageYOffset;}
else if(document.body&&(document.body.scrollLeft||document.body.scrollTop))
{scrollX=document.body.scrollLeft;scrollY=document.body.scrollTop;}
else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop))
{scrollX=document.documentElement.scrollLeft;scrollY=document.documentElement.scrollTop;}
if(typeof(window.innerWidth)=='number')
{width=window.innerWidth;height=window.innerHeight;}
else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight))
{width=document.documentElement.clientWidth;height=document.documentElement.clientHeight;}
else if(document.body&&(document.body.clientWidth||document.body.clientHeight))
{width=document.body.clientWidth;height=document.body.clientHeight;}
if(document.documentElement&&(document.documentElement.scrollHeight||document.documentElement.offsetHeight))
{if(document.documentElement.scrollHeight>document.documentElement.offsetHeight)
{contentWidth=document.documentElement.scrollWidth;contentHeight=document.documentElement.scrollHeight;}
else
{contentWidth=document.documentElement.offsetWidth;contentHeight=document.documentElement.offsetHeight;}}
else if(document.body&&(document.body.scrollHeight||document.body.offsetHeight))
{if(document.body.scrollHeight>document.body.offsetHeight)
{contentWidth=document.body.scrollWidth;contentHeight=document.body.scrollHeight;}
else
{contentWidth=document.body.offsetWidth;contentHeight=document.body.offsetHeight;}}
else
{contentWidth=width;contentHeight=height;}
if(height>contentHeight)
height=contentHeight;if(width>contentWidth)
width=contentWidth;var rect=new Object();rect.ScrollX=scrollX;rect.ScrollY=scrollY;rect.Width=width;rect.Height=height;rect.ContentWidth=contentWidth;rect.ContentHeight=contentHeight;return rect;}
function fadeShow(idObjSrc,idShowDivContainer,hotArea,marginOptions){this.strTimeOut="";this.bleIsShow=false;this.idObjSrc="";if(typeof(idObjSrc)=="object"){this.idObjSrc=idObjSrc;}else if(typeof(idObjSrc)=="string"){this.idObjSrc="#"+idObjSrc;}
this.hotArea=hotArea||this.idObjSrc;this.idShowDivContainer="";if(typeof(idShowDivContainer)=="object"){this.idShowDivContainer=idShowDivContainer;}else if(typeof(idShowDivContainer)=="string"){this.idShowDivContainer="#"+idShowDivContainer;}
this.marginOptions={};this.marginOptions.marginLeft=marginOptions?marginOptions.marginLeft:0;this.marginOptions.marginTop=marginOptions?marginOptions.marginTop:$(this.idObjSrc).height();this.init();}
fadeShow.prototype.init=function(){var thisObj=this;var objTop=$(this.idObjSrc).offset().top;var objLeft=$(this.idObjSrc).offset().left;var objWidth=$(this.idObjSrc).outerWidth(true);var leftTemp=parseInt(objLeft)+this.marginOptions.marginLeft;var topTemp=parseInt(objTop)+parseInt(this.marginOptions.marginTop);$(this.idShowDivContainer).css({position:"absolute",top:topTemp+"px",left:leftTemp+"px"}).mouseout(function(e){thisObj.hide(e);});$(this.hotArea).mouseout(function(e){thisObj.hide(e);});}
fadeShow.prototype.hide=function(evt){evt=(evt)?evt:window.event;var toElementObj;if($.browser.msie){toElementObj=evt.toElement;}else if($.browser.mozilla){toElementObj=evt.relatedTarget;}else{toElementObj=evt.relatedTarget;}
var thisObj=this;if($(this.idShowDivContainer)[0].contains(toElementObj)||$(this.hotArea)[0].contains(toElementObj)){this.bleIsShow=false;}else{this.bleIsShow=true;if(this.strTimeOut==""){this.strTimeOut=setTimeout(function(){thisObj.doHide()},200);}}}
fadeShow.prototype.doHide=function(){if(this.strTimeOut!=""){clearInterval(this.strTimeOut);this.strTimeOut="";}
if(!this.bleIsShow){return;}
$(this.idShowDivContainer).hide();}
fadeShow.prototype.show=function(){$(this.idShowDivContainer).show().css('z-index','1000');}
function showAreaDiv(obj,thisObj){if(!arguments.callee.o){arguments.callee.o=new fadeShow(obj,"all-channel",thisObj);}
arguments.callee.o.show();}
function showQuick(obj,thisObj,showId,marginOptions){arguments.callee.o=new fadeShow(obj,showId,thisObj,marginOptions);arguments.callee.o.show();}
function view_left(o){var c1="current";var c2="";var obj=o.parentNode;if(obj.tagName.toUpperCase()=="LI"){obj.className=check_css(obj,c1)?obj.className.replace(c1,c2):obj.className.replace(c2,c1);}}
function check_css(o,c1){var found=false;var temparray=o.className.split(' ');for(var i=0;i<temparray.length;i++){if(temparray[i]==c1){found=true;}}
return found;}
function checkEmail(str){return/^(([\-\w]+)\.?)+@(([\-\w]+)\.?)+\.[a-zA-Z]{2,4}$/.test(str);}
if(navigator.appVersion.indexOf("MSIE 5.5")>=0||navigator.appVersion.indexOf("MSIE 6.0")>=0||navigator.appVersion.indexOf("MSIE 7.0")>=0){jQuery(ReloadSelectElement);;}
function ReloadSelectElement(){if(document.getElementsByTagName){var s=document.getElementsByTagName("select");if(s.length>0){window.select_current=new Array();for(var i=0,select;select=s[i];i++){jQuery(select).focus(function(){window.select_current[this.id]=this.selectedIndex;});jQuery(select).change(function(){restore(this);});emulate(select);}}}}
function restore(e){if(e.options[e.selectedIndex].disabled){e.selectedIndex=window.select_current[e.id];}}
function emulate(e){for(var i=0,option;option=e.options[i];i++){if(option.disabled){option.style.color="graytext";}else{option.style.color="menutext";}}}
function validateDate(str){var thePat = /^\d{4}-(0?[1-9]|1[0-2])-(0?[1-9]|[1-2]\d|3[0-1])$/;return thePat.test($.trim(str));}