var g_sb_banners = Array(); function getAbsolutePos( _ob ) { if ( _ob == 'window' ) _ob = document.body; else { if( typeof( _ob ) == 'string'  ) { _ob = document.getElementById( _ob ); if ( !_ob ) return Array( 0, 0, 0, 0 ); } } var top = 0, left = 0, width, height; if ( _ob != document.body ) { var t = _ob; do { top += t.offsetTop; t = t.offsetParent; } while ( t.offsetParent ) t = _ob; do { left += t.offsetLeft; t = t.offsetParent; } while ( t.offsetParent ) } width = _ob.offsetWidth; height = _ob.offsetHeight; var r = Array( left, top, width, height ); return r; } function stopPropagation( _e ) { if ( window.event ) { window.event.cancelBubble = true; window.event.returnValue = false; } else { if ( _e ) _e.stopPropagation(); } } var time_shown = 0; var _do_not_cancel_a_s = 0; function cancel_popup() { var obj = document.getElementById( 'other_versions_popup' ); if ( obj ) { var oDate = new Date(); if ( time_shown ) { time_diff = time_shown - oDate.getTime(); if ( Math.abs( time_diff ) > 200 ) if ( obj.style.display == 'block' ) { obj.style.display = 'none'; time_shown = 0; } } } var a_s = document.getElementById( 'a_s' ); if ( _do_not_cancel_a_s ) _do_not_cancel_a_s = 0; else { if ( a_s && a_s.style.display != 'none'  ) a_s.style.display = 'none'; } } function checktagitform() { var nosub; var ob = document.getElementById( 'tagitnosubmit' ); if ( ob ) nosub = ob.value; ob = document.getElementById( 'tagit' ); if ( ob ) testsub = ob.value; if ( testsub == nosub ) { alert( "Please enter your tag" ); return false; } return true; } gInit = 0; function initialize() { if ( gInit ) return; gInit = 1; oTagit = document.getElementById( 'tagitform' ); if ( oTagit ) oTagit.onsubmit = checktagitform; if ( g_onload_r.length ) { for ( i in g_onload_r ) { a = g_onload_r[ i ]; a += '();'; eval( a ); } } if ( g_pr_r.length ) process_js_price(); } function jsnumeric( _v, _off ) { var v = parseFloat( _v ); c = 3; if ( v > _off && _off ) v = v.toFixed( 0 ); else { v = v.toFixed( 2 ); c = 6; } v = v.toString(); var out = ''; for ( var i = v.length -1; i >= 0; i-- ) { out = v.substr( i, 1 ) + out; if ( !i ) break; if ( !--c ) { out = ',' + out; c = 3; } } return out; } function process_js_price() { for ( var i in g_pr_r ) { var obj = g_pr_r[ i ]; var string = ''; var cur; var index = document.getElementById( 'sel_currency' ).value; for ( var ii in g_cur_r ) { cur = g_cur_r[ ii ]; if ( cur.c == index ) break; } var ol = cl = ''; if ( !obj.c || obj.c == 1 || ( obj.c == -1 && index == 1 )) { string += 'US$ ' + jsnumeric( obj.v, 0 ); if ( obj.uc != 1 ) { ol = ' ('; cl = ')'; } } if ( cur.c != 1 && obj.c != 1 ) { string += '<span style="white-space: nowrap;">' + ol; if ( cur.n == 'JPY' ) cur.n = '&yen;'; string += '~' + cur.n + ' '; string += jsnumeric( obj.v / cur.v, 999 ) + cl + '</span>'; } var dest = document.getElementById( 'jscur_' + obj.id ); dest.innerHTML = string; } } function js_load(){ if ( !g_jsload_r ) return; if (g_jsload_r.length ) for ( i in g_jsload_r ){ eval( g_jsload_r[ i ] ); } js_loaded = true; } handle_search_click( false ); function handle_search_click( _disable ) { var pquery = document.getElementsByName( 'p_query' ); if ( pquery.length ) { var good = 0; for ( var i = 0; i < pquery.length; i++ ) { if ( pquery[ i ].value.length == 0 ){}else good++; } if ( !good ) { return false; } } var res1 = handle_search_click1( _disable, 'submit_searchbox' ); var res2 = handle_search_click1( _disable, 'submit_advancedsearch' ); if ( res1 == false || res2 == false ) { return false; } if ( _disable ) { setTimeout( 'handle_search_click( false )', 3000 ); } return true; } function handle_search_click1( _disable, _element ) { var obj = document.getElementsByName( _element ); if ( obj.length ) { var disabled = obj[ 0 ].disabled; obj[ 0 ].disabled = _disable; return disabled ? false : true; } return true; } function Pabanner( _name, _w, _h, _left, _top ) { this._name = _name; this._width = _w; this._height = _h; this._top = _top; this._left = _left; this._visible = false; } function Paban( _scrid, _delay, _speed ) { g_sb_banners.push( this ); this._id = _scrid; this._status = 'idle'; this._delay = _delay; this._speed = _speed; this._ban_r = Array(); this._height = 0; this._width = 0; this._margin = 10; this._bannerVisible = 2; this._backlog = Array(); this._scrolled = 0; this._scrollTable = Array(); this._counter = 0; this._interval = 0; var a = document.getElementById( _scrid ); if ( !a ) return; this._height = parseInt( a.style.height ); this._width = parseInt( a.style.width ); this.addImage = function( _string ) { var a = document.getElementById( _string ); var h = parseInt( a.style.height ); var w = parseInt( a.style.width ); var l = 0; var t = parseInt( a.style.top ); this._ban_r.push( new Pabanner( _string, w, h, l, t ) ); }; this.animate = function( _delay ) { var rad = Math.PI / 180; var run = ( this._ban_r[ 0 ]._height + this._margin ) / 8; for ( i = 0; i < run ; i++ ) { var m = i / run * 180; var sin = Math.sin( m * rad ); sin *= 14; sin = parseInt( sin ); this._scrollTable[ i ] = sin; } for ( a in this._ban_r ) { var e = this._ban_r[ a ]; elem = document.getElementById( e._name ); if ( a < this._bannerVisible ) { e._visible = true; } else { this._backlog.push( a ); } } var t = this; setTimeout( function() { t.startAnimate() }, _delay ); }; this.startAnimate = function() { var t = this; this._interval = setInterval( function() { t.doAnimate() }, 16.67 ); }; this.doAnimate = function() { var t = this; this._status = 'animate'; var pixelcount = 2; var e; pixelcount = this._scrollTable[ this._counter++ ]; while( pixelcount-- ) { var iMaxTop = 0; var bRemoved = false; for ( a in this._ban_r ) { e = this._ban_r[ a ]; if ( e._visible == false ) continue; e._top -= 1; if ( e._top < -e._height ) { e._visible = false; this._backlog.push( a ); bRemoved = true; } if ( e._top > iMaxTop ) iMaxTop = e._top; } var iSpace = this._height - ( iMaxTop + e._height ); if ( iSpace == this._margin ) { if ( this._backlog.length ) { a = this._backlog.shift(); e = this._ban_r[ a ]; e._visible = true; e._top = this._height; this.applyPositions(); } } if ( ++this._scrolled == ( e._height + this._margin ) ) { this._counter = 0; this._scrolled = 0; this._status = 'delay'; this.applyPositions(); clearInterval( this._interval ); setTimeout( function() { t.startAnimate() }, this._delay ); return; } } this.applyPositions(); }; this.applyPositions = function() { for ( a in this._ban_r ) { var e = this._ban_r[ a ]; elem = document.getElementById( e._name ); elem.style.top = e._top + 'px'; elem.style.left = e._left + 'px'; elem.style.display = e._visible ? 'block' : 'none'; } } } g_toggleActive = Array(); g_toggleElement = Array(); function toggleElement( _elem ) { if ( typeof( _elem ) != 'string' ) _elem = _elem.id; g_toggleActive[ _elem ] = 'toggle'; var e = document.getElementById( _elem ); if ( !g_toggleElement[ _elem + 'init' ] ) { g_toggleElement[ _elem ] = Array(); g_toggleElement[ _elem + 'init' ] = Array(); } if ( e.style.display == 'none' ) { g_toggleElement[ _elem ][ 'dir' ] = 1; g_toggleElement[ _elem ][ 'srcY' ] = 0; if ( g_toggleElement[ _elem ][ 'tarYo' ] ) { g_toggleElement[ _elem ][ 'tarY' ] = g_toggleElement[ _elem ][ 'tarYo' ]; } else { var spos = e.style.position; e.style.display = 'block'; e.style.visibility = 'hidden'; e.style.position = 'absolute'; g_toggleElement[ _elem ][ 'tarYo' ] = g_toggleElement[ _elem ][ 'tarY' ] = e.clientHeight; e.style.display = 'none'; e.style.visibility = 'visible'; e.style.position = spos; } } else { g_toggleElement[ _elem ][ 'dir' ] = 0; g_toggleElement[ _elem ][ 'srcY' ] = e.clientHeight; g_toggleElement[ _elem ][ 'tarY' ] = 0; } e.style.overflow = 'hidden'; setTimeout( function(){ toggleElementH( _elem ); }, 20 ); } var g_rWindows = {}; function toggleElementH( _elem ) { if ( g_toggleActive[ _elem ] != 'toggle' ) return; ay = g_toggleElement[ _elem ][ 'srcY' ]; by = g_toggleElement[ _elem ][ 'tarY' ]; dx = parseInt( by ) - parseInt( ay ); dx = parseInt( dx / 3 ); if ( Math.abs( dx ) < 1 ) dx = g_toggleElement[ _elem ][ 'dir' ] ? 1 : - 1; if ( g_toggleElement[ _elem ][ 'dir' ] && ay < g_toggleElement[ _elem ][ 'tarY' ] ) ay += dx; if ( !g_toggleElement[ _elem ][ 'dir' ] && ay > g_toggleElement[ _elem ][ 'tarY' ] ) ay += dx; g_toggleElement[ _elem ][ 'srcY' ] = ay; var e = document.getElementById( _elem ); e.style.height = g_toggleElement[ _elem ][ 'srcY' ] + 'px'; if ( g_toggleElement[ _elem ][ 'srcY' ] != g_toggleElement[ _elem ][ 'tarY' ] ) { if ( e.style.display != 'block' ) { e.style.display = 'block'; e.focus(); } setTimeout( function() { toggleElementH( _elem ); }, 20 ); return; } if ( !g_toggleElement[ _elem ][ 'dir' ] ) { e.style.display = 'none'; if ( g_rWindows ) if ( g_rWindows[ _elem ] ) g_rWindows[ _elem ].onClose(); } if ( e.style.display == 'block' ) e.focus(); g_toggleActive[ _elem ] = ''; } g_resizeElement = Array(); function resizeElement( _elem, _tw, _th ) { if ( typeof( _elem ) != 'string' ) _elem = _elem.id; g_toggleActive[ _elem ] = 'resize'; if ( !g_toggleElement[ _elem ] ) g_toggleElement[ _elem ] = Array(); g_resizeElement[ _elem ] = Array(); g_resizeElement[ _elem ][ 'tarW' ] = _tw; g_resizeElement[ _elem ][ 'tarH' ] = _th; g_resizeElement[ _elem ][ 'srcH' ] = e.offsetHeight; g_resizeElement[ _elem ][ 'srcW' ] = e.offsetWidth; setTimeout( function() { resizeElementH( _elem ); }, 20 ); } function resizeElementH( _elem ) { if ( g_toggleActive[ _elem ] != 'resize' ) return; var e = document.getElementById( _elem ); var ay = g_resizeElement[ _elem ][ 'srcH' ]; var by = g_resizeElement[ _elem ][ 'tarH' ]; var dx = parseInt( by ) - parseInt( ay ); if ( dx ) { var way = dx / Math.abs( dx ); dx = parseInt( dx / 3 ); if ( !dx ) dx = way; ay += dx; g_resizeElement[ _elem ][ 'srcH' ] = ay; e.style.height = ay + 'px'; } if ( ay != by ) { setTimeout( function() { resizeElementH( _elem ); }, 20 ); return; } g_toggleActive[ _elem ] = ''; } function Ajax() { this._url = '/paOS-42-28-'; this._param = ''; this._type = 'GET'; this._target = ''; this._windowTarget = ''; this._setFocus = undefined; this._append = false; this._anchor = undefined; this.onLoad = undefined; this._omitLoading = false; this.vars = undefined; this._loadingContent = '<img src="/loading.gif">'; this.setType = function( _t ){ this._type = _t; }; this.setTarget = function( _t ){ if ( isWindow( _t ) ) { this._windowTarget = _t; this._target = sendWindowMessage( _t, WM_TARGET_ID, 0 );} else this._target = _t; }; this.setURL = function( _t ){ this._url = _t; }; this.setParam = function( _t ){ this._param = _t; }; this.setLoading = function( _t ){ this._loadingContent = _t; }; this.setOmitLoading = function( _t ){ this._omitLoading = _t; }; this.setOnLoad = function( _t ){ this.onLoad = _t; }; this.setFocus = function( _t ){ this._setFocus = _t ; }; this.getTarget = function() { if ( this._target ) { var id = document.getElementById( this._target); return id; } else return( false ); }; this.setInner = function( _value ) { if ( this.getTarget() ) { if ( this._append ) { this.getTarget().innerHTML += _value; return; } else { var t = document.createElement( 'div' ); t.display = 'none'; t.innerHTML = _value; if ( t.childNodes.length ) { id = t.childNodes[ 0 ].id; if ( id == this._target ) { this.getTarget().parentNode.replaceChild( t.childNodes[ 0 ], this.getTarget() ); return; } } this.getTarget().innerHTML = _value; } } }; this.sendRequest = function() { if ( !this._append && !this._omitLoading ) this.setInner( this._loadingContent ); var hr; if ( window.XMLHttpRequest ) { hr = new XMLHttpRequest(); if ( hr.overrideMimeType ) { hr.overrideMimeType( 'text/html' ); } } else if ( window.ActiveXObject ) { try { hr = new ActiveXObject( "Msxml2.XMLHTTP" ); } catch( e ) { try { hr = new ActiveXObject( "Microsoft.XMLHTTP" ); } catch( e ){} } } if ( !hr ) { return false; } var url; if ( this._type == 'GET' && this._param.length ) { url = this._url + this._param + '-94-' + new Date().getTime(); this._param = ''; } else { if ( this._url.search( /\?/ ) ) url = this._url + '-94-' + new Date().getTime(); else url = this._url + '-94-' + new Date().getTime(); } hr.open( this._type, url, true); hr.setRequestHeader( "Content-type", "application/x-www-form-urlencoded" ); var self = this; hr.onreadystatechange = function() { self.checkResult( hr ) }; hr.send( this._param ); return true; }; this.checkResult = function( _i ) { result = true; var focus_b, top, element; if ( _i.readyState == 4 ) { if ( _i.status == 200 ) { if ( this._anchor ) { var offset = window.pageYOffset; if ( !offset) offset = document.body.scrollTop; if ( document.getElementById( this._anchor ) ) { focus_b = document.getElementById( this._anchor ); top = -10; element = focus_b; while ( element.offsetParent ) { top += element.offsetTop; element = element.offsetParent; } oldtop = top; } } if ( this.getTarget() ) this.setInner( _i.responseText ); if ( this._anchor ) { if ( document.getElementById( this._anchor ) ) { focus_b = document.getElementById( this._anchor ); top = -10; element = focus_b; while ( element.offsetParent ) { top += element.offsetTop; element = element.offsetParent; } window.scroll( 0, offset + ( top - oldtop ) ); } } result = true; if ( !this.stdProcess( _i.responseText, this ) ) { var onLoadDone = false; if ( this.onLoad ) { onLoadDone = this.onLoad( _i.responseText, this ); } if ( this._setFocus ) { var fc = document.getElementById( this._setFocus ); if ( fc ) fc.focus(); } } } else { result = false; } delete _i; } return result; }; this.stdProcess = function( _i ) { var m; if ( m = _i.match( /<!--PADO_REDIRECT:\s*"([^"]+)"-->\s*/i ) ) { if ( m.length > 1 ) { window.location = m[ 1 ]; return true; } } if ( _i.match( /<!--PADO_CLOSE_WINDOW-->/i ) ) { sendWindowMessage( this._windowTarget, WM_CLOSE, 0 ); return true; } if ( m = _i.match( /<!--PADOSCRIPT(.+)-->/i ) ) { eval( m[ 1 ] ); return false; } return false; }; } function _aj_window2( _v ) { var w = isWindow( _v.id ); if ( !w ) { w= new Window( _v.id, 0, 0, _v.width, _v.height, WS_NODRAG | WS_TITLEBAR | WS_NOMINIMIZE, _v.title ); w.show( SW_SHOWTOGGLE ); w.ajax.setParam( _v.param ); if ( _v.onload ) w.ajax.onLoad += _v.onload; w.ajax.sendRequest(); w.ajax.setFocus( _v.focus ); if ( _v.anchor ) w.anchorTo( _v.anchor, 4, 4 ); } else w.show( SW_SHOWTOGGLE ); } function _replace_link( _id, _t ) { var o = document.getElementById( _id ); if ( o ) { o.href = 'javascript:' + _t; o.onclick = ''; o.target = ''; } } function _replace_click( _id, _t ) { var o = document.getElementById( _id ); if ( o ) { _t = 'function(){ ' + _t + '};'; o.onclick = _t; } } function Table() { this.id = ''; this.ob = 'undefined'; this.rows = 'undefined'; this.initializeFromDOM = function( _t ) { this.ob = document.getElementById( _t ); if ( this.ob ){ this.rows = this.ob.getElementsByTagName( 'tbody' )[ 0 ].rows; return true; } return false; }; this.deleteRow = function( _r ) { if ( this.ob == 'undefined' ) return false; var otr = this.ob.getElementsByTagName( "tbody" )[ 0 ]; if ( _r >= otr.rows.length ) return false; return( otr.deleteRow( this.getRowIndex( _r ) ) ); }; this.addRow = function( _r ) { if ( this.ob == 'undefined' ) return false; var otr = this.ob.getElementsByTagName( "tbody" )[ 0 ]; return( otr.appendChild( _r ) ); }; this.replaceRow = function( _r, _newr ) { if ( this.ob == 'undefined' ) return false; var otr = this.ob.getElementsByTagName( "tbody" )[ 0 ]; for ( var i in otr.rows ) { if ( otr.rows[ i ] == _r ) { otr.replaceChild( _newr, otr.rows[ i ] ); return true; } } return false; }; this.getRowIndex = function( _row ) { if ( this.ob == 'undefined' ) return false; var otr = this.ob.getElementsByTagName( "tbody" )[ 0 ]; for ( var i = 0; i < otr.rows.length; i++ ) if ( otr.rows[ i ] == _row ) return i; return -1; }; this.findRow = function( _str ) { if ( this.ob == 'undefined' ) return false; var otr = this.ob.getElementsByTagName( "tbody" )[ 0 ]; for ( var i = 0; i < otr.rows.length; i++ ) for ( c = 0; c <  otr.rows[ i ].children.length; c++  ) if ( otr.rows[ i ].children[ c ].innerText == _str ) return otr.rows[ i ]; return 'undefined'; }; this.progressRow = function( _size ) { if ( !_size ) _size = 32; var row = document.createElement( 'tr' ); var td = document.createElement( 'td' ); var img = document.createElement( 'img' ); img.src = '\loading' + _size + '.gif'; img.setAttribute( 'width', _size + 'px' ); img.setAttribute( 'height', _size + 'px' ); td.appendChild( img ); td.setAttribute( 'colspan', 100 ); td.setAttribute( 'align', 'center' ); row.appendChild( td ); id = Math.random(); row.id = id; return row; }; } var WS_TITLEBAR = 1; var WS_CANCLOSE = 2; var WS_NOESCCLOSE = 4; var WS_NODRAG = 8; var WS_NOMINIMIZE = 16; var SW_HIDE = 1; var SW_SHOWTOGGLE = 2; var SW_SHOW = 3; var SW_CLOSE = 4; var SW_MOVE = 5; var SW_MINIMIZE = 6; var WM_RESIZE = 1; var WM_TARGET_ID = 2; var WM_CLOSE = 3; var g_rWindows = Array(); function sendWindowMessage( _id, _m, _p ) { if ( g_rWindows[ _id ] ) { return g_rWindows[ _id ].message( _m, _p ); } return false; } function isWindow( _id ) { return g_rWindows[ _id ]; } function resizeWindow( _id ) { sendWindowMessage( _id, WM_RESIZE, 0 ); } function minimizeWindow( _id ) { if ( g_rWindows[ _id ] ) g_rWindows[ _id ].animate( SW_MINIMIZE ); } function closeWindow( _id ) { if ( g_rWindows[ _id ] ) { if ( g_rWindows[ _id ]._useExisting ) g_rWindows[ _id ].animate( SW_HIDE ); else g_rWindows[ _id ].animate( SW_HIDE ); } } function Window( _id, _x, _y, _w, _h, _status, _title ) { var self = this; this.message = function( _m, _p ) { switch( _m ) { case WM_RESIZE: setTimeout( function(){ self.resize( 1 ), 100} ); break; case WM_TARGET_ID: return this._targetId; break; case WM_CLOSE: return this.closeWindow(); break; } return true; }; this.closeWindow = function() { if ( this._useExisting ) this.animate( SW_HIDE ); else this.animate( SW_HIDE ); }; this.onClose = function() { }; this.show = function( _flag ) { switch( _flag ) { case SW_HIDE: this._div.style.display = 'none'; break; case SW_SHOWTOGGLE: this.animate( SW_SHOWTOGGLE ); break; case SW_SHOW: this._div.style.display = 'block'; this._div.style.visibility = 'visible'; break; } }; this.setHTML = function( _html ) { document.getElementById( this._targetId ).innerHTML = _html; }; this.anchorTo = function( _id, _idcorner, _thiscorner ) { this._anchorTo = _id; this._anchorA1 = _idcorner; this._anchorT1 = _thiscorner; this.position( true ); }; this.position = function( _changeVisibility ) { if ( !this._div ) return false; var posx, posy; var r; if ( this._anchorTo == 'website' ) { r = document.getElementById( this._anchorTo ); if ( !r ) return false; r = getAbsolutePos( this._anchorTo ); if ( window.innerHeight ) { r[ 3 ] = parseInt( window.innerHeight / 1 ); r[ 3 ] -= parseInt( window.innerHeight / 10 ); } else { r[ 3 ] = document.documentElement.clientHeight; } } else { r = getAbsolutePos( this._anchorTo ); if ( !r ) return false; r = getAbsolutePos( this._anchorTo ); } switch( this._anchorA1 ) { case 0: posx = r[ 0 ]; posy = r[ 1 ]; break; case 1: posx = r[ 0 ] + r[ 2 ]; posy = r[ 1 ]; break; case 2: posx = r[ 0 ] + r[ 2 ]; posy = r[ 1 ] + r[ 3 ]; break; case 3: posx = r[ 0 ]; posy = r[ 1 ] + r[ 3 ]; break; case 4: posx = parseInt( ( r[ 2 ] - r[ 0 ] ) / 2 ); posy = parseInt( ( r[ 3 ] - r[ 1 ] ) / 2 ); break; } if ( _changeVisibility ) { var olddisplay = this._div.style.display; var oldvisibility = this._div.style.visibility; this._div.style.visibility = 'hidden'; this._div.style.display = 'block'; } switch( this._anchorT1 ) { case 1: posx -= this._w + 4; break; case 2: posx -= this._w + 4; posy -= this._h + 4; break; case 3: posy -= this._h + 4; break; case 4: posy -= parseInt( this._h / 2 ); posx -= parseInt( this._w / 2 ); break; } if ( _changeVisibility ) { this._div.style.display = olddisplay; this._div.style.visibility = oldvisibility; } this._x = posx; this._y = posy; if ( parseInt( document.getElementById( this._anchorTo ).scrollTop ) ) posy += document.getElementById( this._anchorTo ).scrollTop; this._div.style.left = posx + 'px'; this._div.style.top = posy + 'px'; return true; }; this.createWindow = function() { var self = this; var w = document.getElementById( this._id ); if ( w ) { this._div = w; } else { this._div = document.createElement( 'div' ); this._div.setAttribute( 'class', 'gradbg drpshdw2' ); this._div.id = this._id; this._div.style.position = 'absolute'; this._div.style.display = 'none'; this._div.style.top = this._y; this._div.style.left = this._x; this._div.style.width = this._w + 'px'; this._div.style.height = this._h + 'px'; this._div.style.backgroundColor = "#FFFFFF"; this._div.style.borderColor = '#9BA87B'; this._div.style.borderWidth = '1px'; this._div.style.borderStyle = 'solid'; this._div.style.margin = '0'; this._div.style.overflow = 'hidden'; } this._target = this._div.id; document.body.appendChild( this._div ); this._targetId = this._div.id + '_content'; var exist = document.getElementById( this._targetId ); if ( exist ) this._useExisting = true; var theight = this._h; var twidth = this._w; this._div.style.padding = '0'; var title = this._title ? this._title : this._div.id; var ihtml; ihtml = '<div id="' + this._div.id + '_titlebar" class="bh bh_grs" style="border: 0; border-bottom-color: grey; border-bottom-style: solid; border-bottom-width: 1px; background-color: #9BA87B; color: white; font-size: 13px; height: ' + this._titleBarHeight + 'px; padding: 0px 5px 0 5px; overflow: hidden;"><div style="float: right">'; if ( this._status & WS_NOMINIMIZE == 0 ) ihtml += '<a href="#"  style="color: white !important;" onclick="minimizeWindow( \'' + this._div.id + '\' ); return false;"><b>&#8230;</b></a>&nbsp;'; ihtml += '<a href="#" style="color: white !important;" onclick="closeWindow( \'' + this._div.id + '\' ); return false;" ><span style="font-size: 15px;"><b>X</b></span></a></div><div style="padding-top: 1px; cursor: default;"><b>' + title + '</b></div></div>'; this._div.innerHTML = ihtml; if ( this._useExisting ) { exist.parentNode.removeChild( exist ); exist.style.display = "none"; document.body.appendChild( exist ); } else { var newdiv = document.createElement( 'div' ); newdiv.id = this._targetId; newdiv.style.display = 'none'; document.body.appendChild( newdiv ); } this.ajax._target = this._targetId; var loading = document.createElement( 'div' ); loading.innerHTML = '<img src="/loading.gif" style="margin: 20% 45% 10% 45%">'; loading.id = 'loading_ani_' + this._id; this._div.appendChild( loading ); this.ajax.onLoad = function() { self.placeInto(); self.resize( 1 ); }; this._div.style.display = this._display; }; this.placeInto = function() { var ob = document.getElementById( this._targetId ); if ( ob ) { ob.style.visibility = 'hidden'; ob.style.display = 'block'; var loading = document.getElementById( 'loading_ani_' + this._id ); if ( loading ) loading.parentNode.removeChild( loading ); ob.parentNode.removeChild( ob ); if ( this._div ) { this._div.appendChild( ob ); ob.style.visibility = 'visible'; } else delete ob; } }; this.resize = function( _do ) { this.animateF(); var ob = document.getElementById( this._targetId ); ob.style.position = 'absolute'; var height = ob.offsetHeight; var width = ob.offsetWidth; if ( this._status & WS_TITLEBAR || this._status & WS_CANCLOSE ) height += this._titleBarHeight; if ( !width ) { var self = this; setTimeout( function() { self.resize( 1 ); }, 100 ); return; } if ( _do ) this.animate( SW_MOVE, this._div.offsetLeft, this._div.offsetTop, width, height + 4 ); }; this.animate = function( _cmd, _x, _y, _w, _h ) { if ( this._animateR[ 8 ] ) this.animateF(); this._animateCmd = _cmd; if ( this._div == undefined ) return; this._div.style.overflow = 'hidden'; switch( this._animateCmd ) { case SW_SHOWTOGGLE: if ( this._div.style.display == 'none' ) { this._div.style.visibility = 'hidden'; this._div.style.display = 'block'; this._animateR = Array( 0, 0, 0, 0, this._ox, this._oy, this._oW, this._oH, SW_SHOW ); this._div.style.display = 'none'; this._div.style.visibility = 'visible'; if ( ( this._status & WS_NOESCCLOSE ) == 0 ) { this._div.onkeydown = function( e ){if ( !e ) e = window.event;if ( e.keyCode == 27 ){ self.show( SW_SHOWTOGGLE ); stopPropagation() };}; window.onkeydown = function( e ){if ( !e ) e = window.event;if ( e.keyCode == 27 ) {self.show( SW_SHOWTOGGLE ); stopPropagation(); window.onkeydown = '';}}; } } else { this._animateR = Array( this._div.offsetLeft, this._div.offsetTop, this._div.offsetWidth, this._div.offsetHeight, this._div.offsetLeft, this._div.offsetTop, 0, 0, SW_HIDE ); } break; case SW_HIDE: this._animateR = Array( this._div.offsetLeft, this._div.offsetTop, this._div.offsetWidth, this._div.offsetHeight, this._div.offsetLeft, this._div.offsetTop, 0, 0, SW_HIDE ); break; case SW_CLOSE: this._animateR = Array( this._div.offsetLeft, this._div.offsetTop, this._div.offsetWidth, this._div.offsetHeight, this._div.offsetLeft, this._div.offsetTop, this._div.offsetWidth, 0, SW_CLOSE ); break; case SW_MOVE: this._animateR = Array( this._div.offsetLeft, this._div.offsetTop, this._div.offsetWidth, this._div.offsetHeight, _x, _y, _w, _h, SW_MOVE ); break; default: this._animateR = Array(); } self.animateH(); }; this.animateH = function() { if ( !this._animateR[ 8 ] ) return; var same = 4; this._x = this._animateR[ 4 ]; this._y = this._animateR[ 5 ]; this._w = this._animateR[ 6 ]; this._h = this._animateR[ 7 ]; if ( this._animateR[ 8 ] == SW_SHOW || this._animateR[ 8 ] == SW_MOVE ) { this._ox = this._animateR[ 4 ]; this._oy = this._animateR[ 5 ]; this._oW = this._animateR[ 6 ]; this._oH = this._animateR[ 7 ]; } this._div.style.width = this._animateR[ 2 ] + 'px'; this._div.style.height = this._animateR[ 3 ] + 'px'; if ( this._anchorTo ) { this._animateR[ 0 ] = this._x; this._animateR[ 1 ] = this._y; this.position( false ); } else { this._div.style.left = this._animateR[ 0 ] + 'px'; this._div.style.top = this._animateR[ 1 ] + 'px'; } this._div.style.display = 'block'; this.animateF(); }; this.animateF = function() { if ( this._animateR[ 8 ] ) { if ( this._anchorTo ) this.position( false ); else { this._div.style.left = this._x + 'px'; this._div.style.top = this._y + 'px'; } this._div.style.width = this._w + 'px'; this._div.style.height = this._h + 'px'; switch( this._animateR[ 8 ] ) { case SW_SHOW: if ( this._useExisting ) { var self = this;setTimeout( function() {self.resize( true );} ); } break; default: this._div.focus(); break; case SW_CLOSE: break; case SW_HIDE: this._div.style.display = 'none'; this._div.style.width = this._oW + 'px'; this._div.style.height = this._oH + 'px'; break; } this._animateR = Array(); } }; this.animateH1 = function( _i1, _i2 ) { var dx = parseInt( _i2 ) - parseInt( _i1 ); if ( dx ) { var way = dx / Math.abs( dx ); dx = parseInt( dx / 1.2 ); if ( Math.abs( dx ) < 2 ) return _i2; if ( !dx ) dx = way; return _i1 + dx; } return _i2; }; if ( g_rWindows[ _id ] ) { g_rWindows[ _id ].createWindow(); return g_rWindows[ _id ]; } g_rWindows[ _id ] = this; this._id = _id; this._x = _x; this._y = _y; this._w = _w; this._h = _h; this._oW = _w; this._oH = _h; this._ox = _x; this._oy = _y; this._titleBarHeight = 20; this._status = _status; this._display = 'none'; this._visibility = 'visible'; this._div = undefined; this._title = _title; this.ajax = new Ajax; this.ajax.setTarget( this._id ); this._anchorTo = undefined; this._anchorA1 = undefined; this._anchorT1 = undefined; this._clickX = this._clickY = undefined; this._useExisting = false; this._targetId = undefined; this._animateCmd = undefined; this._animateR = Array(); this.createWindow(); return true; } js_load();
