function showModalDialog(c,f,k,g,b,d){k=k||{};var a=k.closeIcon||"../image/close.gif";a=absolutePath(a);c=absolutePath(c);var e;var h=frame_check(window);h.popParent=window;$.ajax({url:c,success:function(o){var p=$("<div>").addClass("popcover").appendTo(h);var q=function(){m.remove();n.remove();p.remove()};var l=$("<div>").addClass("closeButton").css({left:"2px",top:"2px"}).appendTo(p).bind("click",function(){q()}).append('<img src="'+a+'" />');var n=$("<div>").addClass("popdialog").css({width:k.width||"85%",height:k.height||"85%",left:k.left||"5%",top:k.top||"5%",display:"none"}).appendTo(h);var m=$("<iframe>").appendTo(n).attr("src",c).bind("load",function(){n.css({display:"block"})});showModalDialog.dialogArguments=f;showModalDialog.returnValue=function(r){q();ogPchangeData(r,g,b,d)};showModalDialog.cancel=function(){q()}}})}function frame_check(b){if(b.parent.document.URL==b.document.URL){return b.document.body}try{var a=$(b.parent.document.body);return frame_check(b.parent)}catch(c){return b.document.body}return b.document.body}function absolutePath(b){var a=document.createElement("span");a.innerHTML='<a href="'+b+'" />';return a.firstChild.href}function ogPchangeData(d,h,f,e){var b;if((d!=null)&&(typeof d!=="object")){d=new Array(d)}var g=new Array();if(d!=null&&f!=null){for(j=0;(j<f.length&&j<d.length);j++){if(f[j]!=""){tmp=h.form.elements[f[j]];if(tmp!=null){if(f[j].indexOf("h_")==0&&tmp.length){for(var c=0;c<tmp.length;c++){b=tmp[c].value;if(e=="true"){var a=getCaretPositionIE(tmp[c]);tmp[c].value=tmp[c].value.substring(0,a)+d[j]+tmp[c].value.substring(a,tmp[c].value.length)}else{tmp[c].value=d[j]}if(b!=d[j]){g[g.length]=tmp[c]}}}else{b=tmp.value;if(e=="true"){var a=getCaretPositionIE(tmp);tmp.value=tmp.value.substring(0,a)+d[j]+tmp.value.substring(a,tmp.value.length)}else{tmp.value=d[j]}if(b!=d[j]){g[g.length]=tmp}}}}}}for(i=0;i<g.length;i++){$(g[i]).change()}if(d!=null&&d[0]=="_RENEW"){if(d[1].indexOf("?")>0){location.href=d[1]+"&command=RENEW"}else{location.href=d[1]+"?command=RENEW"}}}function rtnPopup(a){window.returnValue=a;parent.document.body.popParent.showModalDialog.returnValue(a)}function ogPopup(q,m,a,b,n,l,d,p,t){var o,r,g,h,k,f,v,u,s,c;var e=function(y){y.focus();var x=document.selection.createRange();x.moveStart("character",-y.value.length);var w=x.text.length;return w};if(m!=null){o=m}if(a!=null){r=a}o=m?parseInt(m,10)+"px":"85%";r=a?parseInt(a,10)+"px":"85%";g=q+"?command="+(d?d:"NEW");h={};h.height=o;h.width=r;if(t){h.left=t.screenX+"px";h.top=t.screenY+"px"}if(b!=null){for(u=0;u<b.length;u+=2){g=g+"&"+b[u]+"="+encodeURIComponent(b[u+1])}}k="";if((l!=null)&&(document.getElementById(l[0]))){k=document.getElementById(l[0]).value}f=showModalDialog(g,k,h,n,l,p)};