 //window.addEventListener('DOMMouseScroll', wheel, false)=document.body.scrollTop
//event.wheelDelta=window.scrollTo(0, 0);

function toggleHidePlayer(id1, id2){
	

    var el = document.getElementById(id1);
    var e2 = document.getElementById(id2);

    el.style.display = 'none';
    e2.style.display = 'block';
	
	
	
	
	
}
function fbs_click() {
	u=location.href;
	t=document.title;
	window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
	return false;
	}
	
function over()
{
	var floatimg = document.getElementById("s3");
      floatimg.setAttribute("src", "../images/s3_over.jpg");
}
function out()
{
	var floatimg = document.getElementById("s3");
      floatimg.setAttribute("src", "../images/s3.jpg");
}

function clear_m(id)
{
	document.getElementById(id).value="";
}

var WARN_CLASS = ['warn','none'];
var c1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
var c2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$");

String.prototype.trim = function()
{
	return this.replace(/^\s+/,'').replace(/\s+$/,'');
};
function checkValue(obj,warn)
{
	var v=obj.value.trim();
	if( obj.id == 'mail')
	{
		chk=!c1.test(v) && c2.test(v) && v.length>6;
	} else
	{
		chk=v.length>0;
	}
	obj.className=WARN_CLASS[chk+0];
	if( warn && chk )
	{
		obj.onkeyup='';
		obj.onchange='checkValue(this)';
	} else if( !warn && !chk )
	{
		obj.onkeyup='checkValue(this,1)';
		obj.onchange='';
	}
	return chk;
}
function FormCheck(forma)
{
	alert('aaaaaaaaaaa');
	if(!forma) {forma=0;}
	var f=document.forms[forma];
	var items=f.elements;
	
	var test=true,cnt=items.length,params='',AnD=false,i,t;
	for( var x=0; x<cnt; x++ )
	{
		t=(i=items[x]).type;
		if( i.id=='name' || i.id=='mail' || i.id=='emne' || i.id=='message' || i.id=='navn' )
		{
			if(!checkValue(i) && test)
			{
				i.focus();
				test=false;
			} else if(test)
			{
				params=params+(AnD?'&':'')+i.id+'='+i.value;
				AnD=true;
			}
		}
		else if (t=='hidden')
		{
			params=params+(AnD?'&':'')+i.id+'='+i.value;
			AnD=true;
		}
	}
	if(!test)
	{	
		return false;
	}

}