﻿// JScript File

function OpenWriteMessagePage(msgType)
{
  window.open(GJS_appPath + 'rm/WriteMessage.aspx?msgType=' + msgType, 'WriteMessage', 'height=400,width=400,resizable=no,toolbar=no,status=no,scrollbars=no');
}

function GoToHomePage()
{
  if(GJS_isAuthenticated)
    window.location = GJS_appPath + 'Application/Index.aspx';
  else
    window.location = GJS_appPath + 'Default.aspx';
}

function UpgradeConfirmBox()
{
  if(confirm("Pleas upgrad to Premium Membership in order to view"))
  {
    window.location = GJS_appPath + 'Application/Upgrade.aspx';
  }
}

function UpgradeConfirmBox(lastViewProfile)
{ 
  if(!GJS_isAuthenticated)
  {
      OpenProfile("null")      
      return;
  }
  
  if(confirm("Pleas upgrad to Premium Membership in order to view"))
  {
    var url = GJS_appPath + 'Application/Upgrade.aspx' +"?lastViewProfile=" + lastViewProfile
    window.location = url;
  }
}

function OpenProfile(userName)
{
  if(GJS_opendProfileWindow!=null){GJS_opendProfileWindow.close();}
  GJS_opendProfileWindow = window.open(GJS_appPath  + 'rm/ProfileDisplay.aspx?userName='+userName, "Profile", "height=560,width=600,resizable=no,toolbar=no,status=no,scrollbars=yes");
  if (window.focus){GJS_opendProfileWindow.focus();}
  
}

function OpenQuickTour(stage)
{
   var url = GJS_appPath + 'rm/QuickTour.aspx?stage=' + stage;
   window.open(url, "Profile", "height=560,width=600,resizable=no,toolbar=no,status=no,scrollbars=yes");
}

function OpenMap(city,state,zip)
{
  if(GJS_opendMapWindow!=null){GJS_opendMapWindow.close();}
  GJS_opendMapWindow = window.open(GJS_appPath + 'rm/Map.aspx?city=' + city + "&state=" + state + "&zip=" + zip, "Map", "height=524,width=500,resizable=no,toolbar=no,status=no,scrollbars=no");
  if (window.focus){GJS_opendMapWindow.focus();}
}

