// sembleWare Show Calendar Function
function sw_show_calendar(sTargetTitle, sTargetName, sTargetValue) {
  var sCalendarPage;
  sCalendarPage = "Calendar.aspx?Title=" + sTargetTitle + "&Target=" + sTargetName + "&Value=" + sTargetValue;
  var vWinCal = window.open(sCalendarPage, "Calendar", "width=210,height=230,status=no,resizable=yes,top=200,left=200");
  vWinCal.opener = self;
  vWinCal.focus();
}
// End sembleWare Show Calendar Function

// sembleWare Is Grid Record Selected Function
function sw_is_record_selected(oGrid) {
	var bItemSelected = false;

	for (i = 0;i < oGrid.rows.length; i++) {				
	  if(oGrid.rows(i).cells(0).childNodes(0).type == "radio")
	    if(oGrid.rows(i).cells(0).childNodes(0).checked) {
	 	    bItemSelected = true;
				i = oGrid.rows.length;
			}
	}
	if (bItemSelected)
	  return true;
  else {
	  alert ("No Record Has Been Selected!\nPlease select a record.");
	  return false;
  }
}		
// End sembleWare Is Grid Record Selected Function

// sembleWare Prompt Confirmation Function
function sw_prompt_confirmation(sMessage)	{
	return confirm(sMessage);
}
// End sembleWare Prompt Confirmation Function

// sembleWare Prompt Grid Confirmation Function
function sw_prompt_grid_confirmation(sMessage, oGrid)	{
	if (sw_is_record_selected(oGrid))
		return confirm(sMessage);
  else
		return false;
}
// End sembleWare Prompt Grid Confirmation Function
function GetBrowserInfo() {
  browser = new Object();
  browser.name = browser.version = browser.os = "unknown";
  var userAgent = navigator.userAgent.toLowerCase();
  var browserListArray = new Array("firefox", "msie", "netscape", "opera", "safari");
  var osListArray = new Array("linux", "mac", "windows", "x11");
  for(var i = 0, n = browserListArray.length; i < n; i++) {   // get browser name and version
    var strPosition = userAgent.indexOf(browserListArray[i]) + 1;
    if(strPosition > 0) {
      browser.name = browserListArray[i]; // browser name

      var versionPosition = strPosition + browser.name.length;
      var incr = ((browser.name == "safari") || (userAgent.charAt(versionPosition + 4) > 0 && userAgent.charAt(versionPosition + 4) < 9)) ? 5 : 3;

      browser.version     = userAgent.substring(versionPosition, versionPosition + incr); // browser version
    }
  }
  for(var i = 0, n = osListArray.length; i < n; i++) {
    var strPosition = userAgent.indexOf(osListArray[i]) + 1;
    if(strPosition > 0) {
      browser.os  = osListArray[i];
    }
  }
  return browser;
}

var moBrowser = GetBrowserInfo();

