/*
 * Script som används på lärarjourens webplats
 * Tidigare låg dessa på varje sida men är nu utlyfta till en egen fil
 *
 */

function mailpage()
{
  mail_str = "mailto:?subject= LARARJOUREN - en kanal mellan universitet och skola";
  mail_str += "&body= Den har sidan maste du se LARARJOUREN - en kanal mellan universitet och skola";
  mail_str += ". Du hittar den pa, http://www.lararjouren.se";
  location.href = mail_str;
}
var txt;
var mouseOverObjs = new Array();
var timerID = null;

function mouseOver(obj, src) { //v3.0
    if(mouseOverObjs.indexOf(obj) == -1) {
        mouseOverObjs[obj] = obj.firstChild.src;
    }
    obj.firstChild.src = src;
}

function mouseOut(obj) {
    obj.firstChild.src = mouseOverObjs[obj];
}



function ScrollUp(speed){
    if(document.getElementById){
        if(parseInt(txt.style.top) < 0)
        txt.style.top = parseInt(txt.style.top) + speed + "px";
        timerID = setTimeout("ScrollUp("+speed+")",30)
    }
}

function ScrollDown(speed){
    if(document.getElementById){
        if(txt == undefined) {
            ScrollInit();
        }
        if(parseInt(txt.style.top) > cnt.offsetHeight - txt.offsetHeight)
        txt.style.top = parseInt(txt.style.top) - speed + "px";
        timerID = setTimeout("ScrollDown("+speed+")",30)
    }
}

function ScrollStop(){
    if(document.getElementById){
        clearTimeout(timerID);
    }
}

function ScrollInit() {
    if (document.getElementById) {
        cnt = document.getElementById("cont");
        txt = document.getElementById("text");
        txt.style.top = 0;
    }
}

function focusLogin() {
    var obj = document.getElementById('login');
    if (obj) {
        obj.focus();
    }
}

