function SetColumnHeightEqual(firstEl, secondEl)
{
	var fEl = document.getElementById(firstEl);
	var sEl = document.getElementById(secondEl);
	if ( fEl != null && sEl != null )
	{
		if (fEl.offsetHeight > sEl.offsetHeight) sEl.style.height = fEl.offsetHeight+'px';
		else if ( sEl.offsetHeight > fEl.offsetHeight) fEl.style.height = sEl.offsetHeight+'px';
	}
}

function setElementBgColor(el, strColor, subEl)
{
	if ( el!=null )
	{
		if ( subEl!='' ) {
			var arEls = el.getElementsByTagName(subEl);
			if ( arEls.length > 0 )
				if ( subEl=='td' )
					for (i=0;i<arEls.length;i++)
						arEls[i].style.backgroundColor=strColor;
				else
					arEls[0].style.backgroundColor=strColor;
		} else {
			el.style.backgroundColor=strColor;
		}
	}
}

function toArray(obj) {
	if ( !obj ) return [];
	if ( obj.toArray ) {
		return obj.toArray();
	} else {
		var res = []
		for(i=0;i<obj.length;i++) {
			res[i]=obj[i];
		}
		return res;
	}
}

Array.prototype.shift = function() {
	var res = this[0];
	for (i=1; i<this.lenght;i++) {
		this[i-1]=this[i];
	}
	this.length--;
	return res;
}

Function.prototype.bind = function() {
	var _m = this; args=toArray(arguments); obj=args.shift();
	return function() {
		return _m.apply(obj, args);
	}
}

var iFrameLoader = {
	iframe: null,
	loadImage: null,
	
	init: function() {
		if ( arguments[0] == "undefined" || arguments[1] == "undefined" ) return;
		this.iframe = document.getElementById(arguments[0]);
		this.loadImage = document.getElementById(arguments[1]);
		
		this.loadImage.style.display = "block";
		this.attachEvent(this.iframe, "load", this.loadComplete.bind(iFrameLoader), false);
	},
	
	loadComplete: function() {
		this.loadImage.style.display = "none";
	},
	
	attachEvent: function(obj,ev,fn,useCapture) {
		if (!useCapture) useCapture=false;
		if (obj.addEventListener){
			obj.addEventListener(ev,fn,useCapture); return true;
		} else if (obj.attachEvent) return obj.attachEvent("on"+ev,fn);
	} 	
}