/* $Id: menutool.js,v 1.6 2005/06/01 01:49:16 brad Exp $ */ /** begin menutool functions **/ function Rollover( base_name ) { this.name = base_name; this.image_dir = "/images"; this.img = null; this.Load = doRollLoad; this.Over = doRollNull; this.Out = doRollNull; } function doRollNull() { ; } function doRollLoad() { this.img = new Array(); this.img[0] = new Image(); this.img[0].src = this.image_dir + "/" + this.name + ".gif"; this.img[1] = new Image(); this.img[1].src = this.image_dir + "/" + this.name + "_o.gif"; this.Over = doRollOver; this.Out = doRollOut; } function doRollOver() { if( document.images ) { image = document.images[ this.name ]; image.src = this.img[1].src; } } function doRollOut() { if( document.images ) { image = document.images[ this.name ]; image.src = this.img[0].src; } } function doRollDown() { if( document.images && (this.src3 != '') ) { image = document.images[ this.name ]; image.src = this.img[2].src; } } MenuRollovers = Array(); function MenuRollover( base_name, src1, src2, src3 ) { this.name = base_name; this.img = null; this.src1 = src1; this.src2 = src2; this.src3 = src3; if( this.src3 + "" == "undefined" ) { this.src3 = ""; } this.Load = doMenuRollLoad; this.Over = doRollNull; this.Out = doRollNull; this.Down = doRollNull; MenuRollovers[ MenuRollovers.length ] = this; this.loaded = false; } function doMenuRollLoad() { this.img = new Array(); this.img[0] = new Image(); this.img[0].src = this.src1; this.img[1] = new Image(); this.img[1].src = this.src2; if( this.src3 != "" ) { this.img[2] = new Image(); this.img[2].src = this.src3; } this.Over = doRollOver; this.Out = doRollOut; if( navigator.userAgent.indexOf('Mac') == -1 ) { this.Down = doRollDown; } } function MenuRollover_OnLoad() { for( i=0; i10 && ((new Date).getTime()-start)>100 ) { // IE7 performance optimisation; access to frms[i].elements[j] is slow // this iteration prevents locking the browser in this loop setTimeout( "htmltools_init_form_focus("+i+","+j+")",0 ); return; } switch( frms[i].elements[j].type ) { case "hidden" : case "textarea" : break; default: eval( "addOnFocusEvent(frms[" + i + "].elements[" + j + "], function() { htmltools_form_focus=" + i + ";})" ); frms[i].elements[j].onblur = function() { htmltools_form_focus = -1; } } } } } function htmltools_register_button( id ) { htmltools_buttons[htmltools_buttons.length] = id; } function htmltools_checkbox_controller( id1, id2, label, show_class, hide_class ) { id1 = document.getElementById( id1 ); id2 = document.getElementById( id2 ); label = document.getElementById( label ); id1.controls = id2; id1.labels = label; id1.show_class = show_class; id1.hide_class = hide_class; id1.onclick = function() { htmltools_checkbox_controller_onclick( this, this.controls, this.labels, id1.show_class, id1.hide_class ); } id2.checked_last_val = id2.checked; id2.checked = (!id1.checked) && id2.checked || (id1.checked && id2.checked); id2.disabled = !id1.checked; label.className = id1.checked ? show_class:hide_class; } function htmltools_checkbox_controller_onclick( id1, id2, label, show_class, hide_class ) { id2.disabled=!id1.checked; if( id1.checked ) { id2.checked=id2.checked_last_val; } else { id2.checked_last_val=id2.checked; id2.checked=false; } label.className = (id1.checked ? show_class:hide_class); } function addOnFocusEvent(el,func) { var oldonfocus = el.onfocus; if( typeof el.onfocus != 'function') { el.onfocus = func; } else { el.onfocus = function() { oldonfocus(); func(); } } } addLoadEvent(htmltools_init_forms); /** end htmltools javascript functions **/ /** ajax.js **/ /* $Id: ajax.js,v 1.1.1.1 2006/09/07 00:46:10 admin Exp $ */ /* helper function */ function appendQuery( url, qs ) { return url + (url.match(/\?/) ? '&' : '?') + qs; } var g_ajax_handler = new Array(); function AJAX() { var o = false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) try { o = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { o = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { o = false; } } @end @*/ if (!o && typeof XMLHttpRequest!='undefined') { o = new XMLHttpRequest(); } return o; } function ajax_init_triggers( el ) { var a = el.getElementsByTagName( 'a' ); var regex = new RegExp("\\bajax\\s(\\w+)\\b"); var res; for( var i=0; i0 ); if( abort_countdown<0 ) { return false; } return true; }; } addLoadEvent( function() { ajax_init_triggers( document ); }); /** end ajax.js **/