﻿; var ajRequest = Array(); var ajRequestCnt = -1;

 function ajaxRetry(id) { if(typeof(ajRequest[id]) != "object") return;  Rq = ajRequest[id]; getContent(Rq['url'], Rq['query'], Rq['cmd'], Rq['cmdOnError'], Rq['method']); ajRequest[id] = null; } 

function ajaxErMsg(url, query, cmd, cmdOnError, method, retry) { if(cmdOnError != ';' && cmdOnError != '') return; ajRequestCnt++;  var currentRequest ={ 'url' : url, 'query' : query, 'cmd' : cmd, 'cmdOnError' : cmdOnError, 'method' : method }; ajRequest[ajRequestCnt] = currentRequest; return '<p align="center" dir="rtl">'+ 'متأسفانه ارتباط با سرور سايت قطع شده است.<br />'+ 'لطفاً پس از بررسی وضعيت ارتباط خود با اينترنت دوباره سعی کنيد.'+ '<br /><br />'+ '<a class="blue" href="javascript:ajaxRetry('+ajRequestCnt+')">'+ 'درصورتيکه ارتباط شما با اينترنت مشکلی ندارد اينجا کليک کنيد.</a></p>'; } 

function jeval(mainCmd, alternatecmd) { if(typeof(mainCmd) == "object"){ while(postScripts.length) 

try{ jeval(postScripts.pop()); }catch(e){} return; } if(typeof(mainCmd) == "undefined") mainCmd = ';'; if(mainCmd == ';' || mainCmd == '') mainCmd = alternatecmd; 

try{ eval(mainCmd); }catch(e){ if(typeof(console) == "object") console.log("Error in Ajax Script Code:\n"+e+"\n\n"+mainCmd); } }

function createAjax() { 
try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {} 
try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} 
try { return new XMLHttpRequest(); } catch(e) {} return null; }

function getContent(url, query, cmd, cmdOnError, method, retry) { 
//alert(url);
if(typeof(query) == 'undefined') query = ''; 
try{ if(cmd.toUpperCase() == "GET" || cmd.toUpperCase() == "POST"){ method = cmd.toUpperCase(); cmd = ""; } }catch(e){} 
try{ if(cmdOnError.toUpperCase() == "GET" || cmdOnError.toUpperCase() == "POST"){ method = cmdOnError.toUpperCase(); cmdOnError = ""; } }catch(e){} if(typeof(cmdOnError)=='undefined') cmdOnError = ';'; if(typeof(method)=='undefined') method = 'GET'; else method = method.toUpperCase(); 
//alert(retry);
retry = (retry || 0); 
if(retry > 3){ 
Contents = ajaxErMsg(url, query, cmd, cmdOnError, method); jeval(cmdOnError, cmd); return; } var A = createAjax(); if(method == "GET") A.open(method, url+'?'+query+'&_r_=done'+Math.random(), true); else A.open(method, url, true); 

var onreadystatechange = function(i){ if(A.readyState==4) 
try{ 
//alert(A.status);
if(A.status==200 || A.status == 304){

 try{ Contents = A.responseText;
postScripts = Array(); 
var ScriptCode, regexp = /<script([^>]*)>([\s\S]*?)<\/script>/gi; 
while (ScriptCode = regexp.exec(Contents)){
 if(ScriptCode[1].toLowerCase().indexOf('postscript') == -1){ 
jeval(ScriptCode[2]); }else{ postScripts.push(ScriptCode[2]); } } jeval(cmd); jeval(postScripts); }

catch(e){ 
Contents = ajaxErMsg(url, query, cmd, cmdOnError, method); jeval(cmdOnError, cmd); } }else getContent(url, query, cmd, cmdOnError, method, (retry+1)); }catch(e){ Contents = ajaxErMsg(url, query, cmd, cmdOnError, method); jeval(cmdOnError, cmd); } }; 

A.onreadystatechange = onreadystatechange; 

if(method == "GET") A.send(null); 
else{ var contentType = "application/x-www-form-urlencoded; charset=UTF-8"; A.setRequestHeader("Content-Type", contentType); A.send(query+'&_r_=done'+Math.random()); } } 

function createQuery(formN,allowblank) { allowblank = (typeof(allowblank)=='undefined'? false : allowblank ); var elements = formN.elements; var pairs = new Array(); for (var i = 0; i < elements.length; i++) { if ((name = elements[i].name) && ((value = elements[i].value) || allowblank)) if(elements[i].type == "radio" || elements[i].type == "checkbox"){ if(elements[i].checked) pairs.push(name + "=" + encodeURIComponent(value)); }else pairs.push(name + "=" + encodeURIComponent(value)); } return pairs.join("&"); } 

function xFormReset(formN) { if(typeof('formN') != 'object') formN = $(formN); var elements = formN.elements; for (var i = 0; i < elements.length; i++) { if ((name = elements[i].name) && (value = elements[i].value)) if(elements[i].type == "radio" || elements[i].type == "checkbox") elements[i].checked = false; else elements[i].value = ''; } }

function xtoggleCkeckbox(formN, tvalue, pattern) { if(typeof(pattern) == "undefined") pattern = 'id:'; if(typeof(pattern) == "undefined") pattern = '2'; attrib = pattern.split(':')[0].toLowerCase(); pattern = pattern.split(':')[1]; if(typeof('formN') != 'object') formN = $(formN); var elements = formN.elements; for (var i = 0; i < elements.length; i++) if(elements[i].type == "radio" || elements[i].type == "checkbox"){ 

try{ if((attrib == 'id' && elements[i].id.indexOf(pattern) != -1) || (attrib == 'name' && elements[i].name.indexOf(pattern) != -1)) elements[i].checked = (tvalue==1||tvalue==0)?tvalue:!elements[i].checked; }catch(e){} } } 

function array2string(inArray) { var out = ''; var key; for(key in inArray) if(typeof(inArray[key]) != 'function') out += inArray[key]+'*'; if(out.length > 1) if(out.substr(out.length - 1) == '*') out = out.substr(0, out.length - 1); return out; }; 

var $ = function (eName) { return document.getElementById(eName); }; 

function E_(num) { num = String(num); num = (num).replace(/۰/g, '0'); num = (num).replace(/۱/g, '1'); num = (num).replace(/۲/g, '2'); num = (num).replace(/۳/g, '3'); num = (num).replace(/۴/g, '4'); num = (num).replace(/۵/g, '5'); num = (num).replace(/۶/g, '6'); num = (num).replace(/۷/g, '7'); num = (num).replace(/۸/g, '8'); num = (num).replace(/۹/g, '9'); num = (num).replace(/٤/g, '4'); num = (num).replace(/٥/g, '5'); num = (num).replace(/٦/g, '6'); return num; } 

function F_(num) { num = String(num); num = (num).replace(/0/g, '۰'); num = (num).replace(/1/g, '۱'); num = (num).replace(/2/g, '۲'); num = (num).replace(/3/g, '۳'); num = (num).replace(/4/g, '۴'); num = (num).replace(/5/g, '۵'); num = (num).replace(/6/g, '۶'); num = (num).replace(/7/g, '۷'); num = (num).replace(/8/g, '۸'); num = (num).replace(/9/g, '۹'); return num; } 

