Object.prototype.getElementsByClassName=function(c){
    for(var i=0,a=[],d;d=this.getElementsByTagName('*')[i++];){
    	if(RegExp("\\b"+c+"\\b",'gi').test(d.className)){
        	a.push(d);
    	}
    }
    return a;
}

function f_clientWidth() {
	return f_filterResults (
		window.innerWidth ? window.innerWidth : 0,
		document.documentElement ? document.documentElement.clientWidth : 0,
		document.body ? document.body.clientWidth : 0
	);
}
function f_clientHeight() {
	return f_filterResults (
		window.innerHeight ? window.innerHeight : 0,
		document.documentElement ? document.documentElement.clientHeight : 0,
		document.body ? document.body.clientHeight : 0
	);
}

function f_filterResults(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}

function getResolution(){
	if (self.innerWidth){
		//firefox
		frameWidth = self.innerWidth;
		frameHeight = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientWidth){
		frameWidth = document.documentElement.clientWidth;
		frameHeight = document.documentElement.clientHeight;
	}
	else if (document.body){
		//ie	
		frameWidth = document.body.clientWidth;
		frameHeight = document.body.clientHeight;
	}
	return [frameWidth,frameHeight];
}