REQUEST_URL = "http://www.ebm.com.my/framework_main/scripts/load_framework_js.php"; REQUEST_URL_SSL = "https://www.ebm.com.my/framework_main/scripts/load_framework_js.php"; REQUEST_URL_NO_SSL = "http://www.ebm.com.my/framework_main/scripts/load_framework_js.php"; BASE_URL = "http://www.ebm.com.my/"; BASE_URL_SSL = "https://www.ebm.com.my/"; BASE_URL_NO_SSL = "http://www.ebm.com.my/"; FRAMEWORK_URL = "http://develop1.dmni.com/framework2/"; FRAMEWORK_URL_SSL = "https://develop1.dmni.com/framework2/"; FRAMEWORK_URL_NO_SSL = "http://develop1.dmni.com/framework2/"; MIN_PICKLIST_OPTIONS = "50"; PRINT_HEADER_FOOTER = {"en":{"header":"

\"\"<\/p>","footer":"\n\n
\n
\n\n\n
Copyright \u00a9 1994 - %%current_year%%
\nEBM America LLC. & EBM Asia Sdn. Bhd. - All Rights Reserved.
\n<\/span>Legal Terms<\/span><\/a> | Privacy Policy<\/a> | Site Map<\/a><\/span><\/td>\n
\"\"<\/a>   \"\"<\/a><\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/td>\n<\/tr>\n<\/table>"},"AE":{"header":"

\"\"<\/p>","footer":"\n\n" j = 0 nStartingYear = yearSelected-3 for (i=(yearSelected-3); i<=(yearSelected+3); i++) { sName = i; if (i==yearSelected){ sName = "" + sName + "" } sHTML += "" j ++; } sHTML += "" window.document.getElementById("selectYear").innerHTML = "
\n
\n\n\n" } window.document.getElementById("selectMonth").innerHTML = "
Copyright \u00a9 1994 - %%current_year%%
\nEBM America LLC. & EBM Asia Sdn. Bhd. - All Rights Reserved.
\n<\/span>Legal Terms<\/span><\/a> | Privacy Policy<\/a> | Site Map<\/a><\/span><\/td>\n
\"\"<\/a>   \"\"<\/a><\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/td>\n<\/tr>\n<\/table>"}}; /* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.2 */ if(typeof YAHOO=="undefined"){var YAHOO={};} YAHOO.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i-1),isSafari=(ua.indexOf('safari')>-1),isGecko=(!isOpera&&!isSafari&&ua.indexOf('gecko')>-1),isIE=(!isOpera&&ua.indexOf('msie')>-1);var patterns={HYPHEN:/(-[a-z])/i};var toCamel=function(property){if(!patterns.HYPHEN.test(property)){return property;} if(propertyCache[property]){return propertyCache[property];} while(patterns.HYPHEN.exec(property)){property=property.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());} propertyCache[property]=property;return property;};if(document.defaultView&&document.defaultView.getComputedStyle){getStyle=function(el,property){var value=null;var computed=document.defaultView.getComputedStyle(el,'');if(computed){value=computed[toCamel(property)];} return el.style[property]||value;};}else if(document.documentElement.currentStyle&&isIE){getStyle=function(el,property){switch(toCamel(property)){case'opacity':var val=100;try{val=el.filters['DXImageTransform.Microsoft.Alpha'].opacity;}catch(e){try{val=el.filters('alpha').opacity;}catch(e){}} return val/100;break;default:var value=el.currentStyle?el.currentStyle[property]:null;return(el.style[property]||value);}};}else{getStyle=function(el,property){return el.style[property];};} if(isIE){setStyle=function(el,property,val){switch(property){case'opacity':if(typeof el.style.filter=='string'){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}} break;default:el.style[property]=val;}};}else{setStyle=function(el,property,val){el.style[property]=val;};} YAHOO.util.Dom={get:function(el){if(!el){return null;} if(typeof el!='string'&&!(el instanceof Array)){return el;} if(typeof el=='string'){return document.getElementById(el);} else{var collection=[];for(var i=0,len=el.length;i=this.left&®ion.right<=this.right&®ion.top>=this.top&®ion.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(region){var t=Math.max(this.top,region.top);var r=Math.min(this.right,region.right);var b=Math.min(this.bottom,region.bottom);var l=Math.max(this.left,region.left);if(b>=t&&r>=l){return new YAHOO.util.Region(t,r,b,l);}else{return null;}};YAHOO.util.Region.prototype.union=function(region){var t=Math.min(this.top,region.top);var r=Math.max(this.right,region.right);var b=Math.max(this.bottom,region.bottom);var l=Math.min(this.left,region.left);return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(el){var p=YAHOO.util.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Point=function(x,y){if(x instanceof Array){y=x[1];x=x[0];} this.x=this.right=this.left=this[0]=x;this.y=this.top=this.bottom=this[1]=y;};YAHOO.util.Point.prototype=new YAHOO.util.Region(); YD = YAHOO.util.Dom; // $Id: cool_selector.js,v 1.5 2006/06/13 12:24:13 a Exp $ function replace_select_by_cool( select_obj) { var top_table = document.createElement( "table"); top_table.id = select_obj.id; var tr = document.createElement( "tr"); tr.className = "cool_selector"; top_table.appendChild( tr); var td1 = document.createElement( "td"); td1.style.width = document.all?"":"100%"; tr.appendChild( td1); var td2 = document.createElement( "td"); tr.appendChild( td2); td1.innerHTML = "
\
\
\
\
\
"; td2.innerHTML = "
"; td2.className = "button_box"; select_obj.parentNode.replaceChild( top_table, select_obj); if ( top_table.outerHTML ) { top_table.outerHTML = top_table.outerHTML; } var o1 = select_obj; var o2 = document.getElementById( top_table.id); if ( top_table.outerHTML ) { o2._input_ = o2.firstChild.firstChild.firstChild.firstChild; o2._input_hidden_ = o2._input_.nextSibling; o2._list_div_ = o2.firstChild.firstChild.firstChild.lastChild; } else { o2._input_ = o2.firstChild.firstChild.firstChild; o2._input_hidden_ = o2._input_.nextSibling; o2._list_div_ = o2.firstChild.firstChild.lastChild; } o2.selectedIndex = o1.selectedIndex; o2.options = o1.options; o2.className = o1.className; o2.style.cssText = o1.style.cssText o2.style.borderCollapse = "collapse"; o2._input_.className = o1.className; o2._input_.style.cssText = o1.style.cssText + ";width:100%"; o2._list_table_ = o2.getElementsByTagName( "table"); o2._list_table_ = o2._list_table_[0]; if ( document.all ) { o2._list_div_.style.width = o2.clientWidth; } else { o2._list_div_.style.minWidth = o2.clientWidth; } o2._list_rest_ = function() { for( var i=0; i|&)", "g"); var reg2 = new RegExp( "(\|"|'|<|>|&)", "g"); var reg3 = new RegExp( "(\\\\|\"|'|\\n|\\r)", "g"); var reg4 = new RegExp( "(\\\\\\\\|\\\\\"|\\\\\'|\\\\n|\\\\r)", "g"); var foo1 = function( str, p1) { return map1[p1]; } var foo2 = function( str, p1) { return map2[p1]; } var foo3 = function( str, p1) { return map3[p1]; } var foo4 = function( str, p1) { return map4[p1]; } var map1 = { "\\":"\", '"':""", "'":"'", "<":"<", ">":">", "&":"&"} var map2 = { "\":"\\", """:'"', "'":"'", "<":"<", ">":">", "&":"&"} var map3 = { "\\":"\\\\", "\"":"\\\"", "\'":"\\\'", "\n":"\\n", "\r":"\\r"}; var map4 = { "\\\\":"\\", "\\\"":"\"", "\\\'":"\'", "\\n":"\n", "\\r":"\r"}; htmlEncode = function( str){ return str.replace( reg1, foo1); } htmlDecode = function( str){ return str.replace( reg2, foo2); } addSlashes = function( str){ return str.replace( reg3, foo3); } stripSlashes = function( str){ return str.replace( reg4, foo4); } } temp__(); crc32Class = function( seed, precondition){ this.precondition = precondition || 0xFFFFFFFF; this.seed = seed || 0xEDB88320; this.bitAND = function( num1, num2){ var num11 = num1 >>> 16;var num10 = (num1 << 16) >>> 16; var num21 = num2 >>> 16;var num20 = (num2 << 16) >>> 16; return (num10 & num20)+(num11 & num21)*0x10000; } this.bitOR = function( num1, num2){ var num11 = num1 >>> 16;var num10 = (num1 << 16) >>> 16; var num21 = num2 >>> 16;var num20 = (num2 << 16) >>> 16; return (num10 | num20)+(num11 | num21)*0x10000; } this.bitXOR = function( num1, num2){ var num11 = num1 >>> 16;var num10 = (num1 << 16) >>> 16; var num21 = num2 >>> 16;var num20 = (num2 << 16) >>> 16; return (num10 ^ num20)+(num11 ^ num21)*0x10000; } this.bitLeft = function( num, n){ var num1 = num >>> 16;var num0 = (num << 16) >>> 16; return (num0 >>> n) + (num1 >>> n)*0x10000 + this.bitAND( (num1 << 16-n), 0x0000FFFF); } this.bitLeftCicle = function( num, n){ var num1 = num >>> 16;var num0 = (num << 16) >>> 16; return ( (num0 >>> n) + this.bitAND( (num1 << 16-n), 0x0000FFFF)) + ((num1 >>> n) + this.bitAND( (num0 << 16-n), 0x0000FFFF) )*0x10000; } this.crc32_table = []; var l_crc32; var l_temp_crc32; for( var i_bytes=0; i_bytes<256; i_bytes++) { l_crc32 = i_bytes; for( var i_bits=0; i_bits<8; i_bits++) { l_temp_crc32 = l_crc32 >>> 1; l_crc32 = ( this.bitAND( l_crc32, 0x1) != 0 )?this.bitXOR( l_temp_crc32, this.seed):l_temp_crc32; } this.crc32_table[i_bytes] = l_crc32; } this.get = function( str) { var crc32 = this.precondition; for( var i=0; i arguments[3] ) { arguments[0].value = arguments[0].value.substring( 0, arguments[3]); len = arguments[3]; } document.getElementById(arguments[1]).innerHTML = len; document.getElementById(arguments[2]).innerHTML = arguments[3] - len; } function wr( str) { window.document.write( str); } function changeImageSrc( name, src) { window.document.images[name].src = src; } function preload_images( data) { var PreloadImages = []; for( var i; i'); Preview_.showMe(); } function openLegalNotice() { open_popup_by_url( translates["Legal Notice"], "./legal_notice.html"); } function openLegalNotice2() { open_popup_by_url( translates["Legal Notice"], "http://www.alpeng.com/legal_notice.html"); } function openPrivacy() { open_popup_by_url( translates["Privacy Policy"], "./privacy_policy.html"); } function openPrivacy2() { open_popup_by_url( translates["Privacy Policy"], "http://www.alpeng.com/privacy_policy.html"); } function openLanguageSelect() { open_popup_by_url(translates["Language Select"], "./language_select.html"); } function save_article( page_title, art_url) { open_popup_by_url( translates["Save article"] || "Save article", "./save_article.html?page_title="+myEscape( page_title)+"&url="+myEscape( art_url)); if ( typeof( onSaveArticlePing) == "string" ) { var ping_img = new Image(); ping_img.src = onSaveArticlePing; } } function email_to_friend( page_title, art_url) { open_popup_by_url( translates["E-mail To a Friend"] || "E-mail To a Friend", "./email_to_friend.html?page_title="+myEscape( page_title)+"&url="+myEscape( art_url)); if ( typeof( onEmailArticlePing) == "string" ) { var ping_img = new Image(); ping_img.src = onEmailArticlePing; } } function email_alert( table, table_id, page_title, art_url) { open_popup_by_url( translates["Email Alert"] || "Email Alert", "./email_alert.html?page_title="+myEscape( page_title)+"&url="+myEscape( art_url)+"&table="+myEscape( table)+"&table_id="+myEscape( table_id)); } function windowScroll() { try { var divs = window.document.getElementById( "forLayers").getElementsByTagName("DIV"); for( var i=0; iRealPlayer is absent, for download click
here'); } } else if ( type == 1 ) { FLvideoWindow( url, width, height); } else if ( type == 2 ) { if ( havemp ) { MPvideoWindow( url, width, height); } else { wr( ''); } } else if ( type == 3 ) { if ( haveqt ){ QTvideoWindow( url, width, height); } else { wr( ''); } } else if ( type == 4 ) { wr( ''); } } function RPvideoWindow( url, width, height) { wr('\ \ \ \ \ \ \ \
\ \ \ \ \ \ \ \ \ '); } function QTvideoWindow( url, width, height) { wr('\ \ \ \ \ \ \ '); } function MPvideoWindow( url, width, height) { wr('\ \ \ \ \ \ \ \ '); } function FLvideoWindow( url, width, height) { wr('\ \ \ \ \ \ '); } function openIntro() { addLayer( "Intro"); Intro_ = new PopLayer( "Intro", translates["Introduction"], "intro.html"); // Intro_.width = 650; // Intro_.height = 400; Intro_.showMe(); } function open_popup_by_url( title, url, width, height, forceSize, scrolling ) { var name = "Popup_"+crc32.getHex( title); addLayer( name); eval( name+"_= new PopLayer( name, title, url);var o="+name+"_;"); o.width = width || 800; o.height = height || 500; o.forceSize = forceSize || 0; o.scrolling = scrolling || "auto"; if( o.forceSize ) { o.initWidth = o.width; o.initHeight = o.height; } o.showMe(); } function open_popup_empty( title, iframe_name, width, height) { var name = "Popup_"+crc32.getHex( title); addLayer( name); eval( name+"_= new PopLayer( name, title, './empty.php');var o="+name+"_;"); o.width = width || 650; o.height = height || 500; o.iframe_name = iframe_name; o.showMe(); } function open_popup( title, content, width, height, bgcolor, div_style) { var name = "Popup_"+crc32.getHex( title); var div = addLayer( name); eval( name+"_= new PopLayer2( name, title, content);var o="+name+"_;"); o.width = width || 0; o.height = height || 0; o.div_style = div_style || ""; o.bgcolor = bgcolor || "#FFFFFF"; o.showMe(); return o; } function openGlossaryLayer( title, description) { open_popup( title, "
"+description+"
", 300, 0, "#FFFEA6"); } function popup_close() { if ( typeof( window.popup_close_) == "function" ) { window.popup_close_(); } else { setTimeout( "popup_close()", 100); } } function viewO( o) { for ( var i in o) { alert( i + " = " + o[i]); } } function viewOstr( o, deep, sp, ignore_func, ignore_prop) { var deep = typeof( deep)=="undefined"?2:deep; var ignore_prop = typeof( deep)=="undefined"?{}:{"mod":1, "param_":1, "gVars":1, "default_param":1, "attr_map":1, "form":1}; if ( deep < 1 ) return o; var sp = sp || ""; var ignore_func = typeof( ignore_func)=="undefined"?true:ignore_func; if ( sp == "" ) { var res = [ "\nObject Information:\n"]; } else { var res = []; } for ( var i in o) { if ( (ignore_func && typeof( o[i]) == "function") || ignore_prop[i] ) { continue; } if ( typeof( o[i]) == "object" ) { res.push( sp, i, " = \n", viewOstr( o[i], deep-1, sp+" ", ignore_func, ignore_prop), "\n"); } else { res.push( sp, i, " = ", o[i], "\n"); } } return res.join( ""); } function sh( id, mode) { var o = window.document.getElementById( id); if ( o == null ) return; o.style.display = ( mode )?"":"none"; } function sv( form, name, value) { ctrl_by_name[form+"."+name]._setValue( value); } function gv( form, name) { return ctrl_by_name[form+"."+name]._getValue(); } function validate_form( name, message) { var er_num = 0; for( var i=0; i 5 ) return " .............\n"; if ( typeof( data) == 'function') { return ""; } if ( typeof( data.toString) == 'string' && typeof( data) != 'number') { return "\"" + data + "\"\n"; } if ( typeof( del) == "undefined" ) { del = "\t"; result = typeof( data) + ":\n"; } if ( typeof( data) == 'object') { for( i in data) { if ( typeof( data[i]) == 'function') { continue; } result += "\n" + del+((typeof(i)=="string" && parseInt(i)!=i)?('"'+i+'"'):i) + " (" + typeof(data[i]) + "): " + varDump( data[i], del+"\t", level+1); } } return result==""?data:result; } catch( t) { }; } function Dprint( data){ if ( typeof( data) == "string" ) { windebug.document.f.debug.value += data; } else { windebug.document.f.debug.value += varDump( data); } } function myEscape( str) { return escape( str.toString()).replace( /\//g, "%2F").replace( /\\/g, "%5C").replace( /\+/g, "%2B"); } function setTrBg( o, color) { o.style.background = color; } function addToArray( arr, data) { var pos = -1; for( var i=0; i= len || ch.length == 0) { return str; } how = how || 0; if ( how == 0 ) { while( str.length < len ) { str += ch; } str = str.substr( 0, len); } else if ( how == 1 ) { while( str.length < len ) { str = ch+str; } str = str.substr( 0, len); } return str; } function dateToTimestamp( date) { var d = date.split( /[^0-9]+/); if ( d == null || d.length < 3 ) { if ( date.length == 0 ) { return ""; } else { return "_INCORECT_FORMAT_"; } } else { if ( DATE_FORMAT ) { var d_ = pad( d[2], "0", 4, 1)+"-"+pad( d[0], "0", 2, 1)+"-"+pad( d[1], "0", 2, 1); if ( validDate( d_) ) { return d_; } else { return "_INCORECT_FORMAT_"; } } else { var d_ = pad( d[2], "0", 4, 1)+"-"+pad( d[1], "0", 2, 1)+"-"+pad( d[0], "0", 2, 1); if ( validDate( d_) ) { return d_; } else { return "_INCORECT_FORMAT_"; } } } } function timestampToDate( date) { var d = date.match( /([0-9]{4})[^0-9]*([0-9]{2})[^0-9]*([0-9]{2})/); if ( d == null || d.length < 4 || ( d[1]=="0000" && d[2]=="00" && d[3]=="00" ) ) { return ""; } else { if ( DATE_FORMAT ) { return d[2]+"/"+d[3]+"/"+d[1]; } else { return d[3]+"/"+d[1]+"/"+d[1]; } } } function validDateFormated( date, format) { var format = format || "mm/dd/yyyy"; var date_res = ""; var pos1 = format.indexOf( 'yyyy'); date_res += pos1!=-1?date.substr( pos1, 4):"0000"; pos1 = format.indexOf( 'mm'); date_res += pos1!=-1?date.substr( pos1, 3):"00"; pos1 = format.indexOf( 'dd'); date_res += pos1!=-1?date.substr( pos1, 3):"00"; date_res += "000000"; return validDate( date_res); } function validDate( date) { var m_day = {1:31, 2:28, 3:31, 4:30, 5:31, 6:30, 7:31, 8:31, 9:30, 10:31, 11:30, 12:31}; var date = date.split( /[^0-9]+/); if ( date.length == 1 ) { date = date[0]; var y = ( date.substr( 0, 4))-0; var m = ( date.substr( 4, 2))-0; var d = ( date.substr( 6, 2))-0; var h = ( date.substr( 8, 2))-0; var m_ = ( date.substr( 10, 2))-0; var s = ( date.substr( 12, 2))-0; } else { var y = ( date[0] || 0)-0; var m = ( date[1] || 0)-0; var d = ( date[2] || 0)-0; var h = ( date[3] || 0)-0; var m_ = ( date[4] || 0)-0; var s = ( date[5] || 0)-0; } if ( !(y && m && d) ) { return false; } if ( y < 1 ) { return false; } if ( m < 1 || m > 12 ) { return false; } if ( m != 2 ) { if ( d < 1 || d > m_day[m] ) { return false; } } else { if ( y%4 != 0) { var days = 28; } else if ( y%400 == 0 ) { var days = 29; } else if ( y%100 == 0 ) { var days = 28; } else { var days = 29; } if ( d < 1 || d > days) { return false; } } if ( h < 0 || h > 23 ) { return false; } if ( m_ < 0 || m_ > 60 ) { return false; } if ( s < 0 || s > 60 ) { return false; } return true; } function isDisplayed( id) { var isIE=document.all; var topDog=isIE ? "BODY" : "HTML"; var hotDog=window.document.getElementById( id); while( hotDog.style.display!="none" && hotDog.tagName!=topDog) hotDog=isIE?hotDog.parentElement:hotDog.parentNode; return hotDog.style.display=="none"?false:true; } function insertAtCursor( myField, myValue) { if ( document.selection ) { myField.focus(); var sel = document.selection.createRange(); sel.text = myValue; } else if ( myField.selectionStart || myField.selectionStart == '0' ) { var startPos = myField.selectionStart; var endPos = myField.selectionEnd; myField.value = myField.value.substring(0, startPos) + myValue + myField.value.substring(endPos, myField.value.length); } else { myField.value += myValue; } } function roundFloat( f, n) { d = Math.pow( 10, n); return Math.round( f*d)/d; } function getHumanFileSize( size) { if ( size > 1024*1024 ) { size = roundFloat( size/(1024*1024), 3) + "MByte"; } else if ( size > 1024 ) { size = roundFloat( size/(1024), 3) + "KByte"; } else { size = roundFloat( size, 0) + "Byte"; } return size; } function numberFormat( number, len) { var str = ""+number; while( str.length < len ) str = "0"+str; return str; } function getTime( now) { var h = now.getHours(); if ( h > 12 ) { var ampm = "pm"; h -= 12; } else { var ampm = "am"; } return numberFormat( h, 2)+":"+numberFormat( now.getMinutes(), 2)+":"+numberFormat( now.getSeconds(), 2)+" "+ampm; } function getTime2( time) { h = numberFormat( time.getUTCHours(), 2); m = numberFormat( time.getUTCMinutes(), 2); s = numberFormat( time.getUTCSeconds(), 2); return h+":"+m+":"+s; } function getPrintForm( print_group_id) { var o = window.document.getElementById( print_group_id); return htmlToPrintable( o.innerHTML); } function print_page_by_object( o) { var styles = document.getElementsByTagName( "style"); if ( o != null ) { if ( typeof( onPrintArticlePing) == "string" ) { var ping_img = new Image(); ping_img.src = onPrintArticlePing; } var popup_ = window.open("","print",'scrollbars=1,width=600,height=500'); if ( popup_.document && popup_.document.body ) popup_.document.body.innerHTML = ""; popup_.document.write( ["\ \ \ \ Print\ \ \ \ \
\ \ \ \ \
", htmlToPrintable( o.innerHTML), "
\
\ \ "].join( "") ); for( var i=0; i" + styles[i].innerHTML + ""); } popup_.document.close(); popup_.print(); popup_.close(); } } function print_page( id) { var styles = document.getElementsByTagName( "style"); var o = window.document.getElementById( id); if ( o != null ) { if ( typeof( onPrintArticlePing) == "string" ) { var ping_img = new Image(); ping_img.src = onPrintArticlePing; } var popup_ = window.open("","print",'scrollbars=1,width=600,height=500'); if ( popup_.document && popup_.document.body ) popup_.document.body.innerHTML = ""; popup_.document.write( ["\ \ \ \ Print\ \ \ \ \
\ \ \ \ \
", PRINT_HEADER_FOOTER[current_language]["header"], htmlToPrintable( o.innerHTML), PRINT_HEADER_FOOTER[current_language]["footer"], "
\
\ \ "].join( "") ); for( var i=0; i" + styles[i].innerHTML + ""); } popup_.document.close(); popup_.print(); popup_.close(); } } function htmlToPrintable( data) { var res = data.match( /(\<(input|textarea|select)[^\>]*\>)/gi); if ( res != null ) { for( var i=0; i]+)/i); var tag = ( res2 == null )?"undef":res2[1].toLowerCase(); var res2 = res[i].match( /type=(?:[\'\"]([^\'\"]*)[\'\"]|(\w*))[\s\>]/i); var type = ( res2 == null )?"text":(res2[1] || res2[2]).toLowerCase(); var res2 = res[i].match( /id=(?:[\'\"]([^\'\"]*)[\'\"]|(\w*))[\s\>]/i); var id = ( res2 == null )?"":(res2[1] || res2[2]); var res2 = res[i].match( /style=(?:[\'\"]([^\'\"]*)[\'\"]|(\w*))[\s\>]/i); var style = ( res2 == null )?"":(res2[1] || res2[2]); var o = window.document.getElementById( id); if ( o != null ) { if ( o.style.display && o.style.display=="none") { data = data.replace( res[i], ""); } if ( tag == "input" ) { if ( type == "checkbox" || type == "radio" ) { data = data.replace( res[i], [""].join( "")); } else if ( type=="password" ){ data = data.replace( res[i], ["********"].join( "")); } else if ( type=="hidden" ){ data = data.replace( res[i], ""); } else { data = data.replace( res[i], ["", o.value, ""].join( "")); } } else if ( tag == "textarea") { data = data.replace( res[i], [""].join( "")); } else if ( tag == "select" ) { var opt = o.options; if ( opt != "null" ) { var r = []; for( var z=0; z", r.join( ", "),""].join( "")); } } } } data = data.replace( /\]*\>[^\<]*\<\/option\s*\>|\<\/select\s*\>/gi, ""); data = data.replace( /\<\/textarea\s*\>/ig, "\"); var prev_data = data.concat( "!"); while( prev_data.length > data.length ) { prev_data = data; data = data.replace( /(\<[^\<]*)(id|onchange|onclick|onfocus|onblur|onmouseover|onmouseout)=("[^"]*"|'[^']*'|\w+)[\n\t\s]*/gi, "$1"); } var prev_data = data.concat( "!"); while( prev_data.length > data.length ) { prev_data = data; data = data.replace( /(\<(\w+(=(\"[^\"]+\"|\'[^\']+\'|\w+))?[\n\t\s\>]+)+)\w+=(\"\"|\'\')[\n\t\s]*/g, "$1"); } } data = data.replace( "><", "> <") + " "; var d = data.split( /\]*\>|\<\/sc[r]ipt\>/i); if ( d.length > 1 ) { var res = []; for( var i=0; i< d.length; i++) { if ( i%2 == 0 ) { res.push( d[i]); } } return res.join( ""); } else { return data; } } // $Id: detect.js,v 1.3 2007/10/08 09:09:48 a Exp $ browserInfoDetector = function() { var nse = ""; var detectIE = function(class_id) { browserInfoDetector.result = false; document.write('\n on error resume next \n browserInfoDetector.result = IsObject(CreateObject("' + class_id + '")) \n \n'); return browserInfoDetector.result; } var detectNS = function(class_id) { var t = nse.indexOf(class_id) != -1 && navigator.mimeTypes[class_id].enabledPlugin != null; return t; } browserInfoDetector.info.screen = screen.width+"x"+screen.height; browserInfoDetector.info.cdi = screen.colorDepth || screen.pixelDepth; browserInfoDetector.info.java = navigator.javaEnabled(); browserInfoDetector.info.nav = navigator.appName.toLowerCase(); browserInfoDetector.info.agt = navigator.userAgent.toLowerCase(); browserInfoDetector.info.win = ((browserInfoDetector.info.agt.indexOf("win")!=-1) || (browserInfoDetector.info.agt.indexOf("32bit")!=-1)); browserInfoDetector.info.mac = (browserInfoDetector.info.agt.indexOf("mac")!=-1); browserInfoDetector.info.ns = (browserInfoDetector.info.nav.indexOf("netscape") != -1); browserInfoDetector.info.opera= (browserInfoDetector.info.nav.indexOf("opera") != -1); browserInfoDetector.info.ie = (browserInfoDetector.info.agt.indexOf("msie") != -1); if ( document.documentElement && document.documentElement.clientWidth ) { browserInfoDetector.info.winsize = document.documentElement.clientWidth + 'x' + document.documentElement.clientHeight; } else if ( document.body && document.body.clientWidth ) { browserInfoDetector.info.winsize = document.body.clientWidth + 'x' + document.body.clientHeight; } else { browserInfoDetector.info.winsize = window.innerWidth + 'x' + window.innerHeight; } if ( browserInfoDetector.info.ie && browserInfoDetector.info.win ) { browserInfoDetector.info.shk = detectIE("SWCtl.SWCtl.1"); browserInfoDetector.info.fla = detectIE("ShockwaveFlash.ShockwaveFlash.1"); if ( browserInfoDetector.info.fla ) { browserInfoDetector.info.fla_version = 0; for( var i=0; i<20; i++) { if ( detectIE("ShockwaveFlash.ShockwaveFlash." + i) ) { browserInfoDetector.info.fla_version = i; } } } browserInfoDetector.info.rp = detectIE("rmocx.RealPlayer G2 Control.1"); browserInfoDetector.info.mov = detectIE("Quicktime.Quicktime"); browserInfoDetector.info.wma = detectIE("wmplayer.ocx"); browserInfoDetector.info.pdf = 0; browserInfoDetector.info.pdfver=''; if ( detectIE("PDF.PdfCtrl.1") ) { browserInfoDetector.info.pdf = 1; browserInfoDetector.info.pdfver='4'; } if ( detectIE('PDF.PdfCtrl.5') ) { browserInfoDetector.info.pdf = 1; browserInfoDetector.info.pdfver='5'; } if ( detectIE('PDF.PdfCtrl.6') ) { browserInfoDetector.info.pdf = 1; browserInfoDetector.info.pdfver='6'; } if ( detectIE('AcroPDF.PDF.1') ) { browserInfoDetector.info.pdf = 1; browserInfoDetector.info.pdfver='7'; } } if ( browserInfoDetector.info.ns || !browserInfoDetector.info.win) { nse = ""; for ( var i=0; i and objects (for IE only) */ function hideElement( elmID, overDiv ) { elmID = elmID.toLowerCase(); if( document.all ) { var elms = window.document.getElementsByTagName( elmID); for( i = 0; i < elms.length; i++ ) { obj = elms[i]; if( !obj || !obj.offsetParent ) { continue; } // Find the element's offsetTop and offsetLeft relative to the BODY tag. objLeft = obj.offsetLeft; objTop = obj.offsetTop; objParent = obj.offsetParent; while( objParent.tagName.toUpperCase() != "BODY" ) { objLeft += objParent.offsetLeft; objTop += objParent.offsetTop; objParent = objParent.offsetParent; } objHeight = obj.offsetHeight; objWidth = obj.offsetWidth; if(( overDiv.offsetLeft + overDiv.offsetWidth ) <= objLeft ); else if(( overDiv.offsetTop + overDiv.offsetHeight ) <= objTop ); else if( overDiv.offsetTop >= ( objTop + objHeight )); else if( overDiv.offsetLeft >= ( objLeft + objWidth )); else { obj.style.visibility = "hidden"; } } } else { if( elmID == "iframe" || elmID == "embed" || elmID == "applet" || elmID == "object" ) { var elms = window.document.getElementsByTagName( elmID); for( i = 0; i < elms.length; i++ ) { obj = elms[i]; if( !obj || !obj.parentNode) { continue; } // Find the element's offsetTop and offsetLeft relative to the BODY tag. objLeft = obj.offsetLeft; objTop = obj.offsetTop; objParent = obj.parentNode; while( objParent.tagName.toUpperCase() != "HTML" ) { if( objParent.tagName.toUpperCase() == "TR" || objParent.tagName.toUpperCase() == "TBODY" || objParent.tagName.toUpperCase() == "SPAN") { objParent = objParent.parentNode; continue } objLeft += objParent.offsetLeft; objTop += objParent.offsetTop; objParent = objParent.parentNode; } objHeight = obj.offsetHeight; objWidth = obj.offsetWidth; if(( overDiv.offsetLeft + overDiv.offsetWidth ) <= objLeft ); else if(( overDiv.offsetTop + overDiv.offsetHeight ) <= objTop ); else if( overDiv.offsetTop >= ( objTop + objHeight )); else if( overDiv.offsetLeft >= ( objLeft + objWidth )); else { if ( elmID == "iframe" ) { obj.contentWindow.document.body.style.visibility = "hidden"; } else { obj.style.visibility = "hidden"; } } } } } } /* * unhides ") if (showToday==1) { document.write ("") } document.write ("
Close the Calendar
"); } var monthName = new Array("January","February","March","April","May","June","July","August","September","October","November","December") if (startAt==0) { dayName = new Array ("Sun","Mon","Tue","Wed","Thu","Fri","Sat") } else { dayName = new Array ("Mon","Tue","Wed","Thu","Fri","Sat","Sun") } var styleAnchor="text-decoration:none;color:black;" var styleLightBorder="border-style:solid;border-width:1px;border-color:#a0a0a0;" function swapImage(srcImg, destImg){ if (ie) { window.document.getElementById(srcImg).setAttribute("src",imgDir + destImg) } } function popcalInit() { pc_oldkeypress = document.onkeypress; document.onkeypress = function hidecal1 (e) { var event = e ? e : window.event; if (event.keyCode==27) { hideCalendar() } if (typeof pc_oldkeypress == 'function') { pc_oldkeypress() // will work if old handler does not call anything via 'this' } } pc_oldclick = document.onclick; document.onclick = function hidecal2 (e) { var event = e ? e : window.event; if (!bShow) { hideCalendar() } bShow = false if (typeof pc_oldclick == 'function') { pc_oldclick() // will work if old handler does not call anything via 'this' } } if (!ns4) { l = yearNow+''; l = l.length; if ( l != 4 ) { yearNow += 1900 } crossobj=(dom)?window.document.getElementById("calendar").style : ie? document.all.calendar : document.calendar hideCalendar() crossMonthObj=(dom)?window.document.getElementById("selectMonth").style : ie? document.all.selectMonth : document.selectMonth crossYearObj=(dom)?window.document.getElementById("selectYear").style : ie? document.all.selectYear : document.selectYear monthConstructed=false; yearConstructed=false; if (showToday==1) { window.document.getElementById("lblToday").innerHTML = todayString + " "+dayName[(today.getDay()-startAt==-1)?6:(today.getDay()-startAt)]+", " + dateNow + " " + monthName[monthNow].substring(0,3) + " " + yearNow + "" } sHTML1="   " sHTML1+="   " sHTML1+=" " sHTML1+=" " window.document.getElementById("caption").innerHTML = sHTML1 bPageLoaded=true } } function hideCalendar() { if ( crossobj ) { showElement( 'SELECT', window.document.getElementById("calendar")); showElement( 'APPLET', window.document.getElementById("calendar")); showElement( 'EMBED', window.document.getElementById("calendar")); showElement( 'OBJECT', window.document.getElementById("calendar")); crossobj.visibility="hidden" crossobj.top = 0; crossobj.left = 0; if (crossMonthObj != null){crossMonthObj.visibility="hidden"} if (crossYearObj != null){crossYearObj.visibility="hidden"} } } function padZero(num) { return (num < 10)? '0' + num : num ; } function constructDate(d,m,y) { sTmp = dateFormat sTmp = sTmp.replace ("dd","") sTmp = sTmp.replace ("d","") sTmp = sTmp.replace ("",padZero(d)) sTmp = sTmp.replace ("",d) sTmp = sTmp.replace ("mmm","") sTmp = sTmp.replace ("mm","") sTmp = sTmp.replace ("m","") sTmp = sTmp.replace ("",m+1) sTmp = sTmp.replace ("",padZero(m+1)) sTmp = sTmp.replace ("",monthName[m]) return sTmp.replace ("yyyy",y) } function closeCalendar() { var sTmp hideCalendar(); ctlToPlaceValue.value = constructDate(dateSelected,monthSelected,yearSelected) if (flag) make_calc(); } /*** Month Pulldown ***/ function StartDecMonth() { intervalID1=setInterval("decMonth()",80) } function StartIncMonth() { intervalID1=setInterval("incMonth()",80) } function incMonth () { monthSelected++ if (monthSelected>11) { monthSelected=0 yearSelected++ } constructCalendar() } function decMonth () { monthSelected-- if (monthSelected<0) { monthSelected=11 yearSelected-- } constructCalendar() } function constructMonth() { popDownYear() if (!monthConstructed) { sHTML = "" for (i=0; i<12; i++) { sName = monthName[i]; if (i==monthSelected){ sName = "" + sName + "" } sHTML += "
 " + sName + " 
" + sHTML + "
" monthConstructed=true } } function popUpMonth() { constructMonth() crossMonthObj.visibility = (dom||ie)? "visible" : "show" crossMonthObj.left = parseInt(crossobj.left) + 50 crossMonthObj.top = parseInt(crossobj.top) + 26 hideElement( 'SELECT', window.document.getElementById("selectMonth") ); hideElement( 'APPLET', window.document.getElementById("selectMonth") ); hideElement( 'EMBED', window.document.getElementById("selectMonth") ); hideElement( 'OBJECT', window.document.getElementById("selectMonth") ); } function popDownMonth() { crossMonthObj.visibility= "hidden" } /*** Year Pulldown ***/ function incYear() { for (i=0; i<7; i++){ newYear = (i+nStartingYear)+1 if (newYear==yearSelected) { txtYear = " " + newYear + " " } else { txtYear = " " + newYear + " " } window.document.getElementById("y"+i).innerHTML = txtYear } nStartingYear ++; bShow=true } function decYear() { for (i=0; i<7; i++){ newYear = (i+nStartingYear)-1 if (newYear==yearSelected) { txtYear = " " + newYear + " " } else { txtYear = " " + newYear + " " } window.document.getElementById("y"+i).innerHTML = txtYear } nStartingYear --; bShow=true } function selectYear(nYear) { yearSelected=parseInt(nYear+nStartingYear); yearConstructed=false; constructCalendar(); popDownYear(); } function constructYear() { popDownMonth() sHTML = "" if (!yearConstructed) { sHTML = "
-
 " + sName + " 
+
" + sHTML + "
" yearConstructed = true } } function popDownYear() { clearInterval(intervalID1) clearTimeout(timeoutID1) clearInterval(intervalID2) clearTimeout(timeoutID2) crossYearObj.visibility= "hidden" } function popUpYear() { var leftOffset constructYear() crossYearObj.visibility = (dom||ie)? "visible" : "show" leftOffset = parseInt(crossobj.left) + window.document.getElementById("spanYear").offsetLeft if (ie) { leftOffset += 6 } crossYearObj.left = leftOffset crossYearObj.top = parseInt(crossobj.top) + 26 } /*** calendar ***/ function WeekNbr(n) { // Algorithm used: // From Klaus Tondering's Calendar document (The Authority/Guru) // hhtp://www.tondering.dk/claus/calendar.html // a = (14-month) / 12 // y = year + 4800 - a // m = month + 12a - 3 // J = day + (153m + 2) / 5 + 365y + y / 4 - y / 100 + y / 400 - 32045 // d4 = (J + 31741 - (J mod 7)) mod 146097 mod 36524 mod 1461 // L = d4 / 1460 // d1 = ((d4 - L) mod 365) + L // WeekNumber = d1 / 7 + 1 year = n.getFullYear(); month = n.getMonth() + 1; if (startAt == 0) { day = n.getDate() + 1; } else { day = n.getDate(); } a = Math.floor((14-month) / 12); y = year + 4800 - a; m = month + 12 * a - 3; b = Math.floor(y/4) - Math.floor(y/100) + Math.floor(y/400); J = day + Math.floor((153 * m + 2) / 5) + 365 * y + b - 32045; d4 = (((J + 31741 - (J % 7)) % 146097) % 36524) % 1461; L = Math.floor(d4 / 1460); d1 = ((d4 - L) % 365) + L; week = Math.floor(d1/7) + 1; return week; } function constructCalendar () { var aNumDays = Array (31,0,31,30,31,30,31,31,30,31,30,31) var dateMessage var startDate = new Date (yearSelected,monthSelected,1) var endDate if (monthSelected==1) { endDate = new Date (yearSelected,monthSelected+1,1); endDate = new Date (endDate - (24*60*60*1000)); numDaysInMonth = endDate.getDate() } else { numDaysInMonth = aNumDays[monthSelected]; } datePointer = 0 dayPointer = startDate.getDay() - startAt if (dayPointer<0) { dayPointer = 6 } sHTML = "" if (showWeekNumber==1) { sHTML += "" } for (i=0; i<7; i++) { sHTML += "" } sHTML +="" if (showWeekNumber==1) { sHTML += "" } for ( var i=1; i<=dayPointer;i++ ) { sHTML += "" } for ( datePointer=1; datePointer<=numDaysInMonth; datePointer++ ) { dayPointer++; sHTML += "" if ((showWeekNumber==1)&&(datePointer" } } } window.document.getElementById("content").innerHTML = sHTML window.document.getElementById("spanMonth").innerHTML = " " + monthName[monthSelected] + " " window.document.getElementById("spanYear").innerHTML = " " + yearSelected + " " } var flag=''; function popUpCalendar(ctl, ctl2, format, p) { var leftpos=0 var toppos=0 flag=p; if (bPageLoaded) { if ( crossobj.visibility == "hidden" ) { ctlToPlaceValue = ctl2 dateFormat=format; formatChar = " " aFormat = dateFormat.split(formatChar) if (aFormat.length<3) { formatChar = "/" aFormat = dateFormat.split(formatChar) if (aFormat.length<3) { formatChar = "." aFormat = dateFormat.split(formatChar) if (aFormat.length<3) { formatChar = "-" aFormat = dateFormat.split(formatChar) if (aFormat.length<3) { // invalid date format formatChar="" } } } } tokensChanged = 0 if ( formatChar != "" ) { // use user's date aData = ctl2.value.split(formatChar) for (i=0;i<3;i++) { if ((aFormat[i]=="d") || (aFormat[i]=="dd")) { dateSelected = parseInt(aData[i], 10) tokensChanged ++ } else if ((aFormat[i]=="m") || (aFormat[i]=="mm")) { monthSelected = parseInt(aData[i], 10) - 1 tokensChanged ++ } else if (aFormat[i]=="yyyy") { yearSelected = parseInt(aData[i], 10) tokensChanged ++ } else if (aFormat[i]=="mmm") { for (j=0; j<12; j++) { if (aData[i]==monthName[j]) { monthSelected=j tokensChanged ++ } } } } } if ((tokensChanged!=3)||isNaN(dateSelected)||isNaN(monthSelected)||isNaN(yearSelected)) { dateSelected = dateNow monthSelected = monthNow yearSelected = yearNow } odateSelected=dateSelected omonthSelected=monthSelected oyearSelected=yearSelected aTag = ctl do { aTag = aTag.offsetParent; leftpos += aTag.offsetLeft; toppos += aTag.offsetTop; } while(aTag.tagName!="BODY"); crossobj.left = fixedX==-1 ? ctl.offsetLeft + leftpos : fixedX crossobj.top = fixedY==-1 ? ctl.offsetTop + toppos + ctl.offsetHeight + 2 : fixedY constructCalendar (1, monthSelected, yearSelected); crossobj.visibility=(dom||ie)? "visible" : "show" hideElement( 'SELECT', window.document.getElementById("calendar") ); hideElement( 'APPLET', window.document.getElementById("calendar") ); hideElement( 'EMBED', window.document.getElementById("calendar") ); hideElement( 'OBJECT', window.document.getElementById("calendar") ); bShow = true; } else { hideCalendar() if (ctlNow!=ctl) {popUpCalendar(ctl, ctl2, format)} } ctlNow = ctl } } addOnLoadFunc(popcalInit); // $Id: validator_proto.js,v 1.9 2008/08/19 11:39:05 andy Exp $ ctrl_by_id = {}; ctrl_by_name = {}; validators = {}; translates = {}; validator_proto = { errorBgColor:"#ffbbbb", requireBgColor:"yellow", clearError:function() { var o = window.document.getElementById( this.pid+"_ERROR_PLACE"); if ( o != null ) o.innerHTML = ""; o = window.document.getElementById( this.pid); var o_ = o; if ( o_ != null ) { o_.style.backgroundColor = o_.defaultBgColor; } else { var id = ctrl_by_id[this.pid].id; if ( typeof( id) == "string" ) { var o_ = window.document.getElementById( id); o_!=null && (o_.style.backgroundColor = o_.defaultBgColor || ""); } else if ( typeof( id) == "object" ) { for( var i=0; i 1 ) { return 0; } this["if"]["value"] = value; if ( this["if"].m() ) { var er = 0; this["eval"]["value"] = value; this["eval"]["message"] = new String( this.message); er_st = this["eval"].m(); if ( er_st != "empty" ) { if ( er_st ) er = 1; } else { if ( this["type"] == "email" ) { var em = value; if ( em!="" && !( em.indexOf("@")>0 && em.indexOf(".")>0 && em.indexOf(".")+1"].join( ""); } else { o2.innerHTML = [translates["Enter Valid Value"], "
"].join( ""); } if ( o_ != null ) { o_.defaultBgColor = o_.my_bg_color || o_.style.backgroundColor; o_.style.backgroundColor = this.errorBgColor; } else { var id = ctrl_by_id[this.pid].id; if ( typeof( id) == "string" ) { var o_ = window.document.getElementById( id); o_ != null && ( o_.style.backgroundColor = this.errorBgColor); } else if ( typeof( id) == "object" ) { for( var i=0; i -1 ) { this.url.concat( "&WINDOW_BODY_ONLOAD="+myEscape( "top."+this.name+"_.iframeOnload( window);")); } else { this.url.concat( "?WINDOW_BODY_ONLOAD="+myEscape( "top."+this.name+"_.iframeOnload( window);")); } this.scrollPosition=document.body.scrollTop; if ( !header ) { this.header = '\
" + weekString + ""+ dayName[i]+"
" + WeekNbr(startDate) + "  " sStyle=styleAnchor if ((datePointer==odateSelected) && (monthSelected==omonthSelected) && (yearSelected==oyearSelected)) { sStyle+=styleLightBorder } sHint = "" for (k=0;k " + datePointer + " "} else if (dayPointer % 7 == (startAt * -1)+1) { sHTML += " " + datePointer + " " } else { sHTML += " " + datePointer + " " } sHTML += "" if ((dayPointer+startAt) % 7 == startAt) { sHTML += "
\ \ \ \ \ \ \
\ \ \ \ \ \ \ \ \
$$title$$
\ \ \ \ \ \ \ \
\
\
'; } else { this.header = header; } this.Layer = document.getElementById( this.name); this.Layer.style.zIndex=10000; __popLayers__[this.name] = this; //------------------------------------- // Methods //------------------------------------- this.hideMe = function() { try { this.iframe.contentWindow.document.body.innerHTML = "!!!"; } catch (e) {} this.Layer.innerHTML = ""; if (isIE||isNN) this.Layer.style.visibility="hidden"; ddEnabled = false; this.open = false; }; this.showMe = function() { if (isIE||isNN){ c = this.header.replace( /\$\$url\$\$/g, this.url); c = c.replace( /\$\$title\$\$/g, this.title); c = c.replace( /\$\$name\$\$/g, this.name); c = c.replace( /\$\$initWidth\$\$/g, this.initWidth); c = c.replace( /\$\$initHeight\$\$/g, this.initHeight); c = c.replace( /\$\$iframe_name\$\$/g, this.iframe_name); c = c.replace( /\$\$iframe_width\$\$/g, this.iframe_width); c = c.replace( /\$\$bgcolor\$\$/g, this.bgcolor); c = c.replace( /\$\$scrolling\$\$/g, this.scrolling); this.Layer.innerHTML = c; this.Layer.style.visibility="visible"; } this.iframe = document.getElementById(this.iframe_name) }; this.centerWindow = function() { o = document.body; this.m_pos_y = isIE ? (o.scrollTop+o.clientHeight/2)-(this.Layer.clientHeight/2): (o.scrollTop+o.clientHeight/2)-(this.Layer.scrollHeight/2); this.m_pos_x = isIE ? (o.scrollLeft+o.clientWidth/2)-(this.Layer.clientWidth/2): (o.scrollLeft+o.clientWidth/2)-(this.Layer.scrollWidth/2); if ( this.m_pos_y < this.min_y ) this.m_pos_y = this.min_y; this.Layer.style.left = this.m_pos_x; this.Layer.style.top = this.m_pos_y; this.open = true; } this.setHeight = function(h) { this.iframe.style.height = h; }; this.setWidth = function(w){ this.iframe.style.width = w; }; this.getHeight = function() { return this.iframe.style.height; }; this.getWidth = function(){ return this.iframe.style.width; }; this.onScroll = function() { offset_y = document.body.scrollTop - this.scrollPosition; this.scrollPosition = document.body.scrollTop; var this_layer = document.getElementById( this.name); y = parseInt( this_layer.style.top); this_layer.style.top = (y+offset_y body.offsetHeight ) { this.setHeight( ((h < this.height)?h:this.height) - (body.offsetHeight - body.scrollHeight)); } } this.centerWindow(); } } // $Id: pop_layer2.js,v 1.7 2006/10/04 12:33:32 andy Exp $ isIE=document.all; isNN=!document.all&&document.getElementById; ddEnabled=false; min_y = 0; function PopLayer2( name, title, content, header) { //------------------------------------- // Local Variables //------------------------------------- this.whichDog = false; this.content = content; this.name = name; this.title = title; this.min_y = 0; this.m_pos_y = 0; this.m_pos_x = 0; this.offsetx = 0; this.offsety = 0; this.width = 1; this.open = false; this.align = "center"; this.bgcolor = "#FFFFFF"; this.div_style = ""; this.scrollPosition=document.body.scrollTop; if ( !header ) { this.header = '\ \ \ \ \
\ \ \ \ \ \ \ \ \
$$title$$
\ \ \ \ \ \ \ \
$$content$$
\
\
'; } else { this.header = header; } this.Layer = isIE ? document.all[name] : document.getElementById(name); this.Layer.style.zIndex=10000; __popLayers__[this.name] = this; //------------------------------------- // Methods //------------------------------------- this.hideMe = function() { this.Layer.innerHTML = ""; if (isIE||isNN) this.Layer.style.visibility="hidden"; ddEnabled = false; this.open = false; }; this.centerWindow = function() { if ( this.Layer.scrollWidth > 80 ) { this.Layer.style.visibility="visible"; var o = document.body; this.m_pos_y = isIE ? (o.scrollTop+o.clientHeight/2)-(this.Layer.clientHeight/2) : (o.scrollTop+o.clientHeight/2)-(this.Layer.scrollHeight/2); this.m_pos_x = isIE ? (o.scrollLeft+o.clientWidth/2)-(this.Layer.clientWidth/2) : (o.scrollLeft+o.clientWidth/2)-(this.Layer.scrollWidth/2); if ( this.m_pos_y < this.min_y ) this.m_pos_y = this.min_y; this.Layer.style.left = this.m_pos_x; this.Layer.style.top = this.m_pos_y; this.open = true; } else { mySetTimeout( this, this.centerWindow, 1000); } } this.showMe = function() { if (isIE||isNN) { var c = this.header.replace( "\$\$title\$\$", this.title); c = c.replace( /\$\$name\$\$/g, this.name); c = c.replace( /\$\$width\$\$/g, this.width); c = c.replace( /\$\$align\$\$/g, this.align); c = c.replace( /\$\$bgcolor\$\$/g, this.bgcolor); c = c.replace( /\$\$div_style\$\$/g, this.div_style); c = c.replace( "\$\$content\$\$", this.content); this.Layer.innerHTML = c; mySetTimeout( this, this.centerWindow, 100); } }; this.onScroll = function() { offset_y = document.body.scrollTop - this.scrollPosition; this.scrollPosition = document.body.scrollTop; this_layer = document.getElementById( this.name); y = parseInt( this_layer.style.top); this_layer.style.top = (y+offset_y= 0 ); } function getQualifiedName(formElement) { var i, j, fs = document.forms; _end: for (i = 0; i < fs.length; i++) { var f = fs[i].elements; for (j = 0; j < f.length; j++) { if (f[j] == formElement) { break _end; } } } return 'document.forms[' + i + '].elements[' + j + ']'; } function getTooltipDiv() { if ( document.getElementById ) return document.getElementById('divPicklistTooltip'); else if ( document.all ) return document.all.divPicklistTooltip; else return null; } function createTooltipDiv(objSel) { // var ev = "setupPicklist(" + getQualifiedName(objSel) + ")"; if ( !getTooltipDiv()) // if this is the first time this function is { // called then create the tooltip text window. var tooltipDiv = "

"; if ( document.body.insertAdjacentHTML ) { document.body.insertAdjacentHTML("beforeEnd",tooltipDiv); } else if ( document.createTextNode ) { var div = document.createElement("div"); div.innerHTML = tooltipDiv; document.body.appendChild(div); } else if ( document.body.innerHTML ) { document.body.innerHTML += tooltipDiv; } return true; } return false; } function showTooltipText(objSel) { if ( !objSel || objSel.tagName.toLowerCase() != "select" ) // null or not setup { return false; } var divPicklistTooltip = getTooltipDiv(); var s = divPicklistTooltip.innerHTML = ""; with ( objSel ) { if ( strKeyInBuf=="" && title.length ) { s = '' + title + ''; } else if ( selectedIndex>=0 && strKeyInBuf==options[selectedIndex].text ) // unique match found { s = '' + strKeyInBuf + ''; } else { var c = strKeyInBuf.substring(strKeyInBuf.length-1,strKeyInBuf.length); c = ( c == ' ' ) ? ' ' : '' + c + ''; s = strKeyInBuf.substring(0,strKeyInBuf.length-1) + c; } divPicklistTooltip.innerHTML = '' + '
'+s+'
'; // update data elements var r = YD.getRegion(objSel); YD.setStyle( divPicklistTooltip, "left", r.left ); YD.setStyle( divPicklistTooltip, "top", r.top-(r.bottom-r.top)-4 ); YD.setStyle( divPicklistTooltip, "display", "" ); var r2 = YD.getRegion( divPicklistTooltip ); YD.setStyle( divPicklistTooltip.previousSibling, "left", r.left ); YD.setStyle( divPicklistTooltip.previousSibling, "top", r.top-(r.bottom-r.top)-4 ); YD.setStyle( divPicklistTooltip.previousSibling, "width", r2.right-r2.left); YD.setStyle( divPicklistTooltip.previousSibling, "height", r2.bottom-r2.top ); YD.setStyle( divPicklistTooltip.previousSibling, "display", "" ); } // end with return true; } function hideTooltipText(objSel) { if (objSel) objSel.strKeyInBuf = ""; var divPicklistTooltip = getTooltipDiv(); YD.setStyle( divPicklistTooltip, "display", "none" ); YD.setStyle( divPicklistTooltip.previousSibling, "display", "none" ); return divPicklistTooltip.innerHTML = ""; } function findSelectEntry( objSel, head, tail ) // uses divide-and-conquer search, assumes sorted list { with ( objSel ) { if ( options.length <= 0 ) { strKeyInBuf = ' No selections available. '; showTooltipText(objSel); top.status = strKeyInBuf = ""; return -1; } if ( strKeyInBuf == "" ) { showTooltipText(objSel); picklistChange(objSel, 0); picklistChange(objSel, options[selectedIndex].text.length ? -1 : 0); return( selectedIndex ); } var index = null; var match_count = 0; for (var i = 0; i < options.length; i++) { if (strKeyInBuf.toUpperCase() == options[i].text.substring(0,strKeyInBuf.length).toUpperCase() ) { match_count++; if (index === null) { index = i; // first match } } } if (index !== null) { picklistChange(objSel, index); if (match_count == 1) { // unique match found top.status = strKeyInBuf = options[index].text; } else { top.status = strKeyInBuf = options[index].text.substring(0,strKeyInBuf.length); } showTooltipText(objSel); return selectedIndex; } else { // then since no exact match was found, go back to previous strKeyInBuf (thus the length-1) strKeyInBuf = strKeyInBuf.substring(0,strKeyInBuf.length-1) return findSelectEntry( objSel ); } } // end with } function picklistFocusHandler(e) { var event = e ? e : window.event; // to handle both NS and IE events var objSel = event.target ? event.target : event.srcElement; picklistFocusHandler.objSel = objSel; // update data elements objSel.strKeyInBuf = ""; // display the tooltip help (the title attribute by default) showTooltipText(objSel); } function picklistBlurHandler(e) { var event = e ? e : window.event; // to handle both NS and IE events var objSel = event.target ? event.target : event.srcElement; picklistFocusHandler.objSel = null; top.status = (objSel.selectedIndex>-1) ? objSel.options[objSel.selectedIndex].text : ""; hideTooltipText(objSel); return true; } function picklistMouseOverHandler(e) { var event = e ? e : window.event; // to handle both NS and IE events var objSel = event.target ? event.target : event.srcElement; showTooltipText(objSel); return true; } function picklistMouseOutHandler(e) { var event = e ? e : window.event; // to handle both NS and IE events var objSel = event.target ? event.target : event.srcElement; if ( objSel==picklistFocusHandler.objSel || objSel==document.activeElement ) return true; hideTooltipText(); return true; } function picklistKeyDownHandler(e) { var event = e ? e : window.event; // to handle both NS and IE events var objSel = event.target ? event.target : event.srcElement; var divPicklistTooltip = getTooltipDiv(); with ( objSel ) { // this is to correct the search bug when the list is left open after single-click if ( strKeyInBuf=="" && event.keyCode>40 ) { objSel.blur(); objSel.focus(); } switch(event.keyCode) { case(8): // backspace { if ( selectedIndex>=0 && strKeyInBuf==options[selectedIndex].text ) { top.status = strKeyInBuf = ""; } else { top.status = strKeyInBuf = strKeyInBuf.substring(0,strKeyInBuf.length-1); } picklistChange(objSel, findSelectEntry(objSel)); try {event.keyCode=0;} catch( e) {} return false; } case(9): // tab case(13): // enter { try {event.keyCode=9;} catch( e) {} return true; } case(27): // escape { top.status = strKeyInBuf = ""; picklistChange(objSel, 0); picklistChange(objSel, options[selectedIndex].text.length ? -1 : 0); showTooltipText(objSel); try {event.keyCode=0;} catch( e) {} return false; } case(32): // space { top.status = strKeyInBuf += ' '; // this must be fired explicitely for spaces return picklistKeyPressHandler(event); } // I don't know if these are universal case(33): // page up case(34): // page down case(35): // end case(36): // home case(37): // left arrow case(38): // up arrow case(39): // right arrow case(40): // down arrow { top.status = hideTooltipText(objSel); return true; } } // end switch } // end with return true; } function picklistKeyPressHandler(e) { var event = e ? e : window.event; // to handle both NS and IE events var objSel = event.target ? event.target : event.srcElement; var inputChar = String.fromCharCode(event.keyCode ? event.keyCode : event.charCode); if ( inputChar=='\n' || inputChar=='\r' ) { top.status = objSel.strKeyInBuf = ( objSel.selectedIndex>-1 ? objSel.options[objSel.selectedIndex].text : "" ); } if ( isvalidchar(inputChar) && event.charCode!=0 ) { objSel.strKeyInBuf += inputChar; // must use setTimeout to override the default SELECT keypress event(s) setTimeout( "findSelectEntry(" + getQualifiedName(objSel) +")", 1 ); } return false; } function setupPicklist(objSel) { if ( !document.all && !document.getElementById ) return false; // browser not supported if ( !objSel || (""+objSel.type).substring(0,6).toLowerCase()!="select") return false; // null or not a select //alert('setup : ' + objSel.form); createTooltipDiv(objSel); // create/init data elements // objSel.X = getX(objSel)+2; // objSel.Y = getY(objSel)-20; objSel.strKeyInBuf = ""; // setup event handlers objSel.onclick = function(){top.status=hideTooltipText(this);} objSel.onfocus = picklistFocusHandler; objSel.onblur = picklistBlurHandler; objSel.onmouseover = picklistMouseOverHandler; objSel.onmouseout = picklistMouseOutHandler; objSel.onkeydown = picklistKeyDownHandler; objSel.onkeypress = picklistKeyPressHandler; objSel.onkeyup = null; return true; } function picklistChange(objSel, newindex) { if( objSel.selectedIndex != newindex ) { objSel.selectedIndex = newindex>-1?newindex:0; if (typeof objSel.onchange == "function") { objSel.onchange(); } } } function setupPickListAll() { var fs = document.forms; for (var i = 0; i < fs.length; i++) { var f = fs[i].elements; for (var j = 0; j < f.length; j++) { if (f[j].type == 'select-one' && MIN_PICKLIST_OPTIONS=0;i--) { if ( /\{/.test( cssrules[i]) ) { newrule = cssrules[i].split("{"); if ( /\{/.test( cssrules[i]) ) { if ( !(/^\s*$/.test( newrule[1])) ) { obj.css_obj.addRule(newrule[0],newrule[1]); } } } } } else if( obj.css_obj.cssRules ) { //Firefox etc for( var i=cssrules.length-1;i>=0;i--) { if ( /\{/.test( cssrules[i]) ) { obj.css_obj.insertRule(cssrules[i]+"}",0); } } } } catch ( e) { alert( e.message)} } this.addStyleSheet( "div.top {position:relative;border:0px solid red;padding:0px;}\ div.buttonNewDiv{}\ div.buttonNewDiv input{ font-family:Arial;font-size:10px;font-weight:bold;margin-bottom:5px;}\ div.top td {padding:0px;}\ div.top div.subDiv{position:absolute;left:0px;top:0px;border:0px solid red;}\ div.top div.subDiv div.view_mode{display:none;}\ div.top div.subDivActive{position:absolute;left:0px;top:0px;}\ div.top div.subDivActive div.view_mode{display:;}\ div.top div.view_mode {position:absolute;z-Index:1;}\ div.top div.view_mode div.view {display:;padding:1px;}\ div.top div.view_mode div.view div{border:1px solid black;padding:0px;}\ div.top div.view_mode div.view div div{border:1px solid white;}\ div.top div.view_mode div.note {position:absolute;display:none;}\ div.top div.view_mode_over {position:absolute;z-Index:2;}\ div.top div.view_mode_over div.view {display:;border:1px solid #FFFFA0;}\ div.top div.view_mode_over div.view div{border:1px solid black;}\ div.top div.view_mode_over div.view div div{border:1px solid white;}\ div.top div.view_mode_over div.note {position:absolute;display:;border:1px solid black;padding:2px;background:#FFFFA0;white-space:nowrap;font-family:Arial;font-size:12px;color:black;}\ div.top div.subDivEdit{z-Index:10;position:absolute;left:0px;top:0px;border:1px dashed white;}\ div.top div.subDivEdit div {border:1px dashed black;}\ div.top div.subDivEdit div td {position:relative;cursor:move;border:0px;}\ div.top div.subDivEdit div div {position:absolute;border:1px solid black;\ width:7px;//width:9px;\ height:7px;//height:9px;\ background: white;font-size:1px;}\ div.top div.editForm{position:absolute;background:transparent !important;border:0px !important;left:-3px;z-Index:20;}\ div.top div.editForm table{border:0px;border-collapse:collapse;background:transparent;width:250px;}\ div.top div.editForm th.top_th{border:1px solid black;background:#FFFFA0;text-align:left;}\ div.top div.editForm th{border:0px;background:transparent;padding-right:20px;text-align:left;}\ div.top div.editForm th textarea{border:0px;overflow:visible;background:#FFFFA0;}\ div.top div.editForm th input{font-family:Arial;font-size:12px;font-weight:bold;margin:0px;margin-right:5px;white-space:nowrap;}\ ") var active_over = {} this.allow_edit = allow_edit; this.now_edit = false; this.butNew = this.butNew || "ADD NOTE"; this.butSaveValue = this.butSaveValue || "SAVE"; this.butCancelValue = this.butCancelValue || "CANCEL"; this.butDeleteValue = this.butDeleteValue || "DELETE"; var main_obj = this; main_obj.current_resizer = null; this.img = document.getElementById( img_id); this.map = this.img.nextSibling this.areas = this.map.getElementsByTagName( "area") this.mainDiv = document.createElement("div") this.mainDiv.className = "top" this.img.parentNode.replaceChild( this.mainDiv, this.img) this.subDiv = document.createElement("div") this.subDiv.className = "subDiv" this.mainDiv.appendChild( this.img) this.mainDiv.appendChild( this.subDiv) this.img.onload = function() { main_obj.subDiv.style.width = main_obj.mainDiv.style.width = this.width+3; main_obj.subDiv.style.height = main_obj.mainDiv.style.height = this.height+3; } this.registerEvent = function( obj, event_, func) { if ( event_.pop ) { while( ev = event_.pop() ) { document.all?obj.attachEvent( "on".concat( ev), func):obj.addEventListener( ev, func, false); } } else { document.all?obj.attachEvent( "on".concat( event_), func):obj.addEventListener( event_, func, false); } } if ( this.allow_edit ) { var button_new_div = document.createElement("div"); this.mainDiv.parentNode.insertBefore( button_new_div, this.mainDiv) button_new_div.innerHTML = "" var but = button_new_div.getElementsByTagName( "input")[0] but.value = this.butNew but.onclick = function() {main_obj.editNote(-1)} button_new_div.className = "buttonNewDiv" this.disable_selection = function() { document.onselectstart=function(){return false}; document.onmousedown=function(){return false}; } this.enable_selection = function() { document.onselectstart=function(){return true}; document.onmousedown=function(){return true}; } this.subDivEdit = document.createElement("div") this.subDivEdit.style.display = "none" this.subDivEdit.className = "subDivEdit" this.subDivEdit.innerHTML = "
" this.subDivEdit.editForm = this.subDivEdit.getElementsByTagName( "table")[0].parentNode this.subDivEdit.setCoord = function() { var b_xy = document.all?1:0 if ( arguments.length > 0 ) { this.style.left = (this.childNodes[0].style.left = (this.left = arguments[0])-1)-1; } if ( arguments.length > 1 ) { this.style.top = (this.childNodes[0].style.top = (this.top = arguments[1])-1)-1; } if ( arguments.length > 2 ) { this.style.width = (this.childNodes[0].style.width = (this.td.style.width = this.width = arguments[2])+2*b_xy)+2 } if ( arguments.length > 3 ) { this.style.height = (this.childNodes[0].style.height = (this.td.style.height = this.height = arguments[3])+2*b_xy)+2 } } this.subDivEdit.editFormTextarea = this.subDivEdit.editForm.getElementsByTagName( "textarea")[0] this.subDivEdit.editFormTextarea.rows = 1 this.subDivEdit.editFormTextarea.cols = 40 this.subDivEdit.editFormTextarea.set_top = function() { this.resize() if ( document.all ) { this.parentNode.parentNode.parentNode.parentNode.style.width = this.offsetWidth-(-25)<250?250:this.offsetWidth-(-25) } main_obj.subDivEdit.editForm.style.top = main_obj.subDivEdit.height + 10 } this.subDivEdit.editFormTextarea.resize = function() { if ( !document.all ) { this.style.whidth = "100%"; while( this.rows > 1 && this.scrollHeight == this.offsetHeight ) this.rows = this.rows - 1 while( this.scrollHeight > this.offsetHeight ) this.rows = this.rows + 1 if ( this.rows > 1 ) this.rows = this.rows + 1 while( this.cols > 1 && this.scrollWidth == this.offsetWidth ) this.cols = this.cols - 1 while( this.scrollWidth > this.offsetWidth ) this.cols = this.cols + 2 } } this.registerEvent( this.mainDiv, "click", function() { main_obj.subDivEdit.editFormTextarea.focus() } ) this.registerEvent( this.subDivEdit.editFormTextarea, ["keyup","keydown","focus","blur"], function() { main_obj.subDivEdit.editFormTextarea.set_top()} ) var t = this.subDivEdit.editForm.getElementsByTagName( "input") this.subDivEdit.editFormButtons = [] this.subDivEdit.editFormButtons[0] = t[0] this.subDivEdit.editFormButtons[1] = t[1] this.subDivEdit.editFormButtons[2] = t[2] this.subDivEdit.editFormButtons[0].value = this.butSaveValue; this.subDivEdit.editFormButtons[0].onclick = function(){ main_obj.editSave()}; this.subDivEdit.editFormButtons[1].value = this.butCancelValue; this.subDivEdit.editFormButtons[1].onclick = function(){ main_obj.editCancel()}; this.subDivEdit.editFormButtons[2].value = this.butDeleteValue; this.subDivEdit.editFormButtons[2].onclick = function(){ main_obj.editDelete()}; this.subDivEdit.td = this.subDivEdit.getElementsByTagName( "td")[0] var mv = this.subDivEdit.td.getElementsByTagName( "div") this.subDivEdit.td.topDiv = mv[0].topDiv = mv[1].topDiv = mv[2].topDiv = mv[3].topDiv = this.subDivEdit mv[0].style.left = mv[0].style.top = mv[1].style.right = mv[1].style.top = mv[2].style.left = mv[2].style.bottom = mv[3].style.right = mv[3].style.bottom = -2 mv[0].style.cursor = "nw-resize";mv[1].style.cursor = "ne-resize";mv[2].style.cursor = "sw-resize";mv[3].style.cursor = "se-resize" var mousedown = function( e) { main_obj.disable_selection() var obj = (e && e.target) || (event && event.srcElement) main_obj.current_resizer = obj main_obj.mx=(e || event).clientX; main_obj.my=(e || event).clientY; switch( obj ) { case main_obj.subDivEdit.td :{main_obj.current_resizer_type=5;break;} case obj.parentNode.childNodes[0] :{main_obj.current_resizer_type=1;break;} case obj.parentNode.childNodes[1] :{main_obj.current_resizer_type=2;break;} case obj.parentNode.childNodes[2] :{main_obj.current_resizer_type=3;break;} case obj.parentNode.childNodes[3] :{main_obj.current_resizer_type=4;break;} default:main_obj.current_resizer_type=0; } } var mouseup = function( e) { main_obj.enable_selection() var obj = (e && e.target) || (event && event.srcElement) main_obj.current_resizer = null; } this.registerEvent( mv[0], "mousedown", mousedown) this.registerEvent( mv[1], "mousedown", mousedown) this.registerEvent( mv[2], "mousedown", mousedown) this.registerEvent( mv[3], "mousedown", mousedown) this.registerEvent( this.subDivEdit.td, "mousedown", mousedown) this.registerEvent( document.body, "mouseup", mouseup) this.registerEvent( this.subDivEdit.td, "mouseup", function() { if ( active_over && active_over.topDiv) { active_over.topDiv.childNodes[0].style.display = "" active_over.topDiv.style.display = "none" } main_obj.subDivEdit.editForm.style.display = "" main_obj.subDivEdit.editFormTextarea.set_top() main_obj.subDivEdit.editFormTextarea.focus() } ) this.registerEvent( document.body, "mousemove", function( e) { if ( main_obj.now_edit ) { var r = main_obj.current_resizer; if ( r != null && main_obj.current_resizer_type > 0 ) { var left, top, width, height, dmx_, dmy_ var b_width = document.all?1:0 var min_size = 12 var cur_left = left = r.topDiv.left; var cur_width = width = r.topDiv.width; var cur_top = top = r.topDiv.top; var cur_height = height = r.topDiv.height; var dmx = (main_obj.mx - (e || event).clientX) var dmy = (main_obj.my - (e || event).clientY) var r_type = main_obj.current_resizer_type switch( r_type ) { case 1: {left = cur_left - dmx;top=cur_top - dmy;break;} case 2: {width = cur_width - dmx;top=cur_top - dmy;break;} case 3: {left = cur_left - dmx;height = cur_height - dmy;break;} case 4: {width = cur_width - dmx;height = cur_height - dmy;break;} case 5: {left = cur_left - dmx;top=cur_top - dmy;break;} } var decX = (dmx>0?1:-1) var decY = (dmy>0?1:-1) while( (r_type == 5 ) && (cur_left!=left) && (cur_left - decX >= 0 ) && (cur_left-(-cur_width)-decX <= main_obj.img.width ) ) { cur_left -= decX;main_obj.mx -= decX;} while( (r_type == 1 || r_type == 3) && cur_left!=left && (cur_left - decX >= 0 ) && (cur_left-(-min_size)-decX <= main_obj.img.width ) && (cur_width-(-decX)>=min_size) ) { cur_left -= decX;cur_width -= -decX;main_obj.mx -= decX;} while( (r_type == 2 || r_type == 4) && cur_width!=width && (cur_width-decX>=min_size) && (cur_left-(-cur_width)-decX <= main_obj.img.width) ) { cur_width -= decX;main_obj.mx -= decX;} while( (r_type == 5 ) && (cur_top!=top) && (cur_top - decY >= 0) && (cur_top-(-cur_height)-decY <= main_obj.img.height ) ) { cur_top -= decY;main_obj.my -= decY;} while( (r_type == 1 || r_type == 2) && cur_top!=top && (cur_top - decY >= 0 ) && (cur_top-(-min_size)-decY <= main_obj.img.height ) && (cur_height-(-decY)>=min_size) ) { cur_top -= decY;cur_height -= -decY;main_obj.my -= decY;} while( (r_type == 3 || r_type == 4) && cur_height!=height && (cur_height-decY>=min_size) && (cur_top-(-cur_height)-decY <= main_obj.img.height) ) { cur_height -= decY;main_obj.my -= decY;} r.topDiv.setCoord( cur_left, cur_top, cur_width, cur_height) r.topDiv.editFormTextarea.set_top() active_over && active_over.topDiv && active_over.topDiv.setCoord && active_over.topDiv.setCoord( cur_left, cur_top) if ( !r_type ) { main_obj.my = (e || event).clientY main_obj.mx = (e || event).clientX } } } } ) this.mainDiv.appendChild( this.subDivEdit); this.editNote = function( index, e) { this.subDivEdit.style.display = "" this.now_edit = 1 if ( main_obj.subDiv.timeout ) { clearTimeout( main_obj.subDiv.timeout); main_obj.subDiv.timeout = 0; } main_obj.subDiv.className= "subDivActive"; if ( index > -1 ) { this.subDivEdit.index = index var coords = this.areas[index].coords.split( ",") this.subDivEdit.editFormTextarea.value = this.areas[index].title this.subDivEdit.setCoord( coords[0], coords[1], coords[2]-coords[0], coords[3]-coords[1]) this.subDivEdit.editFormButtons[2].style.display = "" main_obj.current_resizer = this.subDivEdit.td main_obj.mx=(e || event).clientX main_obj.my=(e || event).clientY main_obj.current_resizer_type=5 } else { if ( active_over.topDiv ) { active_over.topDiv.style.display = ""; active_over.topDiv.childNodes[0].style.visibility = "visible"; active_over.topDiv.className = "view_mode"; } this.subDivEdit.index = index this.subDivEdit.editFormTextarea.value = "" this.subDivEdit.setCoord( 20, 20, 30, 30) this.subDivEdit.editFormButtons[2].style.display = "none" active_over = {} this.subDivEdit.editFormTextarea.set_top() this.subDivEdit.editFormTextarea.focus() } } this.editCancel = function() { if ( this.now_edit ) { this.subDivEdit.style.display = "none" if ( active_over.topDiv ) { active_over.topDiv.style.visibility = "visible"; } this.now_edit = 0 this.reset() } } this.editSave = function() { if ( this.now_edit ) { if ( this.subDivEdit.index == -1 ) { this.areas = this.map.getElementsByTagName( "area") var area = document.createElement("area") area.shape = "RECT" area.coords = "".concat(parseInt( this.subDivEdit.style.left)+2, ",", parseInt( this.subDivEdit.style.top)+2, ",", parseInt( this.subDivEdit.style.left)+2+parseInt( this.subDivEdit.td.style.width), ",", parseInt( this.subDivEdit.style.top)+2+parseInt( this.subDivEdit.td.style.height)); area.href = "./" area.title = this.subDivEdit.editFormTextarea.value this.map.appendChild( area) } else { this.areas[this.subDivEdit.index].coords = "".concat( parseInt( this.subDivEdit.style.left)+2, ",", parseInt( this.subDivEdit.style.top)+2, ",", parseInt( this.subDivEdit.style.left)+2+parseInt( this.subDivEdit.td.style.width), ",", parseInt( this.subDivEdit.style.top)+2+parseInt( this.subDivEdit.td.style.height)); this.areas[this.subDivEdit.index].title = this.subDivEdit.editFormTextarea.value } this.editCancel() } } this.editDelete = function() { if ( this.now_edit && this.areas[this.subDivEdit.index] ) { this.map.removeChild( this.areas[this.subDivEdit.index]) this.reset() this.editCancel() } } } this.getValue = function() { var res = []; for( var i=0; i=parseInt( main_obj.mainDiv.style.width) || y<0 || y>=parseInt( main_obj.mainDiv.style.height) ) { main_obj.subDiv.timeout = setTimeout( function(){main_obj.subDiv.className = "subDiv";}, 200); } } } ) this.reset = function() { var divs = this.subDiv; var areas = this.areas; while( divs.childNodes.length ) { divs.removeChild( divs.childNodes[0]); } for( var i=0; i 0 ) { this.style.left = (this.childNodes[0].style.left = (this.childNodes[0].childNodes[0].style.left = (this.left = arguments[0])-1)-1)-1; } if ( arguments.length > 1 ) { this.style.top = (this.childNodes[0].style.top = (this.childNodes[0].childNodes[0].style.top = (this.top = arguments[1])-1)-1)-1; } if ( arguments.length > 2 ) { this.style.width = ( this.childNodes[0].style.width = ( this.childNodes[0].childNodes[0].style.width = ( (this.td.style.width = this.width = arguments[2])+2+2*b_xy ) )+2 )+2 } if ( arguments.length > 3 ) { this.style.height = ( this.childNodes[0].style.height = ( this.childNodes[0].childNodes[0].style.height = ( (this.td.style.height = this.height= arguments[3])+2+2*b_xy ) )+2 )+2 } this.note.style.top = this.height + 10 this.note.style.left = 0 } div.className = "view_mode"; div.index = i; div.innerHTML = "