function xgoTo(url) { document.location.href = url; } 

function xFindPosX(obj) { if(typeof(obj) != "object") obj = $(obj); var curleft = 0; if (obj.offsetParent){ while (obj.offsetParent){ curleft += obj.offsetLeft; obj = obj.offsetParent; } } else if (obj.x) curleft += obj.x; return curleft; } 

function xFindPosY(obj) { if(typeof(obj) != "object") obj = $(obj); var curtop = 0; if (obj.offsetParent){ while (obj.offsetParent){ curtop += obj.offsetTop; obj = obj.offsetParent; } } else if (obj.y) curtop += obj.y; return curtop; } 

function xRemovePX(strNum) { return strNum.substr(0, strNum.length - 2) * 1; }

function xArraySearch(value, array) { var key; for (key in array) if(typeof(array[key]) != 'function') { if (value === array[key]) { return key; } } return false; } 

function xGetInt(str, float) { if(typeof(float) == "undefined") float = false; var STR = ""; var neg = (str.charAt(0) == '-')?true:false; for(var i=0; i<str.length; i++) if(str.charAt(i) in ['0','1','2','3','4','5','6','7','8','9']) STR += str.charAt(i); else if(float && str.charAt(i) == '.') STR += '.'; if(neg) return STR * -1; else return STR * 1; } 

function xDigitGroup(str) { str = str+''; var len = str.length; var newstr = str.charAt(len-1); for (var i=1; i<len; i++) { if ((i % 3)==0) newstr = ','+newstr; newstr = str.charAt(len-1-i)+newstr; } return newstr; } 

function xMakeVisible(obj, d) { if(!obj) return; 
try{ if(typeof(d) == "undefined") d = false; if(typeof(obj) != "object") obj = $(obj); if(!d) obj.style.display = ''; obj.style.visibility = "visible"; }catch(e){} } 

function xMakeHidden(obj, d) { if(!obj) return;

 try{ if(typeof(d) == "undefined") d = false; if(typeof(obj) != "object") obj = $(obj); if(!d) obj.style.display = 'none'; obj.style.visibility = "hidden"; }catch(e){} } 

function xtoggleObj(Obj, Cmd) { if(Obj.indexOf(':') == -1){ Obj = Obj.split(','); for(key in Obj) 

try{ if(typeof(Obj[key]) == "string") Obj[key] = $(Obj[key]); if(Obj[key].style.display == "none" || Obj[key].style.visibility == "hidden") xMakeVisible(Obj[key]); else xMakeHidden(Obj[key]); } catch(e){} }else{ HideObj = Obj.substr(0, Obj.indexOf(':')).split(','); VisibleObj = Obj.substr(Obj.indexOf(':')+1).split(','); for(key in HideObj) try{ if(typeof(HideObj[key]) == 'string') xMakeHidden(HideObj[key]); }catch(e){} for(key in VisibleObj) try{ if(typeof(VisibleObj[key]) == 'string') xMakeVisible(VisibleObj[key]); }catch(e){} } if(typeof(Cmd) != 'undefined') try{ eval(Cmd); }catch(e){} } 

function xsetCookie(cookieName, cookieValue, path, domain, expires, secure) { if(expires == '' || typeof(expires) == "undefined"){ expires = new Date(); expires.setMonth(expires.getMonth()+1) ; } if(typeof(domain) == "undefined") domain = document.location.href.replace(/\w+\:\/\/([^\/]+)(.*)/, '$1'); if(typeof(path) == "undefined") path = document.location.href.replace(/\w+\:\/\/([^\/]+)(.*)\/\w+\.\w+/, '$2'); try{ document.cookie = escape(cookieName) + '=' + escape(cookieValue) + (expires ? '; EXPIRES=' + expires.toGMTString() : '') + (path ? '; PATH=' + path : '') + (domain ? '; DOMAIN=' + domain : '') + (secure ? '; SECURE' : ''); }catch(e){} } 

function xgetCookie(cookieName) { var cookieValue = null; var posName = document.cookie.indexOf(escape(cookieName) + '='); if (posName != -1){ var posValue = posName + (escape(cookieName) + '=').length; var endPos = document.cookie.indexOf(';', posValue); if (endPos != -1){ cookieValue = unescape(document.cookie.substring(posValue, endPos)); } else{ cookieValue = unescape(document.cookie.substring(posValue)); } } return cookieValue; } var browser = 'unknown'; Mbr = navigator.userAgent.toLowerCase(); if (Mbr.indexOf("opera") != -1) browser = 'opera'; else if (Mbr.indexOf("msie") != -1) browser = 'msie'; else if (Mbr.indexOf("gecko") != -1) browser = 'gecko'; var _xImages = new Array(); 

function xloadImages() { var i,key; for (i=0; i<_xloadImages.arguments.length; i++) { if (typeof(_xloadImages.arguments[i]) == 'string') { _xImages.push(document.createElement('img')); _xImages[_xImages.length-1].src = _xloadImages.arguments[i]; } else if (typeof(_xloadImages.arguments[i]) == 'object') for(key in _xloadImages.arguments[i]) if(typeof(_xloadImages.arguments[i][key]) != 'function') { _xImages.push(document.createElement('img')); _xImages[_xImages.length-1].src = _xloadImages.arguments[i][key]; } } } _xloadImages = xloadImages; 

