﻿// JScript File

function change(id, newClass) {
	identity=document.getElementById(id);
	identity.className=newClass;
}

function sendLink()
{
    var Msg = window.opener.location.href;
    document.getElementById('sendURl').value=Msg;
}
    
function checkEmail()
{
    if (document.GenericRegForm1.sender.value == "")
      {
       alert("Please enter a valid sender e-mail address.");
       return(false);
      }
    var str = document.GenericRegForm1.sender.value;
    var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
    if (filter.test(str))
    {
          if (document.GenericRegForm1.recip1.value == "")
          {
            alert("Please enter a valid recipient e-mail address.");
            return(false);
          }
          var str = document.GenericRegForm1.recip1.value;
          if (filter.test(str))
          return(true);
          else
          {
            alert("Please enter a valid recipient e-mail address.");
           }
     } 
    else
    {
    alert("Please enter a valid sender e-mail address.");
    }
    return(false);
}

function CreateBookmarkLink() 
{
    title = document.title; 
    url = location.href;
    
    if (window.sidebar)   // Mozilla Firefox Bookmark
    { 
        window.sidebar.addPanel(title, url,"");
    } 
    else if( window.external )  // IE Favorite
    {
        window.external.AddFavorite( url, title); 
    }
    else if(window.opera && window.print)  // Opera Hotlist
    {
        return true; 
    }
}

function disablePaste(e){

    var pressedKey;

    if(window.event) // IE
    {
    pressedKey = String.fromCharCode(e.keyCode).toLowerCase();
          if (e.ctrlKey && pressedKey == "v") {
            e.returnValue = false;
          }
    }
    else if(e.which) // Netscape/Firefox/Opera
    { 
        
    }
}

function rightclickcheck(keyp){ 
    if (navigator.appName == "Netscape" && keyp.which == 3){return false; } 
    if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) {alert("Please type your E-mail Address");return false; } 
}

function Showquestion1(){
    
    if  (document.getElementById("q1").style.display == "none")
     { 
     document.getElementById("q1").style.display="block";
     }
    else 
      {
      document.getElementById("q1").style.display="none";
       }
      return false;
   }
   
function Showquestion2(){
    if  (document.getElementById("q2").style.display == "none")
     { 
     document.getElementById("q2").style.display="block";
     }
    else 
      {
      document.getElementById("q2").style.display="none";
       }
      return false;
   } 

function ShowAlanStory(){
    if  (document.getElementById("AlanStory").style.display == "none")
     { 
     document.getElementById("AlanStory").style.display="block";
     }
    else 
      {
      document.getElementById("AlanStory").style.display="none";
       }
      return false;
   } 

function ShowElaineStory(){
    if  (document.getElementById("ElaineStory").style.display == "none")
     { 
     document.getElementById("ElaineStory").style.display="block";
     }
    else 
      {
      document.getElementById("ElaineStory").style.display="none";
       }
      return false;
   } 
   
function ShowKevinStory(){
    if  (document.getElementById("KevinStory").style.display == "none")
     { 
     document.getElementById("KevinStory").style.display="block";
     }
    else 
      {
      document.getElementById("KevinStory").style.display="none";
       }
      return false;
   } 

function ShowShellyStory(){
    if  (document.getElementById("ShellyStory").style.display == "none")
     { 
     document.getElementById("ShellyStory").style.display="block";
     }
    else 
      {
      document.getElementById("ShellyStory").style.display="none";
       }
      return false;
   } 
   
function ShowSusanStory(){
    if  (document.getElementById("SusanStory").style.display == "none")
     { 
     document.getElementById("SusanStory").style.display="block";
     }
    else 
      {
      document.getElementById("SusanStory").style.display="none";
       }
      return false;
   } 
   
   function ShowLoadTips(){
    if  (document.getElementById("LoadTips").style.display == "none")
     { 
     document.getElementById("LoadTips").style.display="block";
     }
    else 
      {
      document.getElementById("LoadTips").style.display="none";
       }
      return false;
   } 
   
function ShowOfficeTips(){
    if  (document.getElementById("OfficeTips").style.display == "none")
     { 
     document.getElementById("OfficeTips").style.display="block";
     }
    else 
      {
      document.getElementById("OfficeTips").style.display="none";
       }
      return false;
   } 

function ShowLiftingTips(){
    if  (document.getElementById("LiftingTips").style.display == "none")
     { 
     document.getElementById("LiftingTips").style.display="block";
     }
    else 
      {
      document.getElementById("LiftingTips").style.display="none";
       }
      return false;
   } 
   
function MM_openBrWindow_(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function openDisclaimer(url) {
	MM_openBrWindow_( applicationRoot + '/Leaving.aspx?url=' + url,'winDisclaimer','width=370,height=372');
}

function openTermsConditions() {
	MM_openBrWindow_( applicationRoot + '/PhysicianLocator/Terms.aspx','winDisclaimer','width=460,height=350');
}

function goToRequested(url) {
    window.open(url, "_newWin", 'toolbar,menubar,scrollbars,resizable,location');    
    window.close();
}

function openTranscript() {
	MM_openBrWindow_( applicationRoot + '/Transcript.aspx','winDisclaimer','width=575,height=520,scrollbars');
}