﻿function doKey(txtObj,e,btn) {

    var keyPressed;
if(window.event)
keyPressed = window.event.keyCode; // IE
else keyPressed = e.which; // Firefox

if (keyPressed == 13) {
    btn.click();
    }
}

function doSearch(searchWords) {
    var url = '/sv/Sok/?searchString=' + searchWords;
    window.open(url);
    return false;

}


function copyToClipboard(text)
{
    if (window.clipboardData) // IE
    {  
        window.clipboardData.setData("Text", text);
    }
    else
    {
        alert('Endast IE');
    }
}



function showVideo(container, url) {
    if (container == null || container == '') container = 'flowplayerholder';

    if (url != null && url != '')
        $f(container, "/Resources/flowplayer-3.2.5.swf", url);
    return false;
}


function applyShadow(targetElement, shadowColor, shadowOffset) {
    alert(typeof (targetElement));
    if (typeof (targetElement) != 'object') {
        targetElement = document.getElementById(targetElement);
    }
    var value = targetElement.firstChild.nodeValue;
    targetElement.style.position = 'relative';
    targetElement.style.zIndex = 1;

    var newEl = document.createElement('span');
    newEl.appendChild(document.createTextNode(value));
    newEl.className = 'shadowed';
    newEl.style.color = shadowColor;
    newEl.style.position = 'absolute';
    newEl.style.left = shadowOffset + 'px';
    newEl.style.top = shadowOffset + 'px';
    newEl.style.zIndex = -1;

    targetElement.appendChild(newEl);
}

//applyShadow(document.getElementById('mnuHome'), '#000', 8);