function xBtnCreate(obj, cmd, cmd2, type) { if(typeof(cmd2) == "undefined") cmd2 = ""; if(typeof(type) == "undefined") type = "normal"; if(type == "check"){ oName = (obj.name)?obj.name:obj.id; if(oName.length < 1) oName = "rcoId"+Math.round(Math.random()*9999); var Obj = document.createElement('input'); Obj.type = 'hidden'; Obj.name = oName+"IN"; Obj.id = oName+"IN"; Obj.value = 0; obj.parentNode.appendChild(Obj); if(!obj.id) obj.id = oName; } var img = new Array(); var tmp = obj.src.split('../map/images/'); img['path'] = tmp[0]+"../map/images/"; tmp = tmp[1].split('.'); img['img'] = tmp[0]; img['ext'] = tmp[1]; if(typeof(img['img']) == 'undefined' || img['img'] == 'undefined' ) return; _xloadImages (img['path']+img['img']+"."+ img['ext'], img['path']+img['img']+"-over"+"."+img['ext'], img['path']+img['img']+"-down"+"."+img['ext'] ); obj.style.cursor = "pointer"; 

doWhileUp = function(OBJid, CMD, targetV1, targetV2){ try{ OBJ = $(OBJid); if(OBJ.src != targetV1 && OBJ.src != targetV2){ eval(CMD); setTimeout("doWhileUp('"+OBJid+"', '"+CMD+"', '"+targetV1+"', '"+targetV2+"')", 50); } } catch(e){} }; 

obj.onmouseover = function(){ if(obj.src == img['path']+img['img']+"-down."+img['ext']) obj.src=img['path']+img['img']+"-down-over."+img['ext']; else obj.src=img['path']+img['img']+"-over."+img['ext']; }; 

obj.onmouseout = function(){ if(obj.src == img['path']+img['img']+"-down-over."+img['ext']) obj.src=img['path']+img['img']+"-down."+img['ext']; else obj.src=img['path']+img['img']+"."+img['ext']; }; 

obj.onmouseup = function(){ if(type == "check"){ if ($(obj.id+"IN").value == '0') obj.src=img['path']+img['img']+"-down-over."+img['ext']; else obj.src=img['path']+img['img']+"-over."+img['ext']; $(obj.id+"IN").value = ($(obj.id+"IN").value == '1')?0:1; }else obj.src=img['path']+img['img']+"-over."+img['ext']; }; 

obj.onmousedown = function(){ obj.src=img['path']+img['img']+"-down."+img['ext']; if(typeof(cmd2) != "undefined" && cmd2.length > 0) doWhileUp(obj.id, cmd2, img['path']+img['img']+"-over."+img['ext'], img['path']+img['img']+"."+img['ext']); }; 

obj.onclick = function(){ try{ eval(cmd); } catch(e){} }; 

obj.onload = function(){ }; 

obj.ondblclick = function(){ obj.src=img['path']+img['img']+"."+img['ext']; }; } 

function opacity(Oid, opacStart, opacEnd, millisec, cmd) { var speed = Math.round(millisec / 100); var timer = 0; if(typeof(cmd) == "undefined") cmd = ";"; if(opacStart > opacEnd) { for(i = opacStart; i >= opacEnd; i--){ setTimeout("changeOpac(" + i + ",'" + Oid + "')",(timer * speed)); timer++; } } else if(opacStart < opacEnd){ for(i = opacStart; i <= opacEnd; i++){ setTimeout("changeOpac(" + i + ",'" + Oid + "')",(timer * speed)); timer++; } } setTimeout("try{"+cmd+"}catch(e){};",(timer * speed)); } 

function changeOpac(opacity, Oid) { try{ var object = $(Oid); }catch(e){} if(typeof(object) != "object") return; object = object.style; object.opacity = (opacity / 100); object.MozOpacity = (opacity / 100); object.KhtmlOpacity = (opacity / 100); object.filter = "alpha(opacity=" + opacity + ")"; } 

function moveIt(obj, attr, start, end, cmd, speed) { if(typeof(obj) != "object") obj = $(obj); if(typeof(speed) == "undefined") speed = 9; if(typeof(attr) == "undefined") attr = 'style.left'; var step = Math.round(Math.abs(start-end)/speed); var move = Math.abs(end - start); var startPos = start; for(i=0;i<=step;i++){ move = Math.ceil((end - startPos)/speed); if(start > end) move --; if((startPos+move >= end && start <= end) || (startPos+move <= end && start > end)) break; setTimeout('$("'+obj.id+'").'+attr+' = "'+(startPos+move)*-1+'px";', i*50); startPos += move; } setTimeout('$("'+obj.id+'").'+attr+' = "'+end*-1+'px";', i*50); setTimeout('try{'+cmd+';}catch(e){}', i*50); } var xkbFarsi = true ; var xkbTarget = null; var xkbMap = { 39:1711, 126:215, 44:1608, 59:1603, 63:1567, 98:1584, 68:1610, 100:1610, 71:1604, 103:1604, 72:1570, 124:247, 78:1583, 110:1583, 77:1569, 116:1601, 66:1573, 91:1580, 92:1662, 93:1670, 96:1662, 65:1588, 97:1588, 67:1688, 99:1586, 88:1610, 69:1579, 101:1579, 70:1576, 102:1576, 104:1575, 73:1607, 105:1607, 74:1578, 106:1578, 75:1606, 107:1606, 76:1605, 108:1605, 109:1574, 78:1583, 110:1583, 79:1582, 111:1582, 80:1581, 112:1581, 81:1590, 113:1590, 82:1602, 114:1602, 87:1587, 119:1587, 85:1593, 117:1593, 86:1585, 118:1585, 87:1589, 119:1589, 120:1591, 89:1594, 121:1594, 90:1592, 122:1592, 44:1608, 84:1548, 83:1587, 115:1587, 48:1776, 49:1777, 50:1778, 51:1779, 52:1780, 53:1781, 54:1782, 55:1783, 56:1784, 57:1785 }; 

function xConvertFarsi(fld,e, kbStat) { xkbTarget = e.target; if(typeof(kbStat) == "undefined") kbStat = xkbFarsi; if(!kbStat) return true; k =(browser == "msie") ? event.keyCode : e.which ; if (xkbFarsi && typeof(xkbMap[k])=='number') { if (browser == "msie") event.keyCode = xkbMap[k] ; else if (browser == 'gecko') { var EVT = document.createEvent("KeyEvents") ; EVT.initKeyEvent("keypress", true, true, document.defaultView, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, 0, String.fromCharCode(xkbMap[k]).charCodeAt(0)) ; e.preventDefault() ; e.target.dispatchEvent(EVT) ; } else if (browser == 'opera') { fld.value = fld.value + String.fromCharCode(xkbMap[k]); return false ; } } } 

function xChangeLang(kbStat, Objid) { kbVar = (typeof(kbStat) == "undefined")?'xkbFarsi':kbStat; kbStat = eval(kbVar); kbStat = !kbStat; eval(kbVar+' = '+kbStat); if(kbStat){ for(i=1;i<=22;i++) setTimeout('$("'+Objid+'").style.backgroundPosition = "0 -'+i+'px";', i*10); }else{ for(i=21;i>=0;i--) setTimeout('$("'+Objid+'").style.backgroundPosition = "0 -'+i+'px";', 210-i*10); } $(Objid).blur(); try{ xkbTarget.focus(); }catch(e){} } 

function xresizeWindow(w, h) { if(typeof(w) == "undefined"){ w = screen.width; h = screen.height; } if(typeof(h) == "undefined") h = w; if(window.innerWidth){ window.innerWidth = w; window.innerHeight = h; }else window.resizeTo(w+30, h+100); } 

var Class = function(properties) { var klass = function(){ if (this.initialize && arguments[0] != 'noinit') return this.initialize.apply(this, arguments); else return this; }; for (var property in this) klass[property] = this[property]; klass.prototype = properties; return klass; }; 

Class.empty = function(){}; Class.prototype = { extend: function(properties){ var pr0t0typ3 = new this('noinit'); 

var parentize = function(previous, current){ if (!previous.apply || !current.apply) return false; return function(){ this.parent = previous; return current.apply(this, arguments); }; }; for (var property in properties){ var previous = pr0t0typ3[property]; var current = properties[property]; if (previous && previous != current) current = parentize(previous, current) || current; pr0t0typ3[property] = current; } return new Class(pr0t0typ3); }, implement: function(properties){ for (var property in properties) this.prototype[property] = properties[property]; } }; ; 

