﻿// JScript File

// Method checks enter key click and fires button event
function clickButtonOnEnter(e, buttonid) 
{ 
    var bt = document.getElementById(buttonid);

    if (typeof bt == 'object') 
    {  
        if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1)) 
        { 
            if (event.keyCode == 13) 
            { 
                bt.click(); 

                return false; 
            } 
        }        

        if(navigator.appName.indexOf("Netscape")>(-1)) 
        { 
            if (e.keyCode == 13) 
            { 
                bt.click(); 

                return false; 
            }
        }
    } 
}

function confirm_delete()
{
  if (confirm("Are you sure you want to delete?")==true)
    return true;
  else
    return false;
}

function mailCreate(who,domain)
{
//alert('hi');
//'mailto:'
    var address = 'mailto:' + who + '@' + domain;
    window.location = address;
    //return address;
}

// this is for opening pop-up windows
var HSRCHasOpenPopup = 0;
function HSRC_openPopupWindow( url, name, widgets, openerUrl )
{
	var host = location.hostname;
	if (window == top) { window.top.name = "opener"; }
	var popupWin = window.open( url, name, widgets );
	if(popupWin) {HSRCHasOpenPopup = 1;}
	if ( popupWin && popupWin.opener ) {
		if ( openerUrl )
		{
			popupWin.opener.location = openerUrl;
		}
	}
	if ( popupWin) {
		popupWin.focus();
	}
}
