﻿// JScript File

var currentpopupwin;

function openpopwindow(popupwinid,url,width,height,withmenubar,resizable,scrollbars)
{
    
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    
    var windowFeatures = "width=" + width + ",height=" + height + 
        ",status,resizable,left=" + left + ",top=" + top + 
        ",screenX=" + left + ",screenY=" + top + 
        ",withmenubar=" + withmenubar + ",resizable=" + resizable + ",scrollbars=" + scrollbars;
    
    currentpopupwin = window.open(url, popupwinid, windowFeatures);
}

function openexternalpopupwindow(url)
{    
    window.open(url, 'myhkjcExternalWin');
}


function openmynotewindow()
{    

    var inputs=document.getElementsByTagName('input');    
    var currentNoteCategoryID
     
    for(i=0;i<inputs.length;i++)
    {
        if(inputs[i].id.indexOf("hCurrentNoteCategoryID")>0)
        {
            currentNoteCategoryID = inputs[i].value;    
            break;        
        }

    }

    openpopwindow('editnote','EditNote.aspx?NCID=' + currentNoteCategoryID,500, 500,'no','no','no');
}


function openregisterwindow()
{
    openpopwindow('register','PromoteRegister.aspx',790, 500,'no','yes','yes');
}

