﻿function ShowHideBlock(object) {
    var e;
    e = document.getElementById(object);
    if (e.style.display=="block") {
        e.style.visibility = "hidden";
        e.style.display = "none";
    }
    else if (e.style.display=="none") {
        e.style.visibility = "visible";
        e.style.display = "block";
    }
}
function ShowMore(object) {
    var e;
    var ea;
    e = document.getElementById(object);
    ea = document.getElementById("showmore");
    if (e.style.display=="block") {
        e.style.visibility = "hidden";
        e.style.display = "none";
        ea.innerHTML ="Visa mer";
    }
    else if (e.style.display=="none") {
        e.style.visibility = "visible";
        e.style.display = "block";
        ea.innerHTML ="Dölj";
    }
}
function FocusInput(f,defvalue) {
    if(f.value == defvalue) {
        f.value = '';
    } 
}
function BlurInput(f,defvalue) {
    if(f.value == '') {
        f.value = defvalue;
    }
}
function openwin(url)
{
    var imgWin=window.open(url, 'images','width=1045, height=704, left=' + ((screen.availWidth-1045)/2) + ', top=' + ((screen.availHeight-704)/2) + ', status=no, menubar=no, directories=no, resizable, scrollbars, toolbars=no, location=no');
    imgWin.focus();
}
function winpop(url, name, width, height)    {
    window.open(url,name,"width="+width+",height="+height+",toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=yes,scrollbars=yes");
}
function showpearl(url) {
    var imgWin=window.open(url, 'parlor','width=800, height=1000, left=' + ((screen.availWidth-800)/2) + ', top=' + ((screen.availHeight-1000)/2) + ', status=no, menubar=no, directories=no, resizable, scrollbars, toolbars=no, location=no');
    imgWin.focus();
}
function getInternetExplorerVersion() {
    var rv = -1;
    // Return value assumes failure.
    if (navigator.appName == 'Microsoft Internet Explorer') {
        var ua = navigator.userAgent;
        var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
        if (re.exec(ua) != null)
            rv = parseFloat(RegExp.$1);
     }
     return rv;
}