var xpopupWin = new Class({ initialize: function(name, OBJ, width, caption){ this.winMainPage = 'map/'; this.winObj = OBJ; this.winName = name; this.winCaption = (typeof(caption)=='undefined')?OBJ:caption; this.winStatus = 'none'; this.winLastPage = ''; this.winHtml = '<table border="0" cellpadding="0" cellspacing="0" style="width:100%;">'+ '<tr>'+ '<td style="background:url(../map/images/xwindows.gif) left -305px; width:15px; height:15px"></td>'+ '<td style="background:url(../map/images/xwindows.gif) repeat 0px -365px ;height:15px"></td>'+ '<td style="background:url(../map/images/xwindows.gif) left -320px; width:15px; height:15px"></td>'+ '</tr>'+ '<tr>'+ '<td style="width:15px;background:url(../map/images/xwindowsBG.gif) repeat"></td>'+ '<td>'+ '<div>'+ '<div style="width:100%;height:23px;background:url(../map/images/xwindows.gif) repeat-x 0px -495px;border:1px solid #969696;border-bottom:0;">'+ '<img src="../map/images/blank.gif" id="'+this.winName+'BtnClose" width="19" height="19" alt="" title="بستن پنجره" style="margin:2px 4px 2px 2px; float:right" />'+ '<img src="../map/images/blank.gif" id="'+this.winName+'BtnNewOpen" width="19" height="19" alt="" title="نمايش در پنجره مجزا" style="margin:2px 0px; float:right;" />'+ '<img src="../map/images/blank.gif" id="'+this.winName+'BtnMinimize" width="19" height="19" alt="" title="تغيير وضعيت پنجره" style="margin:2px; float:right" />'+ '<img src="../map/images/blank.gif" id="'+this.winName+'BtnReload" width="19" height="19" alt="" title="بارگذاری مجدد" style="margin:2px 5px; float:right" />'+ '<div id="'+this.winName+'Title" style="width:140px;float:right;padding:2px 10px 0;text-align:right"></div>'+ '</div>'+ '<div style="width:100%; background:#FFFFFF;border:1px solid #969696; border-bottom:0;">'+ '<table id="'+this.winName+'MainTable" border="0" cellpadding="0" cellspacing="5" style="width:100%;; background:#DADADA">'+ '<tr>'+ '<td align="center" id="'+this.winName+'Container">'+ '</td>'+ '</tr>'+ '</table>'+ '</div>'+ '<div style="width:100%;height:20px;background:#FFFFFF url(../map/images/xwindows.gif) no-repeat left -475px;text-align:right;border:1px solid #969696;color:#666666;" id="'+this.winName+'Status"></div>'+ '</div>'+ '</td>'+ '<td style="width:15px;background:url(../map/images/xwindowsBG.gif) repeat"></td>'+ '</tr>'+ '<tr>'+ '<td style="background:url(../map/images/xwindows.gif) left -335px; width:15px; height:15px"></td>'+ '<td style="background:url(../map/images/xwindows.gif) repeat 0px -365px ;height:15px"></td>'+ '<td style="background:url(../map/images/xwindows.gif) left -350px; width:15px; height:15px"></td>'+ '</tr>'+ '</table>'; this.loadingHtml = '<div class="whiteBoxHolder" style="margin:0; width:300px;text-align:left">'+ '<div class="BoxHeader"><div></div></div>'+ '<div class="BoxContent" style="margin:0; padding:100px 0;">'+ '<table border="0" cellpadding="0" cellspacing="0" width="100px" style="margin:0 auto">'+ '<tr>'+ '<td align=center>لطفاً صبر کنيد</td>'+ '<td><img src="../map/images/iconTimeout.gif" width="1" height="1" style="visibility:hidden" alt="" /><img src="../map/images/loading.gif" width="16" height="16" alt="" /></td>'+ '</tr>'+ '</table>'+ '</div>'+ '<div class="BoxFooter""><div></div></div>'+ '</div>'; this.errorHtml = '<div class="whiteBoxHolder" style="margin:0; width:300px;text-align:left">'+ '<div class="BoxHeader"><div></div></div>'+ '<div class="BoxContent" style="margin:0; padding:100px 0;">'+ '<table border="0" cellpadding="0" cellspacing="0" width="300" style="margin:0 auto; text-align:right; padding:20px;">'+ '<tr>'+ '<td></td>'+ '<td><img src="../map/images/iconTimeout.gif" width="24" height="24" alt="" /></td>'+ '</tr>'+ '<tr>'+ '<td colspan="2" style="text-align:right;">دريافت اطلاعات با مشکل مواجه شد. لطفاً بعد از بررسی ارتباط خود با اينترنت دوباره سعی کنيد</td>'+ '</tr>'+ '</table>'+ '</div>'+ '<div class="BoxFooter""><div></div></div>'+ '</div>'; this.miniHtml = '<div style="width:100%;height:23px;background:url(../map/images/xwindows.gif) repeat-x 0px -495px;border:1px solid #969696;">'+ '<img src="../map/images/blank.gif" id="'+this.winName+'BtnCloseMini" width="19" height="19" alt="" title="بستن پنجره" style="margin:2px 4px 2px 2px; float:right" />'+ '<img src="../map/images/blank.gif" id="'+this.winName+'BtnMaximizeMini" width="19" height="19" alt="" title="بزرگ کردن پنجره" style="margin:2px; float:right;" />'+ '<div id="'+this.winName+'miniTitle" style="width:140px;float:left;padding:2px 0 0 10px;"></div>'+ '</div>'; this.winHolder = "xpopupHolder" + this.winName; this.winWidth = (typeof(width) == "undefined")?200:width; this.winPage = ''; this.winCmd = ''; this.winDirectUrl = ''; this.onClose = ''; this.onOpen = ''; this.onMinimize = ''; this.onMaximize = ''; this.onLoad = ''; this.imageUrl = '../map/images/xwindows.gif'; this.imgObj = null; }, create: function(){ 
var Obj = document.createElement('div'); Obj.id = this.winHolder; Obj.style.width = "750px"; Obj.style.position = "absolute"; Obj.style.top = "100px"; Obj.style.left = "100px"; document.getElementsByTagName('body')[0].appendChild(Obj); Obj.innerHTML = this.winHtml; this.winStatus = 'created'; this.imgObj = new xBtn(this.imageUrl); this.loadbtn(1); }, loadbtn: function(whiche){ switch(whiche){ case 1: this.imgObj.create(this.winName+'BtnClose', 0, 1, this.winObj+'.hide(this);'); this.imgObj.create(this.winName+'BtnMinimize', 114, 1, this.winObj+'.minimize(this);'); this.imgObj.create(this.winName+'BtnReload', 171, 1, this.winObj+'.reload(this);'); break; case 2: this.imgObj.create(this.winName+'BtnCloseMini', 0, 1, this.winObj+'.hide(this);'); this.imgObj.create(this.winName+'BtnMaximizeMini', 57, 1, this.winObj+'.maximize(this);'); break; } },

show: function(page, cmd){ 
if(this.winStatus == 'none') this.create();
this.maximize();
$(this.winHolder).style.width = (this.winWidth*1+50) +"px"; 
this.winPage = page; 
this.winCmd = cmd; 
if(this.winLastPage != page+"#"+cmd) { this.loading(); this.fetch(); } 
this.winLastPage = page+"#"+cmd; var sw = document.getElementsByTagName("body")[0].clientWidth || screen.width; var sl = Math.round((sw - this.winWidth )/2); 
st = 90+document.documentElement.scrollTop-0; 
$(this.winHolder).style.top = st + 'px'; 
$(this.winHolder).style.left = sl + 'px'; 
xMakeVisible(this.winHolder); 
this.winStatus = 'visible'; 
$(this.winName+'Title').innerHTML = this.winCaption; 
var cmd = this.onOpen.split(';'); 
for(key in cmd) try{ eval(cmd[key]); }catch(e){} },
hide: function(){ if(this.winStatus == 'none') return; xMakeHidden(this.winHolder); try{ xMakeHidden(this.winName+'mini'); }catch(e){} this.winStatus = 'hidden'; var cmd = this.onClose.split(';'); for(key in cmd) try{ eval(cmd[key]); }catch(e){} }, loading: function(){ $(this.winName+"Container").innerHTML = this.loadingHtml; }, fetch: function(){ this.winDirectUrl = ''; this.checkdirect(); this.status("درحال بارگذاری..."); getContent( this.winMainPage, 'section=guest&module='+this.winPage+'&'+this.winCmd, '$("'+this.winName+'Container").innerHTML = Contents;'+ this.winObj+'.status("انجام شد");'+ this.winObj+'.checkdirect();'+ 'eval(\''+this.onLoad+'\');', this.winObj+'.error();', 'GET' ); }, reload: function(){ this.loading(); this.fetch(this.winPage, this.winCmd); }, status: function(text){ $(this.winName+"Status").innerHTML = "<div style='direction:rtl'>&nbsp;&nbsp;&nbsp;" + text + "&nbsp;&nbsp;&nbsp;</div>"; }, maximize: function(){ var cmd = this.onMaximize.split(';'); for(key in cmd) try{ eval(cmd[key]); }catch(e){} var sw = document.getElementsByTagName("body")[0].clientWidth || screen.width; var sl = Math.round((sw - this.winWidth )/2); st = 90+document.documentElement.scrollTop-0; $(this.winHolder).style.top = st + 'px'; $(this.winHolder).style.left = sl + 'px'; if($('fixBox')){ try{ xMakeHidden(this.winName+'mini'); }catch(e){} xMakeVisible(this.winHolder); }else{ xMakeVisible(this.winName+'MainTable'); this.imgObj.create(this.winName+'BtnMinimize', 114, 1, this.winObj+'.minimize();'); } this.winStatus = 'visible'; }, minimize: function(){ if(this.winStatus != 'visible') return; if($('fixBox')){ xMakeHidden(this.winHolder); this.makemini(); xMakeVisible(this.winName+'mini'); }else{ xMakeHidden(this.winName+'MainTable'); this.imgObj.create(this.winName+'BtnMinimize', 57, 1, this.winObj+'.maximize();'); } this.winStatus = 'minimize'; var cmd = this.onMinimize.split(';'); for(key in cmd) try{ eval(cmd[key]); }catch(e){} }, makemini: function(){ if(!$(this.winName+'mini')){ var Obj = document.createElement('div'); Obj.id = this.winName+'mini'; Obj.style.width = "200px"; Obj.style.margin = "0px 2px"; Obj.style.cssFloat = "left"; $('fixBox').appendChild(Obj); Obj.innerHTML = this.miniHtml; this.loadbtn(2); } $(this.winName+'miniTitle').innerHTML = this.winCaption; }, checkdirect:function(){ if(this.winDirectUrl.length <= 1){ this.imgObj.show(this.winName+'BtnNewOpen', 285, 0); }else{ this.imgObj.create(this.winName+'BtnNewOpen', 228, 1, this.winObj+'.opennewwin();'); } }, error: function(){ this.status("اشکال در دريافت اطلاعات!"); $(this.winName+"Container").innerHTML = this.errorHtml; }, opennewwin: function(){ if(this.winDirectUrl != ''){ window.open(this.winDirectUrl, '_blank'); }else{ xHint($(this.winName+'BtnNewOpen'), 'متأسفانه لينک مستقيم به اين قسمت وجود ندارد\nلطفاً پس از تکميل بارگذاری دوباره سعی نمائيد', 'لينک مستفيم', 'error', 270, 'rtl', 5); } } }); 

