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]
}
xy = screenSize()

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";
}

function smartphone()
{
	if (browser()=="iPod" || browser()=="iPhone" || browser()=="iPad") return true
	else return false
}

function updateOrientation()
{  
	var or=""
	switch(window.orientation)
	{  
		case 0:  
		or = "V";
		break;  

		case -90:  
		or = "H";
		break;  

		case 90:  
		or = "H";
		break;  

		case 180:  
		or = "V";
		break;  
	}  
    return or
}  

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;
}
