function checksource(){		// Ensure page was not bookmarked
 if(document.referrer == "" &&!window.opener)document.location.href = "http://www.meditrak.com.au/"
 }

function todaydate(){
var today_date= new Date()
var myyear=today_date.getYear()
var mymonth=today_date.getMonth()+1
var mytoday=today_date.getDate()
document.write(myyear+"/"+mymonth+"/"+mytoday)
}

/*
Pop up image viewer script II
By JavaScript Kit (http://javascriptkit.com)
Image size should be set at 650x420px
*/

function popimage(imagesrc,title){
var look='left=150,width=900,height=750,resizable,'
popwin=window.open("","",look)
popwin.document.open()
popwin.document.write('<html><head><title>Image Window</title><link type=\"text/css\" rel="stylesheet\" href=\"https://www.meditrak.com.au/store/mtkimage.css\" ></head>')
popwin.document.write('<body><div id=\"Picture\"><img src='+imagesrc+'><p>'+title+'<form>')
popwin.document.write('<input type="button" value="Click to Close Window" onclick="window.close()"></form></div></body></html>')
popwin.document.close()
}

function poplink(imagesrc){
popwin=window.open(imagesrc)
}


function popimagetall(imagesrc,title){
var look='width=500,height=750,resizable,'
popwin=window.open("","",look)
popwin.document.open()
popwin.document.write('<html><head><title>Image Window</title><link type=\"text/css\" rel="stylesheet\" href=\"https://www.meditrak.com.au/mtkimage.css\" ></head>')
popwin.document.write('<body><div id=\"Picture\"><img src='+imagesrc+'><p>'+title+'<form>')
popwin.document.write('<input type="button" value="Click to Close Window" onclick="window.close()"></form></div></body></html>')
popwin.document.close()
}



function CloseWindow(){
window.close()
}

function setfocus()
{
document.getCustomerInfo.LOGONID.focus()
}

function logonCheck()
{
window.location=("https://www.meditrak.com.au/support/members/membershome.php");
}

function opener2()
{
window.close()
}

function checkEnter(evtObj)
{
if(navigator.appName == 'Netscape') {
if(evtObj.which == 13) return logonCheck();
} else {
if(event.keyCode == 13) return logonCheck();
}
}

function loadbase()
{
window.location=("http://www.meditrak.com.au/index.htm");
}

function loadmail()
{
window.location=("mail.php");
}

//Get cookie routine by Shelley Powers 
function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    // if cookie exists
    if (offset != -1) { 
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset);
      // set index of end of cookie value
      if (end == -1) end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}