var xpopupBox = new Class({ initialize: function(name, Obj, width, parent){ 
this.boxMainPage = '../map/index.php'; 
this.boxName = name;
this.boxObj = Obj;
this.boxHolder = "popupBoxHolder"+name;
this.boxWidth = (width+62)||350;
this.boxHtml = '<table border="0" cellpadding="0" cellspacing="0" width="'+this.boxWidth+'">'+ '<tr>'+ '<td  style="background:url(../map/images/xwindows.gif) left -305px; width:15px; height:15px"></td>'+ '<td style="background:url(../map/images/xwindows.gif) repeat 0px -365px ;height:15px"></td>'+ '<td style="background:url(../map/images/xwindows.gif) left -320px; width:15px; height:15px"></td>'+ '</tr>'+ '<tr>'+ '<td style="width:15px;background:url(../map/images/xwindowsBG.gif) repeat"></td>'+ '<td style="background:#DADADA; padding:5px;">'+ '<div class="whiteBoxHolder" style="text-align:left; padding:0;width:100%;">'+ '<div class="BoxHeader"><div></div></div>'+ '<div class="BoxContent" style="padding:0px 4px 4px;text-align:right;">'+ '<img src="../map/images/blank.gif" id="'+this.boxName+'BtnClose" width="18" height="18" alt="" border="0" />'+ '</div>'+ '<div class="BoxLine"></div>'+ '<div class="BoxContent" style="padding:0;" id="'+this.boxName+'Cont">'+ '</div>'+ '<div class="BoxFooter"><div></div></div>'+ '</div>'+ '</td>'+ '<td style="width:15px;background:url(../map/images/xwindowsBG.gif) repeat;"></td>'+ '</tr>'+ '<tr>'+ '<td style="background:url(../map/images/xwindows.gif) left -335px; width:15px; height:15px"></td>'+ '<td style="background:url(../map/images/xwindows.gif) repeat 0px -365px ;height:15px"></td>'+ '<td style="background:url(../map/images/xwindows.gif) left -350px; width:15px; height:15px"></td>'+ '</tr>'+ '</table>'; this.loadingHtml = '<table width=100% border="0" cellpadding="0" cellspacing="0" width="100px" style="dir=rtl;margin:0 auto">'+ '<tr>'+ '<td colspan="2" height="50"></td>'+ '</tr>'+ '<tr>'+ '<td align=right>لطفاً صبر کنيد&nbsp;&nbsp;</td>'+ '<td width="43%"><img src="../map/images/loading.gif" width="16" height="16" alt="" /></td>'+ '</tr>'+ '<tr>'+ '<td colspan="2" height="50"></td>'+ '</tr>'+ '</table>';

this.boxParent = (typeof(parent)=="object")?parent:$(parent); this.boxPage = ''; 
this.boxCmd = ''; 
this.boxStatus = 'none';
this.imgObj = null; this.imageUrl = '../map/images/xwindows.gif'; 
this.onClose = ''; this.onOpen = ''; }, 

create: function(){ 
var Obj = document.createElement('div');
Obj.id = this.boxHolder;
Obj.style.position = 'absolute';
document.getElementsByTagName('body')[0].appendChild(Obj);
$(this.boxHolder).innerHTML = this.boxHtml;
this.boxStatus = 'created'; this.imgObj = new xBtn(this.imageUrl); this.imgObj.create(this.boxName+'BtnClose', 390, 1, this.boxObj+'.hide(this);'); }, 
show: function(page, cmd, obj, cmdAfterDone){ if(typeof(obj)=="undefined" && typeof(page)=="string" && page.length>50){ this.view(page, cmd); return; } if(typeof(page) != "undefined") this.boxPage = page; if(typeof(cmdAfterDone) != "undefined") this.onOpen = cmdAfterDone; if(typeof(cmd) != "undefined") this.boxCmd = cmd; if(typeof(obj) != "undefined") this.boxParent = (typeof(obj) == "object")?obj:$(obj); if(this.boxStatus == 'none') this.create(); $(this.boxHolder).style.zIndex = 50000; $(this.boxHolder).style.width = this.boxWidth+"px"; this.loading(); this.fetch(page); var sw = document.getElementsByTagName("body")[0].clientWidth || screen.width; var sl = Math.round((sw - this.boxWidth )/2); sl = (xFindPosX(this.boxParent)+10)||sl; if((sl*1 + this.boxWidth*1)> sw) sl = sw - this.boxWidth - 50; st = 50+document.documentElement.scrollTop-0; $(this.boxHolder).style.top = (xFindPosY(this.boxParent)+5||st) + 'px'; $(this.boxHolder).style.left = sl + 'px'; xMakeVisible(this.boxHolder); this.boxStatus = 'visible'; }, 
view: function(page, obj){ this.boxPage = 'staticPage'+Math.random(); if(typeof(obj) != "undefined") this.boxParent = (typeof(obj) == "object")?obj:$(obj); if(this.boxStatus == 'none') this.create(); $(this.boxHolder).style.zIndex = 50000; $(this.boxHolder).style.width = this.boxWidth+"px"; $(this.boxName+'Cont').innerHTML = page; var sw = document.getElementsByTagName("body")[0].clientWidth || screen.width; var sl = Math.round((sw - this.boxWidth )/2); sl = (xFindPosX(this.boxParent)+10)||sl; if((sl*1 + this.boxWidth*1)> sw) sl = sw - this.boxWidth - 50; st = 50+document.documentElement.scrollTop-0; $(this.boxHolder).style.top = (xFindPosY(this.boxParent)+5||st) + 'px'; $(this.boxHolder).style.left = sl + 'px'; xMakeVisible(this.boxHolder); this.boxStatus = 'visible'; }, 
reshow: function(){ if(this.boxStatus == 'none') this.show(); xMakeVisible(this.boxHolder); this.boxStatus = 'visible'; try{ eval(this.onOpen); }catch(e){} }, 

hide: function(){ if(this.boxStatus == 'none') return; xMakeHidden(this.boxHolder); this.boxStatus = 'hidden'; try{ eval(this.onClose); }catch(e){} }, 

loading: function(){ $(this.boxName+"Cont").innerHTML = this.loadingHtml; }, 

fetch: function(){ getContent(this.boxMainPage, 'section=guest&module='+this.boxPage+'&'+this.boxCmd+'&'+Math.round(), '$("'+this.boxName+'Cont").innerHTML = Contents;'+ 'try{eval('+this.boxObj+'.onOpen);}catch(e){alert(e)}', '', 'GET' ); } }); 

