document.hideComponents = function()
{
	if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)) return;
	[$A(document.getElementsByTagName("object")),$A(document.getElementsByTagName("select")),$A(document.getElementsByTagName("iframe"))].flatten().each(function(component){ try{ $(component).setStyle({visibility:'hidden'});}catch(e){} });
};
document.showComponents = function()
{
	if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)) return;
	[$A(document.getElementsByTagName("object")),$A(document.getElementsByTagName("select")),$A(document.getElementsByTagName("iframe"))].flatten().each(function(component){ try{ $(component).setStyle({visibility:'visible'});}catch(e){} });
};

document.sendTo = function(url,options)
{
	location.href = url;
};

/* from - quirksmode.org Edit for Firefox by pHaez*/
document.getPageScroll = function()
{
	var yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {
		yScroll = document.body.scrollTop;
	}

	arrayPageScroll = new Array('',yScroll)
	return arrayPageScroll;
};

/* from - quirksmode.org Edit for Firefox by pHaez*/
document.getPageSize = function()
{
	var xScroll, yScroll;

	if (window.innerHeight && window.scrollMaxY) {
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ /* all but Explorer Mac*/
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { /*Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari*/
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}

	var windowWidth, windowHeight;
	if (self.innerHeight) {	/*all except Explorer*/
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { /*Explorer 6 Strict Mode*/
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { /*other Explorers*/
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}

	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else {
		pageHeight = yScroll;
	}

	if(xScroll < windowWidth){
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
	return arrayPageSize;
};

document.pause = function(mills)
{
	if(mills <= 0){ return; }
	var now = new Date();
	var exitTime = now.getTime() + mills;
	while (true)
	{
		now = new Date();
		if (now.getTime() > exitTime){ return; }
	}
}

Array.prototype.removeDuplicates = function () {
	for(i = 1; i < this.length; i++){
		if(this[i][0] == this[i-1][0]){
			this.splice(i,1);
		}
	}
};



Array.prototype.empty = function () {
	for(i = 0; i <= this.length; i++){
		this.shift();
	}
};

Element.addMethods({
	getWidth: function(element) {
	   	element = $(element);
	   	return element.offsetWidth;
	},
	setWidth: function(element,w) {
	   	element = $(element);
    	element.style.width = w +"px";
	},
	setHeight: function(element,h) {
   		element = $(element);
    	element.style.height = h +"px";
	},
	setTop: function(element,t) {
	   	element = $(element);
    	element.style.top = t +"px";
	}
});