﻿// JScript File

// System Messages
var ResetConfirm = 'This action will clear all the fields\nAre you sure you want to continue?';

// Close window 
function closeWindow() {
   newwin = window.open(location.href,'_parent',''); 
newwin.close(); 

}


function OpenPopup(URL,Name)
{
  if(window.showModalDialog)
  {
  window.showModalDialog(URL,Name,'status=no,toolbar=no,menubar=no,location=yes,scrollbars=yes,width=500,height=600',false); 
  }
  else
  {
     window.open(URL,Name,'modal,status=no,toolbar=no,menubar=no,location=yes,scrollbars=yes,width=500,height=600',false); 
  }
}

function OpenPopupLarge(URL,Name)
{
  if(window.showModalDialog)
  {
  window.showModalDialog(URL,Name,'status=no,toolbar=no,menubar=no,location=yes,scrollbars=yes,width=500,height=600',false); 
  }
  else
  {
     window.open(URL,Name,'modal,status=no,toolbar=no,menubar=no,location=yes,scrollbars=yes,width=500,height=600',false); 
  }
}


function OpenFullScreen(URL,Name)
{
  if(window.showModalDialog)
  {
  window.open(URL + '&NoCache=' + Math.random(),Name,'status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,width=500,height=600',false); 
  }
  else
  {
     window.open(URL + '&NoCache=' + Math.random(),Name,'status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,width=500,height=600',false); 
  }
}
function DoPrint(PrintAreaID)
{
try
{
	var Ctrl = document.getElementById(PrintAreaID);
	var PrintPage = window.open('../Print/Print.aspx?ContainerID='+ PrintAreaID ,'Print','status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes',false);
	}
	catch(err)
	{
	  alert("Sorry, couldn't print the document for the following error:\n " + err.message);
	}
}
function ClearForm()
{
  try
   {
    if(confirm(ResetConfirm))
	document.forms[0].reset();
   }
   catch(err)
   {
      alert("Sorry, couldn't clear the document for the following error:\n " + err.message);
   }
}