var xpopupImg = new Class({ initialize: function(name, Obj, width, parent){ this.boxName = name; this.boxObj = Obj; this.boxHolder = "popupBoxHolder"+name; this.boxWidth = (width||550) + 62;
this.boxHtml = '<table border="0" cellpadding="0" cellspacing="0" width="100%">'+ '<tr>'+ '<td style="background:url(../map/images/xwindows.gif) left -305px; width:15px; height:15px"></td>'+ '<td style="background:url(../map/images/xwindows.gif) repeat 0px -365px ;height:15px"></td>'+ '<td style="background:url(../map/images/xwindows.gif) left -320px; width:15px; height:15px"></td>'+ '</tr>'+ '<tr>'+ '<td style="width:15px;background:url(../map/images/xwindowsBG.gif) repeat"></td>'+ '<td style="background:#DADADA; padding:5px;">'+ '<div class="whiteBoxHolder" style="text-align:left; padding:0;width:100%;">'+ '<div class="BoxHeader"><div></div></div>'+ '<div class="BoxContent" style="padding:0px 4px 4px;text-align:right;">'+ '<img src="../map/images/blank.gif" id="'+this.boxName+'BtnClose" width="18" height="18" alt="" border="0" />'+ '</div>'+ '<div class="BoxLine"></div>'+ '<div class="BoxContent" style="padding:5px 11px;" id="'+this.boxName+'Cont">'+ '</div>'+ '<div class="BoxFooter"><div></div></div>'+ '</div>'+ '</td>'+ '<td style="width:15px;background:url(../map/images/xwindowsBG.gif) repeat"></td>'+ '</tr>'+ '<tr>'+ '<td style="background:url(../map/images/xwindows.gif) left -335px; width:15px; height:15px"></td>'+ '<td style="background:url(../map/images/xwindows.gif) repeat 0px -365px ;height:15px"></td>'+ '<td style="background:url(../map/images/xwindows.gif) left -350px; width:15px; height:15px"></td>'+ '</tr>'+ '</table>'; this.loadingHtml = '<table border="0" cellpadding="0" cellspacing="0" width="100px" style="margin:0 auto">'+ '<tr>'+ '<td colspan="2" height="50"></td>'+ '</tr>'+ '<tr>'+ '<td>لطفاً صبر کنيد</td>'+ '<td><img src="../map/images/loading.gif" width="16" height="16" alt="" /></td>'+ '</tr>'+ '<tr>'+ '<td colspan="2" height="50"></td>'+ '</tr>'+ '</table>'; this.boxParent = (typeof(parent)=="object")?parent:$(parent); this.bottomUrl = ''; this.boxStatus = 'none'; this.imgObj = null; this.imageUrl = '../map/images/xwindows.gif'; this.imgLoad = ''; }, 

create: function(){ var Obj = document.createElement('div'); Obj.id = this.boxHolder; Obj.style.position = 'absolute'; document.getElementsByTagName('body')[0].appendChild(Obj); $(this.boxHolder).innerHTML = this.boxHtml; this.boxStatus = 'created'; this.imgObj = new xBtn(this.imageUrl); this.imgObj.create(this.boxName+'BtnClose', 390, 1, this.boxObj+'.hide(this);'); }, 
show: function(){ if(this.boxStatus == 'none') this.create(); $(this.boxHolder).style.zIndex = 50000; $(this.boxHolder).style.width = this.boxWidth+"px"; var sw = document.getElementsByTagName("body")[0].clientWidth || screen.width; var sl = Math.round((sw - this.boxWidth )/2); st = 50+document.documentElement.scrollTop-0; $(this.boxHolder).style.top = (xFindPosY(this.boxParent)+5||st) + 'px'; $(this.boxHolder).style.left = sl + 'px'; xMakeVisible(this.boxHolder); this.boxStatus = 'visible'; }, 

hide: function(){ if(this.boxStatus == 'none') return; xMakeHidden(this.boxHolder); this.boxStatus = 'hidden'; }, 

loading: function(){ $(this.boxName+"ImgBotHtml").innerHTML = this.loadingHtml; }, 

fetch: function(){ getContent(this.bottomUrl, '&'+Math.round(), '$("'+this.boxName+'ImgBotHtml").innerHTML = Contents;', '', 'GET' ); }, 

enlarge: function(xobj, ximg, xwidth, xbottomUrl, needNavigate){ if(typeof(needNavigate) == "undefined") needNavigate = false; if(typeof(xwidth) != "undefined") this.boxWidth = xwidth*1+62; this.boxParent = (typeof(xobj) != "object")?$(xobj):xobj; var imgSrc = ximg; if(this.boxStatus != 'visible') this.show(); var img = ximg; var IMGloading = (this.imgLoad == '' || !needNavigate)?'':'onload="try{'+this.imgLoad+'}catch(e){}"'; $(this.boxName + "Cont").innerHTML = '<center class="loading">'+ '<img border="0" id="'+this.boxName+'MainPic" src="'+imgSrc+'" alt="" border"0" usemap="#'+this.boxName+'Map" '+IMGloading+' />'+ '<div id="'+this.boxName+'PicBot">'+ '<map name="'+this.boxName+'Map" id="'+this.boxName+'Map">'+ '<area shape="rect" coords="0,0,0,0" href="#1" />'+ '<area shape="rect" coords="0,0,0,0" href="#2" />'+ '</map><br /><br /></div>'+ '<div id="'+this.boxName+'ImgBotHtml"></div>'+ '</center>'; if(typeof(xbottomUrl) != "undefined"){ this.bottomUrl = xbottomUrl; this.loading(); this.fetch(); } } });
 var 
