$(document).ready( 
	function(){
		$('#rotate-front').innerfade({ 
			speed: 'slow', 
			timeout: 6000, 
			type: 'sequence', 
			containerheight: '317px' 
		}); 
	}
);


// Function that executes function inside input string when enter is pressed.
function doKey(sFunc) {
	if (document.all) {
		whichASC = event.keyCode;
		if(whichASC==13){
			eval(sFunc);
		}       
	}
}

function open_email(numPermID,strEmail)
{
	if ((numPermID == '') || (strEmail == ''))
	{
		alert ('Mangler e-post adresse.');
	}
	else 
	{
		loc = 'adm_send_mail.asp?id='+numPermID+'&email='+strEmail;
		myWin = window.open(loc, "popFollowup","width=600,height=300,resizeable=auto,status=no,toolbar=no,menubar=no,scrollbars=1");
		myWin.focus();
	}
}

function open_sms(numPermID,strMobile){
	if ((numPermID == '') || (strMobile == '')){
		alert ('Mangler mobiltelefonnummer.');
	}
	else {
		loc = 'adm_send_sms.asp?id='+numPermID+'&mobile='+strMobile;
		myWin = window.open(loc, "popFollowup","width=550,height=300,resizeable=auto,status=no,toolbar=no,menubar=no,scrollbars=1");
		myWin.focus();
	}
}

/* new on mouse over function */
function over (obj){
	obj.className=obj.className+'_over';
}

/* new on mouse out function */
function out (obj){
	var str=obj.className;
	var pos=str.indexOf("_over")
	obj.className=str.substr(0,pos);
}


/* onenter=submit for login boks */
	function doKeyLogin() {
		if (document.all) {
			whichASC = event.keyCode;
			if(whichASC==13){
				logg_inn();
			}       
		}
	}

	function logg_inn(){
		document.LOGIN.CMD.value="LOGIN";
		document.LOGIN.submit();
	}

/* Send password */
	function send_password(){
		if (document.LOGIN.user.value == ''){
			alert('Du må fylle inn brukernavnet ditt.');
		}
		else {
			document.location='?view=send_password&user_id='+document.LOGIN.user.value;
		}
	}

/* avoids dead session by refreshing hidden image */
	function avoid_session_dead(){
		stamp = new Date();
		document.getElementById('session_image').src='session_image.asp?time='+stamp.getHours()+stamp.getMinutes()+stamp.getSeconds();
		window.setTimeout('avoid_session_dead();',48000);
	}

// Function that executes function inside input string when enter is pressed.
function doKey(sFunc) {
	var e = e || window.event;
	var whichASC = e.keyCode;
	e.keycode=null;
	if (whichASC==13){
		eval(sFunc);
	}
	return false;
}

