﻿


function ScheduleAttemptPopUp(edit) {

    var visitID = document.forms[0].ctl00_MainBody_ddlVisit[document.forms[0].ctl00_MainBody_ddlVisit.selectedIndex].value;
    var state = document.forms[0].ctl00_MainBody_ddlStates[document.forms[0].ctl00_MainBody_ddlStates.selectedIndex].value;
    var siteID = document.forms[0].ctl00_MainBody_ddlSite[document.forms[0].ctl00_MainBody_ddlSite.selectedIndex].value;


  var windowWidth = '450';
  var windowHeight = '450';
  var int_windowLeft = (screen.width - windowWidth) / 2;
  var int_windowTop = (screen.height - windowHeight) / 2;
  var str_windowProperties = 'height=' + windowHeight + ',width=' + windowWidth + ',top=' + int_windowTop + ',left=' + int_windowLeft + ',scrollbars=0,resizable=0,menubar=0,toolbar=0,location=0,statusbar=1,fullscreen=0';

  if (edit == '1')
    {
          var scheduleAttempt = document.forms[0].ctl00_MainBody_ddlScheduleAttempts[document.forms[0].ctl00_MainBody_ddlScheduleAttempts.selectedIndex].value;
    var obj_window = window.open('ScheduleAttempts.aspx?edit=1&visitID=' + visitID + '&state=' + state + '&siteID=' + siteID + '&scheduleAttempt=' + scheduleAttempt, 'ScheduleAttempts', str_windowProperties);
    }
  else
    var obj_window = window.open('ScheduleAttempts.aspx?edit=0&visitID=' + visitID + '&state=' + state + '&siteID=' + siteID , 'ScheduleAttempts', str_windowProperties);

    if (parseInt(navigator.appVersion) >= 4) {
      obj_window.window.focus();
    }
}
