function screenSize()
{
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) //Non-IE
	{
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	}
	else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) //IE 6+ in 'standards compliant mode'
	{
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	}
	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) //IE 4 compatible
	{
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
	return [myWidth, myHeight]
}


function browser()
{
	if (navigator.userAgent.match(/iPhone/i)) return "iPhone";
	if (navigator.userAgent.match(/iPod/i)) return "iPod";
	if (navigator.userAgent.match(/iPad/i)) return "iPad";
	if (navigator.userAgent.match(/Firefox/i)) return "firefox";
	if (navigator.userAgent.match(/msie/i)) return "explorer";
	if (navigator.userAgent.match(/chrome/i)) return "chrome";
	if (navigator.userAgent.match(/safari/i)) return "safari";
}

shuffle = function(o){ //shuffle array v1.0 // usage: var el_array = shuffle(["1","2","3"])
	for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
	return o;
};

function checkEmail(id)
{
	var email = document.getElementById(id).value;
	var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (!filter.test(email)) return false;
	else return true;
}

function changeOpacity( id, opacity )
{
	var object = document.getElementById(id).style;
	object.opacity = ( opacity / 100 );
	object.MozOpacity = ( opacity / 100 );
	object.KhtmlOpacity = ( opacity / 100 );
	object.filter = "alpha(opacity=" + opacity + ")";
}
