function back() {
    var now = new Date();
    now.setSeconds(now.getSeconds()+15);
    var expiryDate = now.toGMTString();
    document.cookie = 'back=refresh;expires=' + expiryDate + ';path=/';
    window.history.go(-1);
}

function refresh() {
	location.href = location.href;
}

function refreshIfBack() {
    var cookieValue = document.cookie;
    var cookieName = 'back';
    var cookieRegExp = new RegExp('\\b' + cookieName + '=([^;]+)');
    cookieValue = cookieRegExp.exec(cookieValue);
    if(cookieValue != null) {
        document.cookie = 'back=refresh;expires=' + (new Date()).toGMTString() +
            ';path=/';
        refresh();
    }
}

function refreshAfterSessionTimeout() {
	var sessionTimeoutInput = document.getElementById('sessionTimeoutMinutes');
	if(sessionTimeoutInput) {
		if(!(new String(location.href)).toLowerCase().match('livebetting')) {
			var minutes = sessionTimeoutInput.value;
			setTimeout("logout()", 1000*60*minutes + 5000);
		}
	}
}

function goToScandicLive(){
    location.href = 'http://scandiclive.com/ScandicLive/';
	return false;
}

function goToScandicLivePage(page){
    location.href = 'http://scandiclive.com/ScandicLive/'+page;
	return false;
}

function goToScandicLiveRejser(page){
	var page = page.replace(/ /g,"");
	location.href = 'http://scandiclive.com/ScandicLive/Rejser/'+page + "/";
	return false;
}