xcomboBox = new Class({ initialize: function(name, selObj, Obj, width){ this.comboObj = Obj; this.comboId = name; this.comboName = name; this.comboWidth = width||200; this.comboHeight = 23; this.comboSelObj = (typeof(selObj) != "object")?$(selObj):selObj; this.comboListHeight = ''; this.comboStatus = 'none'; this.comboOnchange = ''; this.listValue = Array(); this.listText = Array(); this.listSelect = Array(); this.comboBgImage = ''; this.comboListBgColor = this.comboListBgColor||'#FFFFFF'; this.comboBgColor = this.comboBgColor||'transparent '; this.comboStyle = this.comboStyle||';text-align:right;'; this.comboItemClass = 'xComboBox'; this.comboBtn = ''; this.lastSelected = ''; this.readOnly = ' readonly="readonly"'; this.changeOnCreate = true; this.listCnt = 0; this.listMaxCnt = 8; }, create: function(comboArray, selectedValue){ if(this.comboStatus != 'none' && typeof(comboArray) == 'undefined') return; if(typeof(comboArray) != 'undefined'){ this.fetchArray(comboArray, selectedValue); this.fill(); return; } this.fetch(); var HTML11 ='<div style="padding:0;margin:0;background:'+this.comboBgColor+' url('+this.comboBgImage+') no-repeat scroll left; height:'+this.comboHeight+'px;width:'+this.comboWidth+'px" onclick="'+this.comboObj+'.togle();">'+ '<input '+this.readOnly+' type="text" name="'+this.comboId+'Cap" id="'+this.comboId+'Cap" value="" style="font-family:Tahoma, Verdana, arial;font-size:12px;padding:0 2px 0 0;border:0; margin:2px 0;width:'+(this.comboWidth-2)+'px;background:'+this.comboBgColor+' url('+this.comboBgImage+') no-repeat scroll left;'+this.comboStyle+'" />'+ '<input type="hidden" name="'+this.comboName+'" id="'+this.comboId+'" />'+ '</div>'; var HTML2 = '<div id="'+this.comboId+'ListCont" style="position:relative;"><div style=" background:'+this.comboListBgColor+'; border:1px solid #AAAAAA;padding:3px;width:'+this.comboWidth+'px;display:none;overflow:visible;position:absolute;left:'; if(navigator.userAgent.indexOf('MSIE 6.') == -1 && navigator.userAgent.indexOf('MSIE 5.') == -1) HTML2 = HTML2 + '-3px" id="'+this.comboId+'List"></div></div>'; else HTML2 = HTML2 + '-'+ this.comboWidth +'px" id="'+this.comboId+'List"></div></div>'; if(this.comboSelObj.tagName == "SELECT") this.comboSelObj.parentNode.innerHTML = HTML11 + HTML2; else this.comboSelObj.innerHTML = HTML11 + HTML2; this.fill(); this.comboStatus = 'close'; 
if(this.comboBtn){ if(typeof(this.comboBtn) != 'object') this.comboBtn = $(this.comboBtn); var CMD = this.comboObj+'.togle();'; this.comboBtn.style.cursor = 'pointer'; this.comboBtn.onclick = function(){ eval(CMD); }; } }, fetch: function(){ if(this.comboSelObj == null) return; try{ if(this.comboSelObj.style.height) this.comboListHeight = this.comboSelObj.style.height.toUpperCase().split("PX")[0] || this.comboListHeight; }catch(e){} for(var i=0; i<this.comboSelObj.length; i++){ this.listValue.push(this.comboSelObj[i].value||'0'); this.listText.push(this.comboSelObj[i].text||'&nbsp;'); this.listSelect.push(this.comboSelObj[i].selected); } this.listCnt = i; }, fill: function(){ var itemList = ''; for(k in this.listText){ if(typeof(this.listText[k]) == 'function' || typeof(this.listText[k]) == 'object') continue; if(this.listSelect[k]){ this.select(k); } itemList = itemList + "<a href=\"javascript:"+this.comboObj+".select("+k+");\" class='"+this.comboItemClass+"'>"+this.listText[k]+"</a>"; } $(this.comboId+'List').innerHTML = itemList; if(this.comboListHeight) $(this.comboId+"List").style.height = this.comboListHeight+"px"; }, fetchArray: function(comboArray, selectedValue){ this.listValue = Array(); this.listText = Array(); this.listSelect = Array(); for(Key in comboArray){ try{ if(typeof(comboArray[Key]) == 'function' || typeof(comboArray[Key]) == 'object') continue; this.listValue.push(Key); this.listText.push(comboArray[Key]); if(selectedValue=='first') selectedValue=comboArray[Key]; this.listSelect.push(comboArray[Key]==selectedValue); }catch(e){} } }, select: function(k, doOnChange){ if(typeof(doOnChange)!= "undefined"){ nk = -987; for(Key in this.listValue) if(this.listValue[Key] == k){ nk = Key; break; } if(nk == -987) return; k = nk; }else{ doOnChange = true; } $(this.comboId+'Cap').value = (this.listText[k] == '&nbsp;')?' ':this.listText[k]; $(this.comboId).value = this.listValue[k]||this.listText[k]; if(this.lastSelected != $(this.comboId).value){ this.lastSelected = $(this.comboId).value; try{ if(doOnChange && (this.changeOnCreate || this.comboStatus != 'none')) setTimeout(this.comboOnchange, 1); }catch(e){} } }, open: function(){ if(this.comboStatus == 'open') return; if($(this.comboId+"List").style.overflow == "visible"){ $(this.comboId+"List").style.overflow = "auto"; if(this.listCnt > this.listMaxCnt){ $(this.comboId+"List").style.height = (this.comboListHeight||200)+"px"; $(this.comboId+"List").style.width = (xRemovePX($(this.comboId+"List").style.width)*1+16) +"px"; } } xMakeVisible(this.comboId+"List"); this.comboStatus = 'open'; setTimeout('document.getElementsByTagName("body")[0].onclick = function(){'+this.comboObj+'.close();};', 100); }, close: function(){ xMakeHidden(this.comboId+"List"); document.getElementsByTagName("body")[0].onclick = function(){ }; this.comboStatus = 'close'; }, togle: function(){ if(this.comboStatus == 'open') this.close(); else this.open(); }, truncate: function(){ this.create(Array()); $(this.comboId+'Cap').value = ''; $(this.comboId).value = ''; } }); var xpagingBtn= new Class({ initialize: function(name, parent, OBJ){ this.obj = OBJ; this.parent = (typeof(parent) == 'object')?parent:$(parent); this.name = name; this.curPos = 1; this.lastPos = 1; this.maxPos = 1; this.islock = false; this.preClass = 'preBtn'; this.nextClass = 'nextBtn'; this.dotClass = 'dotBtn'; this.btnHtml = ''; this.onchange = ''; }, updateHtml: function(){ this.btnHtml = ''; for(i=this.maxPos;i>0;i--) this.btnHtml += '<a id="'+this.name+'_dot'+i+'" class="'+this.dotClass+'" href="javascript:'+this.obj+'.go('+i+')">&nbsp;</a>'; this.btnHtml = '<a id="'+this.name+'_next" class="'+this.nextClass+'Dis" href="javascript:'+this.obj+'.next()">&nbsp;</a>'+ this.btnHtml+ '<a id="'+this.name+'_pre" class="'+this.preClass+'Dis" href="javascript:'+this.obj+'.pre()">&nbsp;</a>'; return this.btnHtml; }, create: function(){ this.parent.innerHTML = this.updateHtml(); this.update(); }, update: function(){ for(i=1;i<=this.maxPos;i++) $(this.name+'_dot'+i).className = this.dotClass; $(this.name+'_dot'+this.curPos).className = this.dotClass+'On'; if(this.curPos > 1) $(this.name+'_pre').className = this.preClass; else $(this.name+'_pre').className = this.preClass + 'Dis'; if(this.curPos < this.maxPos) $(this.name+'_next').className = this.nextClass; else $(this.name+'_next').className = this.nextClass + 'Dis'; }, go: function(where){ if(this.islock) return; if(where!= this.curPos && where>0 && where<=this.maxPos){ this.lastPos = this.curPos; this.curPos = where; this.update(); try{ eval(this.onchange); }catch(e){} } }, next: function(xforce){ var force = (typeof(xforce) == "undefined")?false:xforce; if(this.curPos<this.maxPos) this.go(this.curPos*1+1); else if(force) this.go(1); }, pre: function(xforce){ var force = (typeof(xforce) == "undefined")?false:xforce; if(this.curPos>1) this.go(this.curPos*1-1); else if(force) this.go(this.maxPos); }, lock: function(){ this.islock = true; }, unlock: function(){ this.islock = false; } }); var xBtn = new Class({ initialize: function(img){ this.img = img; this.blankImg = "../map/images/blank.gif"; }, create: function(xobj, xtopPos, xhaveDown, xcmd){ var topPos = (typeof(xtopPos) == "undefined")?0:xtopPos; var haveDown = (typeof(xhaveDown) == "undefined")?true:xhaveDown; var obj = (typeof(xobj) != "object")?$(xobj):xobj; var width = obj.clientWidth || obj.width || 50; var height = obj.clientHeight || obj.height || 22; var normal = "transparent url("+this.img+") no-repeat 0px -"+ topPos +"px"; var over = "transparent url("+this.img+") no-repeat 0px -"+ (topPos*1+height*1) +"px"; var down = over; if(haveDown) down = "transparent url("+this.img+") no-repeat 0px -"+ (topPos*1+height*2) +"px"; var cmd = (typeof(xcmd) == "undefined")?'':xcmd; this.makebtn(obj, normal, over, down, cmd); }, show: function(xobj, xtopPos){ var topPos = (typeof(xtopPos) == "undefined")?0:xtopPos; var obj = (typeof(xobj) != "object")?$(xobj):xobj; var normal = "transparent url("+this.img+") no-repeat 0px -"+ topPos +"px"; this.makeimg(obj, normal); }, makebtn: function(obj, normal, over, down, cmd){ obj.onmouseover = function(){ obj.style.background = over; }; obj.onmouseout = function(){ obj.style.background = normal; }; obj.onmouseup = function(){ obj.style.background = over; }; 

obj.onmousedown = function(){ obj.style.background = down; }; if(typeof(cmd) != "undefined") obj.onclick = function(){ try{ eval(cmd); }catch(e){} }; 
obj.onload = function(){; }; 
obj.ondblclick = function(){ }; 
obj.src = this.blankImg; obj.style.background = normal; obj.style.cursor = "pointer"; }, makeimg: function(obj, normal){ obj.onmouseover = function(){ }; obj.onmouseout = function(){ }; obj.onmouseup = function(){ }; obj.onmousedown = function(){ }; obj.onclick = function(){ }; obj.onload = function(){ }; obj.ondblclick = function(){ }; obj.src = this.blankImg; obj.style.background = normal; obj.style.cursor = "auto"; }}); ;


