function OpenTipWindow(Url, Width, Height) {
    var opts = "width=" + Width +",height=" + Height;
    window.open("/Framework/Pages/Common/Tip.aspx?URL=" +Url, "GoalTipEnVen", opts);
}

function OpenFaceBookWindow(Url, Width, Height) {
    var opts = "width=" + Width +",height=" + Height;
     window.open("http://www.facebook.com/share.php?u=" +Url, "GoalTipEnVen", opts);
}



function bookmark() {
    window.external.AddFavorite("http://www.goal.dk","goal.dk")                       
}

function OpenWindowScroll(Url, Width, Height) {
    var opts = "width=" + Width +",height=" + Height + ",scrollbars=yes";
    window.open(Url, "GoalWindow", opts);
}

function OpenWindow(Url, Width, Height) {
    var opts = "width=" + Width +",height=" + Height + ",scrollbars=no";
    window.open(Url, "GoalWindow", opts);
}


function fnTrapKD(btn, event){
    if (document.all){
        if (event.keyCode == 13){
            event.returnValue=false;
            event.cancel = true;
            btn.click();
        }
    }
    else if (document.getElementById){
        if (event.which == 13){
            event.returnValue=false;
            event.cancel = true;
            btn.click();
        }
    }
    else if(document.layers){
        if(event.which == 13){
            event.returnValue=false;
            event.cancel = true;
            btn.click();
        }
    }
}

function previewAvatar() 
{
    var a = document.forms['aspnetForm'].ctl00_FullRegion_ctl00_ctl00_ddlAvatar;
    var avatar = a[a.selectedIndex].value;
    
    var img = document.getElementById('ctl00_FullRegion_ctl00_ctl00_imgCurrent');
    if(img!= null)
        img.src = avatar;
    //alert(avatar);
}


function showReportWindow(ReportUrl) 
{    
    var opts = "width=" + 400 +",height=" + 400;
    window.open("/Framework/Pages/Common/Report.aspx?ReportUrl=" + escape(ReportUrl), "GoalReportWindow", opts);
}

function showModWindow(ReportUrl) 
{    
    var opts = "width=" + 400 +",height=" + 200;
    window.open("/Framework/Pages/Community/ReportToAdmin.aspx?ReportUrl=" + ReportUrl, "GoalReportWindow", opts);
}

function ChangeClass(Element, Class) {
    var elm = document.getElementById(Element);
    if(elm != null) {
        elm.setAttribute("class", Class);
        elm.setAttribute("className", Class);
    }
    return;
}

function WriteFlashCountDown(Days) 
{
    var flash = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="150" height="107" id="countdown_box_v1_kv" align="middle">' +
        '<param name="allowScriptAccess" value="sameDomain" />'+
        '<param name="movie" value="/Flash/countdown_box_v1_kv.swf?intNumber=' + Days + '" />'+
        '<param name="quality" value="high" />'+
        '<param name="bgcolor" value="#ffffff" />'+
        '<embed src="/Flash/countdown_box_v1_kv.swf?intNumber='+ Days + '" quality="high" bgcolor="#ffffff" width="150" height="107" name="countdown_box_v1_kv" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'+
    '</object>';
    
    document.write(flash);
}

function isdefined( variable)
{
    return (typeof(window[variable]) == "undefined")?  false: true;
}

function syntaxPopup() 
{
    var opts = "width=" + 300 +",height=" + 260;
    window.open("/static/Syntax.html", "GoalSyntaxWindow", opts);
}

function showReplyWindow(user) 
{
    var opts = "width=" + 300 +",height=" + 260;
    window.open("/Framework/Pages/Community/WriteReply.aspx?user=" + user, "GoalReplyWindow", opts);
}

function showReportWindowFootballManager(ReportUrl) 
{    
    var opts = "width=" + 400 +",height=" + 440;
    window.open("/Framework/Pages/EPi/FootballManager/Report.aspx?ReportUrl=" + escape(ReportUrl), "GoalReportWindow", opts);
}

function syntaxPopupFootballManager() 
{
    var opts = "width=" + 300 +",height=" + 320;
    window.open("/static/SyntaxFootballManager.html", "GoalSyntaxWindow", opts);
}

function showReportWindowB93(ReportUrl) 
{    
    var opts = "width=" + 400 +",height=" + 440;
    window.open("/Framework/Pages/EPi/B93/Report.aspx?ReportUrl=" + escape(ReportUrl), "B93ReportWindow", opts);
}

function showModWindowB93(ReportUrl) 
{    
    var opts = "width=" + 400 +",height=" + 200;
    window.open("/Framework/Pages/EPi/B93/ReportToAdmin.aspx?ReportUrl=" + ReportUrl, "B93ReportWindow", opts);
}

function OpenTipWindowB93(Url, Width, Height) {
    var opts = "width=" + Width +",height=" + Height;
    window.open("/Framework/Pages/EPi/B93/Tip.aspx?URL=" +Url, "B93TipEnVen", opts);
}


