

function bookmark(url,title){
  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
  window.external.AddFavorite(url,title);
  } else if (navigator.appName == "Netscape") {
    window.sidebar.addPanel(title,url,"");
  } else {
    alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
  }
}
	    
function OpenCitySearch()
{
    window.open('../CitySearch.aspx','CitySearch','width=320,height=320,toolbar=no,top=40,left=40,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no, resizable=yes');
}
function OpenInstitutionSearch()
{
    window.open('../InstitutionSearch.aspx','CitySearch','width=750,height=600,toolbar=no,top=20,left=20,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no, resizable=yes');
}
function OpenEventDetail(eventId)
{
    window.open('EventDetail.aspx?EventID=' + eventId,'EventDetail','width=495,height=550,toolbar=no,top=40,left=40,location=yes,directories=no,status=yes,menubar=yes,scrollbars=yes,copyhistory=no, resizable=yes');
}
function OpenEmailPopup(emailAddress)
{
    window.open('EmailerPopUp.aspx?EmailTo=' + emailAddress,'EmailPopUp','width=560,height=420,toolbar=no,top=40,left=40,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no, resizable=yes');
}
function OpenTermAndConditions()
{
    window.open('/TermsAndConditions.aspx','TermsAndConditions','width=640,height=600,toolbar=no,top=40,left=40,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no, resizable=yes');
}
function OpenEventRegDocUploadWindow(eventId)
{
    window.open('DocUpload.aspx?EventID=' + eventId,'DocUpload','width=600,height=280,toolbar=no,top=40,left=40,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no, resizable=yes');
}
function OpenPrivacyPolicy()
{
    window.open('/PrivacyPolicy.aspx','PrivacyPolicy','width=500,height=300,toolbar=no,top=40,left=40,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no, resizable=yes');
}
function OpenExternalUrl(url) 
{
    window.open(url,'ExtLink','width=700,height=800,toolbar=yes,top=30,left=30,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=no, resizable=yes');
}
function OpenMemberShipTermDetail(paymentOptionID)
{
    window.open('/MemberShipTermDetail.aspx?PaymentOptionID=' + paymentOptionID,'MemberShipTermDetail','width=550,height=450,toolbar=no,top=100,left=100,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no, resizable=yes');
}
function OpenInstitutionWin(url) 
{
    window.open(url,'InstitutionWin','width=700,height=700,toolbar=no,top=20,left=20,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=no, resizable=yes');
}
function OpenPaymentHistory(personId) 
{
    window.open('/Management/PaymentHistory.aspx?personId=' + personId,'PaymentHistory', 'width=700,height=500,toolbar=no,top=20,left=20,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no, resizable=yes');
}
function OpenMembershipOptionsPopUp() 
{
    window.open("MembershipOptions.aspx",'MembershipOptions','width=700,height=500,toolbar=no,top=60,left=60,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no, resizable=yes');
}
function OpenNewsEditor(newsId) 
{
    window.open('/Management/ManageHeadelineNewsDetails.aspx?newsId=' + newsId,'NewsEditor','width=700,height=500,toolbar=no,top=40,left=40,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,copyhistory=no, resizable=yes');
}
function OpenNewsDocUpload(newsId) 
{
    window.open('/Management/NewsDocUpload.aspx?newsId=' + newsId,'NewsDocUploader','width=600,height=280,toolbar=no,top=40,left=40,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no, resizable=yes');
}
function OpenNewsDetailsEditor(newsId) 
{
    window.open('/Management/ManageHeadelineNewsDetails.aspx?newsId=' + newsId,'NewsDetails','width=780,height=700,toolbar=no,top=10,left=10,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no, resizable=yes');
}

function OpenNewsDoc(fileName) 
{
    //'/NewsDocs/' + 
    window.open(fileName,'NewsDetails','width=780,height=700,toolbar=no,top=10,left=10,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no, resizable=yes');
}

function OpenLink(url) {
    window.open(url, 'link', 'width=750,height=600,top=20, left=20,toolbar=no, location=yes,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=yes, resizable=yes');
}
        
/* -- MENUS -- */

function showSubMenu(oCaller, subMenuId) 
{
   //alert('showSubMenu');
    var oSubMenu = document.getElementById(subMenuId); 
    if(oSubMenu == null) 
        return;	
	   
	if(oCaller == null) 
        return;	
        
    var left;
    var top;
    var w,y,h; 
    if (document.getBoxObjectFor) { 
        // MOZILLA
        var bo = document.getBoxObjectFor(oCaller); 
        left = bo.x; 
        w = bo.width;
        top = bo.y;
        h = bo.height;
    } 
    else if (oCaller.getBoundingClientRect) { 
        // IE
        var rect = oCaller.getBoundingClientRect(); 
        left = rect.left; 
        w = rect.right - rect.left;
        top = rect.top;
        h = rect.bottom - rect.top;
    } 
    left = left - 2;
    top = top + 15 + GetScrollTop();
	
    oSubMenu.style.position = "absolute";
    oSubMenu.style.left = left + "px";
    oSubMenu.style.top = top + "px"; 
    oSubMenu.style.display = "block";
}

function hideSubMenu(subMenuId) {
	var oSubMenu = document.getElementById(subMenuId); 
	if(oSubMenu == null) return;
	oSubMenu.style.display = "none";
}

function GetScrollTop() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    //scrOfY = window.pageYOffset;
    scrOfY = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    //scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    //scrOfX = document.documentElement.scrollLeft;
  }
  return scrOfY;
}




/* -- OLD

function showSubMenu(oCaller, subMenuId) {
    GetScrollTop();
	var oSubMenu = document.getElementById(subMenuId); 
	if(oSubMenu == null) return;	
	var left = oCaller.getBoundingClientRect().left - 2; // - 5;
	var top = oCaller.getBoundingClientRect().top + 17 + GetScrollTop();
	oSubMenu.style.position = "absolute";
	oSubMenu.style.left = left + "px";
	oSubMenu.style.top = top + "px"; 
	oSubMenu.style.display = "block";
}
function hideSubMenu(subMenuId) {
	var oSubMenu = document.getElementById(subMenuId); 
	if(oSubMenu == null) return;
	oSubMenu.style.display = "none";
}
function GetScrollTop(){    
  var scrollY = document.documentElement.scrollTop;
  if(!scrollY)scrollY = document.body.scrollTop;            
  if(!scrollY)scrollY = window.pageYOffset;               
  if(!scrollY)scrollY = 0;
  return scrollY;
}
*/


function HideControl(cntrlId) 
{
    var btn = document.getElementById(cntrlId); 
	if(btn != null) 
	    btn.style.display = "none";
}

function HideButtonShowLabel(buttonID, labelId) 
{
    HideControl(buttonID);
	    
	var lbl = document.getElementById(labelId); 
	if(lbl != null) 
	    lbl.style.display = "block";
}



