﻿// JScript File

function ShowModalWindow(tWindowType, tWindowName, ItemID, q, s)
{
	sFeatures = 'dialogHeight:600px; dialogWidth:700px; status:no; scroll:no';
	tPath = '';
	switch (tWindowType)
	{
    case 'Event':
      tPath = 'commonControls/';
      break;
      
     case 'EventNotes':
      tPath = 'commonControls/';
 			sFeatures = 'dialogHeight:600px; dialogWidth:700px; status:no; scroll:yes';
      break;
     
    case 'Person':
      tPath = 'PersonControls/';
      break;
      
    case 'controls':
      tPath = 'commonControls/';
      break;

    default: 
      tPath = 'commonControls/';
   }

	tWindowName = tPath + tWindowName + '?id=' + ItemID;
    if(q != ''){
	    tWindowName = tWindowName + '&' + q + '=' + s;}
	
	if (tWindowType = 'PaperVision')
	{
		myWindow = window.open(tWindowName,'','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,dependent=yes,width=700px,height=525px');
		//myWindow.moveTo(0,0);
		myWindow.focus;
		return false;
	}
	else
		window.showModalDialog(tWindowName, window, sFeatures);
}



function ShowEventNotes(tWindowName, ItemID, q, s)
{
	sFeatures = 'dialogHeight:600px; dialogWidth:700px; status:no; scroll:no';

	tWindowName = 'commonControls/' + tWindowName + '?id=' + ItemID;
  if(q != ''){
		tWindowName = tWindowName + '&' + q + '=' + s;}
		
	window.showModalDialog(tWindowName, window, sFeatures);
}



function ShowModalWindowC(tWindowName, ItemID, q, s)
{
	sFeatures = 'dialogHeight:600px; dialogWidth:700px; status:no; scroll:no';
	tWindowName = 'commonControls/' + tWindowName + '?id=' + ItemID;
  if(q != ''){
		tWindowName = tWindowName + '&' + q + '=' + s;}
	
	window.showModalDialog(tWindowName, window, sFeatures);
}



function ShowModalWindowP(tWindowName, ItemID, q, s)
{
	sFeatures = 'dialogHeight:600px; dialogWidth:700px; status:no; scroll:no';
	tWindowName = 'PersonControls/' + tWindowName + '?id=' + ItemID;
  if(q != ''){
		tWindowName = tWindowName + '&' + q + '=' + s;}

	window.showModalDialog(tWindowName, window, sFeatures);
}


function onControlClick(sTargetID, sEventArgument)
{
    var postBack = new Sys.WebForms.PostBackAction();
    
    postBack.set_target(sTargetID);
    postBack.set_eventArgument(sEventArgument);
    
    postBack.performAction();
}
 

function ConfirmDelete(tRecordType)
{
	var bDelete = false;
	bDelete = confirm('Deleting a ' + tRecordType + ' record is permanent and can not be undone.  Permanently delete this record? (You will be asked one more time.)');
	if (bDelete)
		bDelete = confirm('FINAL Confirm for record Deletion:  Permanently delete this' + tRecordType + ' record?');
	return bDelete;
}

