function showModalDialog(c,b,a,h,g,e){a=a||{};var f=a.closeIcon||"../image/close.gif";var d;$.ajax({url:c,success:function(n){var o=$("<div>").addClass("popcover").appendTo(document.body);var p=function(){l.remove();m.remove();o.remove()};var k=$("<div>").addClass("closeButton").css({left:"2px",top:"2px"}).appendTo(o).bind("click",function(){p()}).append('<img src="'+f+'" />');var m=$("<div>").addClass("popdialog").css({width:a.width||"85%",height:a.height||"85%",left:a.left||"5%",top:a.top||"5%",display:"none"}).appendTo(document.body);var l=$("<iframe>").appendTo(m).attr("src",c).bind("load",function(){m.css({display:"block"})});showModalDialog.dialogArguments=b;showModalDialog.returnValue=function(q){p();ogPchangeData(q,h,g,e)};showModalDialog.cancel=function(){p()}}})}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.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)};