/***********************************************
* ALL SITE JAVASCRIPTS ARE KEPT HERE.
***********************************************/

var IEBrowser = navigator.appName.indexOf("Microsoft") != -1

/***********************************************
* Switch Menu script- by Martial B of http://getElementById.com/
* Modified by Dynamic Drive for format & NS4/IE4 compatibility
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

if (document.getElementById)
{
  document.write('<style type="text/css">\n')
  document.write('.submenu{display: none;}\n')
  document.write('</style>\n')
}

function SwitchMenu(obj)
{
	if ( document.getElementById )
	{
		var el = document.getElementById(obj);
		var ar = document.getElementById("masterdiv").getElementsByTagName("span");
		if (el.style.display != "block")
		{
			for (var i=0; i<ar.length; i++)
			{
				if ( ar[i].className=="submenu" )
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		} else {
			el.style.display = "none";
		}
	}
}


/******************************************
* Mail To Friend Link
******************************************/
var mailtolink = "mailto:?subject=Dorian Software Creations Link&amp;body=Take a look at this information I found about Dorian Software Creations and their solutions:%0A" + location + "%0A%0A~~~~~~~~~~~~~~~~~~~~~~~~~%0A%0A" + "Dorian Software Creations: Automate Event Log Archiving, Analysis, and Detection! Visit www.doriansoft.com/totalsolution today!"


/******************************************
* Dreamweaver Jump Menu
******************************************/
function MM_goToURL()
{
	var i, args = MM_goToURL.arguments;
	document.MM_returnValue = false;
	for (i = 0; i < (args.length-1); i += 2)
		eval ( args[i] + ".location='" + args[i+1] + "'");
}

function MM_goToURL() { var i, args=MM_goToURL.arguments; document.MM_returnValue = false; for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'"); }
function MM_jumpMenu(targ,selObj,restore){ eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0; }

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function FindObj(n, d) {
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=FindObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}


/******************************************
* Download Center
******************************************/
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  }
  
  var boolval = false;
  for (i=0; i < MM_findObj('InterestedProducts').length; i++)
	boolval = boolval || MM_findObj('InterestedProducts')[i].checked;
  if (!boolval) errors += '- At least one product must be selected.\n';

  if (errors) alert ('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}


/******************************************
* Open Configurator Link
******************************************/
function OpenConfiguratorWindow()
{
	window.open('http://www.doriansoft.com/solutions/configurator/default.htm', 'configuratorpopup', 'scrollbars=no,width=458,height=400,top=115,left=100');
}


/******************************************
* Support Center Ticket Validation
******************************************/
var errors;

function FindObject(n, d)
{
	var p,i,x;
	if(!d)
		d=document;
	if((p=n.indexOf("?")) > 0 && parent.frames.length)
	{ d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p); }
	if(!(x=d[n])&&d.all)
		x=d.all[n];
	for (i=0;!x&&i<d.forms.length;i++)
		x=d.forms[i][n];
	for(i=0; !x&&d.layers && i<d.layers.length; i++)
		x=FindObject(n,d.layers[i].document);
	if(!x && d.getElementById)
		x=d.getElementById(n);
	return x;
}

function ValidateForm()
{
  var i,p,q,nm,test,num,min,max,args=ValidateForm.arguments;
  for (i=0; i<(args.length-2); i+=3)
  {
  	test=args[i+2];
	val=FindObject(args[i]);
	if (val)
	{
		nm=val.name;
		if ((val=val.value)!="")
		{
			if (test.indexOf('isEmail')!=-1)
			{
				p=val.indexOf('@');
				if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
			}
			else if (test!='R')
			{
				num = parseFloat(val);
				if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
				if (test.indexOf('inRange') != -1)
				{
					p=test.indexOf(':');
					min=test.substring(8,p);
					max=test.substring(p+1);
					if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
				}
			}
		} else if (test.charAt(0) == 'R')
			errors += '- '+nm+' is required.\n';
		}
	}
}

function FullEntryValidation()
{
	SingleFieldValidation();
}

function ValidateThisForm()
{
	errors = '';
	ValidateCheckboxGroup();
	ValidateForm('Name','','R','Company','','R','Email','','RisEmail');
	if (errors) alert('The following error(s) occurred:\n' + errors);
	document.ReturnValue = (errors == '');
	if (!errors) SingleFieldValidation();
}

function ValidateCheckboxGroup()
{
	var boolval = false;
	for (i=0; i < FindObject('chkProducts').length; i++)
		boolval = boolval || FindObject('chkProducts')[i].checked;
	if (!boolval) errors += '- At least one product must be selected.\n';

	boolval = false;
	for (i=0; i < FindObject('chkPlatform').length; i++)
		boolval = boolval || FindObject('chkPlatform')[i].checked;
	if (!boolval) errors += '- At least one OS must be selected.\n';
}

function SingleFieldValidation()
{
	errors = '';
	if (FindObject('OS Language').value == "") errors = 'missing';
	if (FindObject('Service Pack').value == "") errors = 'missing';
	if (FindObject('RAM').value == "") errors = 'missing';
	if (FindObject('Number of CPUs').value == "") errors = 'missing';
	if (FindObject('Speed of CPUs').value == "") errors = 'missing';
	if (FindObject('Hard Disk Size').value == "") errors = 'missing';
	if (FindObject('App Log Error').value == "") errors = 'missing';
	if (FindObject('Error Message').value == "") errors = 'missing';
	if (FindObject('Error Message Action').value == "") errors = 'missing';
	if (FindObject('Security Settings').value == "") errors = 'missing';
	if (FindObject('MDAC Version').value == "") errors = 'missing';
	if (FindObject('SQL Version').value == "") errors = 'missing';
	if (FindObject('MS Access Version').value == "") errors = 'missing';
	if (FindObject('Issue').value == "") errors = 'missing';
	
	if (errors == 'missing') {
		errors = 'For the best and most efficient service, we recommend that you provide as many answers as possible to the questions asked. Support requests with incomplete information may delay resolution of your issue. Do you wish to submit the form anyway?'
		document.ReturnValue = confirm(errors);		
	}
}






/******************************************
* Upgrade Center
******************************************/

var UpgradeValidationResult
var UltraAdminActive, EventMonitorActive, AtLeastOneSelected, FortressDesktopActive
var SelectedProductOptions = "<option value='EN_S'>Analyst Server</option><option value='EN_W'>Analyst Wkst</option><option value='EA_S'>Archiver Server</option><option value='EA_W'>Archiver Wkst</option><option value='EL_S'>Alarm Server</option><option value='EL_W'>Alarm Wkst</option>"
var AdditionUpgradeHTML = "<table width='325' border='0'><tr><td><select name='OtherProduct2' size='1'>"
var AdditionUpgradeHTMLTwo = "</select></td><td><input type='text' name='OtherLicenses2' size='6' maxlength='6'></td></tr></table>"
var OptionCode = "Please enter your purchase order number or transaction ID (for purchases made by credit card):<br><input type='text' name='POorTransID' size='25' maxlength='50'>"
var OptionTrans = false ;
var AddCounter = 0

function OpenPopupWindow(theURL)
{
  window.open(theURL,'Help','scrollbars=yes,width=625,height=400,top=100,left=100');
}

function DisplayOption()
{
  OptionTrans = true;
  document.getElementById("OtherOptions").innerHTML=OptionCode
}

function AddUpgradeInfoLine()
{
  AddCounter = AddCounter + 1;
  document.getElementById("AdditionOption").innerHTML =
	document.getElementById("AdditionOption").innerHTML + AdditionUpgradeHTML + SelectedProductOptions + AdditionUpgradeHTMLTwo;
}

function CheckForRightNS()
{
  var appver = navigator.appVersion.substring(0,4);
  if (!IEBrowser) {
    if (appver < 5.0) {
	  alert("You must be using Netscape 6.0 or later, or Internet Explorer, in order to use this form. If you are unable to use this form, please email your upgrade request to sales@doriansoft.com."); } 
  }
}

function UpgradeValidations()
{
  document.ValidationReturnValue = true ;
  ValidateUpgradeForm('EndUserName','','R','CompanyName','','R','Email','','RisEmail');
  if (OptionTrans) { ValidateUpgradeForm('POorTransID','','RisNum'); }
  else { ValidateUpgradeForm('ServiceNumberPartOne','','RisNum','ServiceNumberPartTwo','','RisNum'); }
  if (UltraAdminActive) { ValidateUpgradeForm('UALicenses','','RisNum'); }
  if (FortressDesktopActive) { ValidateUpgradeForm('FTUsers','','RisNum'); }
  if (EventMonitorActive) { ValidateUpgradeForm('OtherLicenses','','RisNum'); }
}

function ValidateUpgradeForm() {
  var i,p,q,nm,test,num,min,max,errors='',args=ValidateUpgradeForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=FindObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') {
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.ValidationReturnValue = document.ValidationReturnValue && (errors == '');
}

CheckForRightNS()

function UpgradeVisibility()
{
 
  if (IEBrowser) {

    AtLeastOneSelected = document.all.EventAnalyst.checked || document.all.EventArchiver.checked || document.all.EventAlarm.checked || document.all.UltraAdmin.checked  || document.all.FortressDesktop.checked || document.all.EventRover.checked
    EventMonitorActive = document.all.EventAnalyst.checked || document.all.EventArchiver.checked || document.all.EventAlarm.checked || document.all.EventRover.checked
	FortressDesktopActive = document.all.FortressDesktop.checked
    UltraAdminActive = document.all.UltraAdmin.checked

    if (AtLeastOneSelected)
	{
      document.all.UserInfo.style.visibility = "visible"
	  document.all.SubmitButton.style.visibility = "visible"
	} else {
      document.all.UserInfo.style.visibility = "hidden"
	  document.all.SubmitButton.style.visibility = "hidden"
	  document.all.UltraAdminInfo.style.visibility = "hidden"
	  document.all.OthersInfo.style.visibility = "hidden"
	}

	SelectedProductOptions = "" ;
	if ( document.all.EventAnalyst.checked ) {
		SelectedProductOptions = SelectedProductOptions + "<option value='EN_S'>Event Analyst</option>"
	}
	if ( document.all.EventArchiver.checked ) {
		SelectedProductOptions = SelectedProductOptions + "<option value='EA_S'>Event Archiver</option>"
	}
	if ( document.all.EventAlarm.checked ) {
		SelectedProductOptions = SelectedProductOptions + "<option value='EL_S'>Event Alarm</option>"
	}
	if ( document.all.EventRover.checked ) {
		SelectedProductOptions = SelectedProductOptions + "<option value='ER_S'>Event Rover</option>"
	}

  	if (UltraAdminActive) { document.all.UltraAdminInfo.style.visibility = "visible" }
	else { document.all.UltraAdminInfo.style.visibility = "hidden" }

  	if (FortressDesktopActive) { document.all.FortressDesktopInfo.style.visibility = "visible" }
	else { document.all.FortressDesktopInfo.style.visibility = "hidden" }
	
  	if (EventMonitorActive) { document.all.OthersInfo.style.visibility = "visible" } 
	else { document.all.OthersInfo.style.visibility = "hidden" }


	if (!UltraAdminActive)
	{
		document.all.UltraAdminInfo.style.top = 0 ;
		document.all.FortressDesktopInfo.style.top = -130 ;
		document.all.OthersInfo.style.top = -130 ;
		document.all.SubmitButton.style.top = -130 ;

		if (!FortressDesktopActive)
		{
			document.all.OthersInfo.style.top = -260 ;
			document.all.SubmitButton.style.top = -260 ;
		}
		else
		{
			if (!EventMonitorActive)
			{
				document.all.SubmitButton.style.top = -260 ;
			}
		}
	}
	else
	{
		document.all.UltraAdminInfo.style.top = 0 ;
		document.all.FortressDesktopInfo.style.top = 0 ;
		document.all.OthersInfo.style.top = 0 ;
		document.all.SubmitButton.style.top = 0 ;

		if (!FortressDesktopActive)
		{
			document.all.OthersInfo.style.top = -130 ;
			document.all.SubmitButton.style.top = -130 ;
			
			if (!EventMonitorActive)
			{
				document.all.SubmitButton.style.top = -230 ;
			}
		}
		else
		{
			if (!EventMonitorActive)
			{
				document.all.SubmitButton.style.top = -100 ;
			}
		}
	}

  } else {
  
    AtLeastOneSelected = document.Registration.EventAnalyst.checked || document.Registration.EventArchiver.checked || document.Registration.EventAlarm.checked || document.Registration.UltraAdmin.checked || document.Registration.FortressDesktop.checked || document.Registration.EventRover.checked
    EventMonitorActive = document.Registration.EventAnalyst.checked || document.Registration.EventArchiver.checked || document.Registration.EventAlarm.checked || document.Registration.EventRover.checked
	FortressDesktopActive = document.Registration.FortressDesktop.checked
    UltraAdminActive = document.Registration.UltraAdmin.checked

  	if (AtLeastOneSelected) {
      document.getElementById("UserInfo").visibility = "show"
	  document.getElementById("SubmitButton").visibility = "show"
    } else {
      document.getElementById("UserInfo").visibility = "hide"
	  document.getElementById("SubmitButton").visibility = "hide"
	}

	SelectedProductOptions = "" ;
	if ( document.Registration.EventAnalyst.checked ) {
		SelectedProductOptions = SelectedProductOptions + "<option value='EN_S'>Event Analyst</option>"
	}
	if ( document.Registration.EventArchiver.checked ) {
		SelectedProductOptions = SelectedProductOptions + "<option value='EA_S'>Event Archiver</option>"
	}
	if ( document.Registration.EventAlarm.checked ) {
		SelectedProductOptions = SelectedProductOptions + "<option value='EL_S'>Event Alarm</option>"
	}
	if ( document.Registration.EventRover.checked ) {
		SelectedProductOptions = SelectedProductOptions + "<option value='ER_S'>Event Rover</option>"
	}

  	if (UltraAdminActive) { document.getElementById("UltraAdminInfo").visibility = "show" }
	else { document.getElementById("UltraAdminInfo").visibility = "hide" }

  	if (FortressDesktopActive) { document.getElementById("FortressDesktopInfo").visibility = "show" }
	else { document.getElementById("FortressDesktopInfo").visibility = "hide" }
	
	if (EventMonitorActive) { document.getElementById("OthersInfo").visibility = "show" } 
	else { document.getElementById("OthersInfo").visibility = "hide" }

  }
  document.getElementById("ProductSelections").innerHTML = "<select name='OtherProduct' size='1'>" + SelectedProductOptions + "</select>" ;
}

function HideOrShow()
{
 
  if (IEBrowser) {

    AtLeastOneSelected = document.all.EventAnalyst.checked || document.all.EventArchiver.checked || document.all.EventAlarm.checked || document.all.UltraAdmin.checked
    EventMonitorActive = document.all.EventAnalyst.checked || document.all.EventArchiver.checked || document.all.EventAlarm.checked
    UltraAdminActive = document.all.UltraAdmin.checked

    if (AtLeastOneSelected) {
      document.all.UserInfo.style.visibility = "visible"
	  document.all.SubmitButton.style.visibility = "visible"
	} else {
      document.all.UserInfo.style.visibility = "hidden"
	  document.all.SubmitButton.style.visibility = "hidden"
	}

	SelectedProductOptions = "" ;
	if ( document.all.EventAnalyst.checked ) {
		SelectedProductOptions = SelectedProductOptions + "<option value='EN_S'>Event Analyst</option>"
	}
	if ( document.all.EventArchiver.checked ) {
		SelectedProductOptions = SelectedProductOptions + "<option value='EA_S'>Event Archiver</option>"
	}
	if ( document.all.EventAlarm.checked ) {
		SelectedProductOptions = SelectedProductOptions + "<option value='EL_S'>Event Alarm</option>"
	}

  	if (UltraAdminActive) { document.all.UltraAdminInfo.style.visibility = "visible" }
	else { document.all.UltraAdminInfo.style.visibility = "hidden" }
	
  	if (EventMonitorActive) {
		document.all.OthersInfo.style.visibility = "visible"
		document.getElementById("ProductSelections").innerHTML = "<select name='OtherProduct' size='1'>" + SelectedProductOptions + "</select>" ;
	} else { document.all.OthersInfo.style.visibility = "hidden" }
	
	if (UltraAdminActive && !EventMonitorActive)
	{ document.all.SubmitButton.style.top = -100 }
	if (!UltraAdminActive && EventMonitorActive)
	{ document.all.OthersInfo.style.top = -130
	document.all.SubmitButton.style.top = -130 }
	if (UltraAdminActive && EventMonitorActive)
	{ document.all.OthersInfo.style.top = 0
	document.all.SubmitButton.style.top = 0 }
 
  } else {
  
    AtLeastOneSelected = document.Registration.EventAnalyst.checked || document.Registration.EventArchiver.checked || document.Registration.EventAlarm.checked || document.Registration.UltraAdmin.checked
    EventMonitorActive = document.Registration.EventAnalyst.checked || document.Registration.EventArchiver.checked || document.Registration.EventAlarm.checked
    UltraAdminActive = document.Registration.UltraAdmin.checked

  	if (AtLeastOneSelected) {
      document.getElementById("UserInfo").visibility = "show"
	  document.getElementById("SubmitButton").visibility = "show"
    } else {
      document.getElementById("UserInfo").visibility = "hide"
	  document.getElementById("SubmitButton").visibility = "hide"
	}

	SelectedProductOptions = "" ;
	if ( document.Registration.EventAnalyst.checked ) {
		SelectedProductOptions = SelectedProductOptions + "<option value='EN_S'>Event Analyst</option>"
	}
	if ( document.Registration.EventArchiver.checked ) {
		SelectedProductOptions = SelectedProductOptions + "<option value='EA_S'>Event Archiver</option>"
	}
	if ( document.Registration.EventAlarm.checked ) {
		SelectedProductOptions = SelectedProductOptions + "<option value='EL_S'>Event Alarm</option>"
	}

  	if (UltraAdminActive) { document.getElementById("UltraAdminInfo").visibility = "show" }
	else { document.getElementById("UltraAdminInfo").visibility = "hide" }
  	
	if (EventMonitorActive) {
		document.getElementById("OthersInfo").visibility = "show"
		document.getElementById("ProductSelections").innerHTML = "<select name='OtherProduct' size='1'>" + SelectedProductOptions + "</select>" ;
	} else { document.getElementById("OthersInfo").visibility = "hide" }

  }
}






/******************************************
* Open Media Viewer Window 
******************************************/

function OpenMediaWindow()
{
	width = screen.width
	height = screen.height
	window.open('http://www.doriansoft.com/mediaviewer/moviemenu.asp?Width=' + width/2 + '&Height=' + height/2, 'moviepopup', 'scrollbars=no,width=' + width/2 + ',height=' + height/2 + ',top=' + height/4 + ',left=' + width/4 );
}






/******************************************
* Vacation/HOliday Window  
*
* Popup Box- By Jim Silver @ jimsilver47@yahoo.com
* Visit http://www.dynamicdrive.com/ for full source code
* This notice must stay intact for use
******************************************/

var ns4=document.layers
var ie4=document.all
var ns6=document.getElementById&&!document.all

//drag drop function for NS 4////
/////////////////////////////////

var dragswitch=0
var nsx
var nsy
var nstemp

function drag_dropns(name){
if (!ns4)
return
temp=eval(name)
temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
temp.onmousedown=gons
temp.onmousemove=dragns
temp.onmouseup=stopns
}

function gons(e){
temp.captureEvents(Event.MOUSEMOVE)
nsx=e.x
nsy=e.y
}
function dragns(e){
if (dragswitch==1){
temp.moveBy(e.x-nsx,e.y-nsy)
return false
}
}

function stopns(){
temp.releaseEvents(Event.MOUSEMOVE)
}

//drag drop function for ie4+ and NS6////
/////////////////////////////////


function drag_drop(e){
if (ie4&&dragapproved){
crossobj.style.left=tempx+event.clientX-offsetx
crossobj.style.top=tempy+event.clientY-offsety
return false
}
else if (ns6&&dragapproved){
crossobj.style.left=tempx+e.clientX-offsetx+"px"
crossobj.style.top=tempy+e.clientY-offsety+"px"
return false
}
}

function initializedrag(e){
crossobj=ns6? document.getElementById("showimage") : document.all.showimage
var firedobj=ns6? e.target : event.srcElement
var topelement=ns6? "html" : document.compatMode!="BackCompat"? "documentElement" : "body"
while (firedobj.tagName!=topelement.toUpperCase() && firedobj.id!="dragbar"){
firedobj=ns6? firedobj.parentNode : firedobj.parentElement
}

if (firedobj.id=="dragbar"){
offsetx=ie4? event.clientX : e.clientX
offsety=ie4? event.clientY : e.clientY

tempx=parseInt(crossobj.style.left)
tempy=parseInt(crossobj.style.top)

dragapproved=true
document.onmousemove=drag_drop
}
}
document.onmouseup=new Function("dragapproved=false")

////drag drop functions end here//////

function hidebox(){
if (ie4||ns6)
crossobj.style.visibility="hidden"
else if (ns4)
document.showimage.visibility="hide"
}




/******************************************
* Registration
******************************************/
var AdditionHTMLOne = "<table width='100%' border='0'><tr><td><select name='OtherProduct' size='1'>"
var AdditionHTMLTwo = "</select></td><td><input type='text' name='OtherChallenge' size='14' maxlength='50'></td><td><input type='text' name='OtherLicenses' size='6' maxlength='5'></td><td><input type='text' name='OtherOptional' size='7' maxlength='50'></td></tr></table>"

var SubmitButtonContent, OthersInfoContent, UltraAdminInfoContent, FortressDesktopInfoContent
var UltraAdminActive, EventMonitorActive, AtLeastOneSelected, FortressActive
var SelectedProductOptions
var AddCounter = 0

function OpenPopupWindow(theURL)
{
  window.open(theURL,'Help','scrollbars=yes,width=625,height=400,top=100,left=100');
}

function AddInfoLine()
{
  AddCounter = AddCounter + 1;
  document.all.OtherCounter.value = AddCounter + 1;
  document.getElementById("AdditionOption").innerHTML =
  document.getElementById("AdditionOption").innerHTML + AdditionHTMLOne + 
  SelectedProductOptions + AdditionHTMLTwo;
}

function RemoveInfoLine()
{
  var Temporary = "";
  AddCounter = AddCounter - 1;
  document.all.OtherCounter.value = AddCounter + 1
  Temporary = document.getElementById("AdditionOption").innerHTML;
  Temporary = Temporary.substring(0, Temporary.lastIndexOf("TBODY", Temporary.length - 30) - 25);
  document.getElementById("AdditionOption").innerHTML = Temporary;
}

function CheckForRightNS()
{
  var appver = navigator.appVersion.substring(0,4);
  if (!IEBrowser) {
    if (appver < 5.0) {
	  alert("You must be using Netscape 6.0 or later, or Internet Explorer, in order to use this form."); } 
  }
}

CheckForRightNS()

function RegistrationValidations()
{
  ValidateForm('EndUserName','','R','CompanyName','','R','Email','','RisEmail');
  ValidateForm('ServiceNumberPartOne','','RisNum','ServiceNumberPartTwo','','RisNum');
  if (UltraAdminActive) { ValidateForm('UALicenses','','RisNum'); }
  if (EventMonitorActive) { ValidateForm('OtherChallenge','','R','OtherLicenses','','R'); }
}

function ValidateForm()
{
  var i,p,q,nm,test,num,min,max,errors='',args=ValidateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=FindObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') {
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.ValidationReturnValue = (errors == '');
}

function SaveCellContents()
{
  OthersInfoContent = document.getElementById("OthersInfo").innerHTML
  SubmitButtonContent = document.getElementById("SubmitButton").innerHTML
  UltraAdminInfoContent = document.getElementById("UltraAdminInfo").innerHTML
  FortressDesktopInfoContent = document.getElementById("FortressDesktopInfo").innerHTML
}

function UpdateProductSelections()
{
	var OldOptions = SelectedProductOptions;

	SelectedProductOptions = "" ;

	if (IEBrowser)
	{

		if ( document.all.EventAnalyst.checked ) {
			SelectedProductOptions = SelectedProductOptions + 
			"<option value='EN_S'>Analyst Server</option><option value='EN_W'>Analyst Wkst</option>"
		}
		if ( document.all.EventArchiver.checked ) {
			SelectedProductOptions = SelectedProductOptions + 
			"<option value='EA_S'>Archiver Server</option><option value='EA_W'>Archiver Wkst</option>"
		}
		if ( document.all.EventAlarm.checked ) {
			SelectedProductOptions = SelectedProductOptions + 
			"<option value='EL_S'>Alarm Server</option><option value='EL_W'>Alarm Wkst</option>"
		}
		if ( document.all.EventRover.checked ) {
			SelectedProductOptions = SelectedProductOptions + 
			"<option value='ER_S'>Rover Server</option><option value='ER_W'>Rover Wkst</option>"
		}
		if ( document.all.UltraAdmin.checked ) {
			SelectedProductOptions = SelectedProductOptions + 
			"<option value='UA'>UltraAdmin Users</option>"
		}

	} else {

		if ( document.Registration.EventAnalyst.checked ) {
			SelectedProductOptions = SelectedProductOptions + 
			"<option value='EN_S'>Analyst Server</option><option value='EN_W'>Analyst Wkst</option>"
		}
		if ( document.Registration.EventArchiver.checked ) {
			SelectedProductOptions = SelectedProductOptions + 
			"<option value='EA_S'>Archiver Server</option><option value='EA_W'>Archiver Wkst</option>"
		}
		if ( document.Registration.EventAlarm.checked ) {
			SelectedProductOptions = SelectedProductOptions + 
			"<option value='EL_S'>Alarm Server</option><option value='EL_W'>Alarm Wkst</option>"
		}
		if ( document.Registration.EventRover.checked ) {
			SelectedProductOptions = SelectedProductOptions + 
			"<option value='ER_S'>Rover Server</option><option value='ER_W'>Rover Wkst</option>"
		}
		if ( document.Registration.UltraAdmin.checked ) {
			SelectedProductOptions = SelectedProductOptions + 
			"<option value='UA'>UltraAdmin Users</option>"
		}

	}

	document.getElementById("ProductSelections").innerHTML = "<select name='OtherProduct' size='1'>" + SelectedProductOptions + "</select>";
}

function SetInnerHtmlByCodes(EventMonitorActive, UltraAdminActive, FortressActive)
{

	if (!UltraAdminActive && !EventMonitorActive && FortressActive)
	{
		document.getElementById("UltraAdminInfo").innerHTML = FortressDesktopInfoContent
		document.getElementById("FortressDesktopInfo").innerHTML = SubmitButtonContent
		document.getElementById("OthersInfo").innerHTML = OthersInfoContent
		document.getElementById("SubmitButton").innerHTML = UltraAdminInfoContent
	}

	if (!UltraAdminActive && EventMonitorActive && !FortressActive)
	{
		document.getElementById("UltraAdminInfo").innerHTML = OthersInfoContent
		document.getElementById("FortressDesktopInfo").innerHTML = SubmitButtonContent
		document.getElementById("OthersInfo").innerHTML = FortressDesktopInfoContent
		document.getElementById("SubmitButton").innerHTML = UltraAdminInfoContent
	}

	if (!UltraAdminActive && EventMonitorActive && FortressActive)
	{
		document.getElementById("UltraAdminInfo").innerHTML = FortressDesktopInfoContent
		document.getElementById("FortressDesktopInfo").innerHTML = OthersInfoContent
		document.getElementById("OthersInfo").innerHTML = SubmitButtonContent
		document.getElementById("SubmitButton").innerHTML = UltraAdminInfoContent
	}

	if (UltraAdminActive && EventMonitorActive && !FortressActive)
	{
		document.getElementById("UltraAdminInfo").innerHTML = UltraAdminInfoContent
		document.getElementById("FortressDesktopInfo").innerHTML = OthersInfoContent
		document.getElementById("OthersInfo").innerHTML = SubmitButtonContent
		document.getElementById("SubmitButton").innerHTML = FortressDesktopInfoContent
	}

	if (UltraAdminActive && !EventMonitorActive && !FortressActive)
	{
		document.getElementById("UltraAdminInfo").innerHTML = UltraAdminInfoContent
		document.getElementById("FortressDesktopInfo").innerHTML = SubmitButtonContent
		document.getElementById("OthersInfo").innerHTML = FortressDesktopInfoContent
		document.getElementById("SubmitButton").innerHTML = OthersInfoContent
	}

	if (UltraAdminActive && !EventMonitorActive && FortressActive)
	{
		document.getElementById("UltraAdminInfo").innerHTML = UltraAdminInfoContent
		document.getElementById("FortressDesktopInfo").innerHTML = FortressDesktopInfoContent
		document.getElementById("OthersInfo").innerHTML = SubmitButtonContent
		document.getElementById("SubmitButton").innerHTML = OthersInfoContent
	}

	if (UltraAdminActive && EventMonitorActive && FortressActive)
	{
		document.getElementById("UltraAdminInfo").innerHTML = UltraAdminInfoContent
		document.getElementById("FortressDesktopInfo").innerHTML = FortressDesktopInfoContent
		document.getElementById("OthersInfo").innerHTML = OthersInfoContent
		document.getElementById("SubmitButton").innerHTML = SubmitButtonContent
	}
}

function RegistrationVisibility()
{
  if (IEBrowser)
  {
    AtLeastOneSelected = document.all.EventAnalyst.checked || document.all.EventArchiver.checked || document.all.EventAlarm.checked || document.all.EventRover.checked || document.all.UltraAdmin.checked || document.all.FortressDesktop.checked
    EventMonitorActive = document.all.EventAnalyst.checked || document.all.EventArchiver.checked || document.all.EventAlarm.checked || document.all.EventRover.checked || document.all.UltraAdmin.checked
	FortressActive = document.all.FortressDesktop.checked
	UltraAdminActive = false

	if (AtLeastOneSelected)
	{
		document.all.UserInfo.style.visibility = "visible"
		document.all.UltraAdminInfo.style.visibility = "visible"
		document.all.FortressDesktopInfo.style.visibility = "visible"
	} else {
		document.all.UserInfo.style.visibility = "hidden"
		document.all.UltraAdminInfo.style.visibility = "hidden"
		document.all.FortressDesktopInfo.style.visibility = "hidden"
	}

	if ( (UltraAdminActive && FortressActive) || (UltraAdminActive && EventMonitorActive) || 
	(EventMonitorActive && FortressActive) )
	{
		document.all.OthersInfo.style.visibility = "visible"
	} else {
		document.all.OthersInfo.style.visibility = "hidden"
	}

	if (UltraAdminActive && EventMonitorActive && FortressActive)
	{
		document.all.SubmitButton.style.visibility = "visible"
	} else {
		document.all.SubmitButton.style.visibility = "hidden"
	}

  	if (EventMonitorActive) {
		document.all.OtherCounter.value = 1;
	} else {
		document.all.OtherCounter.value = 0
	}

  } else {
  
    AtLeastOneSelected = document.Registration.EventAnalyst.checked || document.Registration.EventArchiver.checked || document.Registration.EventAlarm.checked || document.Registration.EventRover.checked || document.Registration.UltraAdmin.checked || document.Registration.FortressDesktop.checked ;
    EventMonitorActive = document.Registration.EventAnalyst.checked || document.Registration.EventArchiver.checked || document.Registration.EventRover.checked || document.Registration.EventAlarm.checked || document.Registration.UltraAdmin.checked;
	FortressActive = document.Registration.FortressDesktop.checked ;
	UltraAdminActive = false;
	//UltraAdminActive = document.Registration.UltraAdmin.checked;

    if (AtLeastOneSelected) {
		document.getElementById("UserInfo").style.visibility="visible";
		document.getElementById("SubmitButton").style.visibility="visible";
	} else {
		document.getElementById("UserInfo").style.visibility="hidden";
		document.getElementById("SubmitButton").style.visibility="hidden";
	}

  	if (UltraAdminActive) {
		document.getElementById("UltraAdminInfo").style.visibility = "visible"
	} else {
		document.getElementById("UltraAdminInfo").style.visibility = "hidden"
	}
	
  	if (EventMonitorActive) {
		document.getElementById("OthersInfo").style.visibility = "visible"
	} else {
		document.getElementById("OthersInfo").style.visibility = "hidden"
	}

	if (UltraAdminActive && EventMonitorActive && FortressActive)
	{
		document.getElementById("SubmitButton").style.visibility = "visible"
	} else {
		document.getElementById("SubmitButton").style.visibility = "hidden"
	}
	
  }

  SetInnerHtmlByCodes ( EventMonitorActive, UltraAdminActive, FortressActive ) ;
  
  UpdateProductSelections();
  
}

function HideOrShow()
{
  if (IEBrowser) {

    AtLeastOneSelected = document.all.EventAnalyst.checked || document.all.EventArchiver.checked || document.all.EventAlarm.checked || document.all.EventRover.checked || document.all.UltraAdmin.checked
    EventMonitorActive = document.all.EventAnalyst.checked || document.all.EventArchiver.checked || document.all.EventAlarm.checked || document.all.EventRover.checked || document.all.UltraAdmin.checked
    UltraAdminActive = false
    //UltraAdminActive = document.all.UltraAdmin.checked

    if (AtLeastOneSelected) {
      document.all.UserInfo.style.visibility = "visible"
	  document.all.SubmitButton.style.visibility = "visible"
	} else {
      document.all.UserInfo.style.visibility = "hidden"
	  document.all.SubmitButton.style.visibility = "hidden"
	}

  	if (UltraAdminActive) {
		document.all.UltraAdminInfo.style.visibility = "visible"
	} else {
		document.all.UltraAdminInfo.style.visibility = "hidden"
	}
	
	SelectedProductOptions = "" ;
	if ( document.all.EventAnalyst.checked ) {
		SelectedProductOptions = SelectedProductOptions + "<option value='EN_S'>Analyst Server</option><option value='EN_W'>Analyst Wkst</option>"
	}
	if ( document.all.EventArchiver.checked ) {
		SelectedProductOptions = SelectedProductOptions + "<option value='EA_S'>Archiver Server</option><option value='EA_W'>Archiver Wkst</option>"
	}
	if ( document.all.EventAlarm.checked ) {
		SelectedProductOptions = SelectedProductOptions + "<option value='EL_S'>Alarm Server</option><option value='EL_W'>Alarm Wkst</option>"
	}
	if ( document.all.EventRover.checked ) {
		SelectedProductOptions = SelectedProductOptions + "<option value='ER_S'>Rover Server</option><option value='ER_W'>Rover Wkst</option>"
	}
	if ( document.all.UltraAdmin.checked ) {
		SelectedProductOptions = SelectedProductOptions + "<option value='UA'>UltraAdmin Users</option>"
	}

  	if (EventMonitorActive) {
		document.all.OthersInfo.style.visibility = "visible";
		document.all.OtherCounter.value = 1;
		document.getElementById("ProductSelections").innerHTML = "<select name='OtherProduct' size='1'>" + SelectedProductOptions + "</select>";
	} else {
		document.all.OthersInfo.style.visibility = "hidden"
		document.all.OtherCounter.value = 0
	}
	
	if (UltraAdminActive && !EventMonitorActive)
	{ document.all.SubmitButton.style.top = -100 }
	if (!UltraAdminActive && EventMonitorActive)
	{ document.all.OthersInfo.style.top = -110
	document.all.SubmitButton.style.top = -110 }
	if (UltraAdminActive && EventMonitorActive)
	{ document.all.OthersInfo.style.top = 0
	document.all.SubmitButton.style.top = 0 }
	
  } else {
  
    AtLeastOneSelected = document.Registration.EventAnalyst.checked || document.Registration.EventArchiver.checked || document.Registration.EventAlarm.checked || document.Registration.EventRover.checked || document.Registration.UltraAdmin.checked;
    EventMonitorActive = document.Registration.EventAnalyst.checked || document.Registration.EventArchiver.checked || document.Registration.EventRover.checked || document.Registration.EventAlarm.checked || document.Registration.UltraAdmin.checked;
	UltraAdminActive = false;
	//UltraAdminActive = document.Registration.UltraAdmin.checked;

    if (AtLeastOneSelected) {
		document.getElementById("UserInfo").style.visibility="visible";
		document.getElementById("SubmitButton").style.visibility="visible";
	} else {
		document.getElementById("UserInfo").style.visibility="hidden";
		document.getElementById("SubmitButton").style.visibility="hidden";
	}

  	if (UltraAdminActive) {
		document.getElementById("UltraAdminInfo").style.visibility = "visible"
	} else {
		document.getElementById("UltraAdminInfo").style.visibility = "hidden"
	}
	
	SelectedProductOptions = "" ;
	if ( document.Registration.EventAnalyst.checked ) {
		SelectedProductOptions = SelectedProductOptions + "<option value='EN_S'>Analyst Server</option><option value='EN_W'>Analyst Wkst</option>"
	}
	if ( document.Registration.EventArchiver.checked ) {
		SelectedProductOptions = SelectedProductOptions + "<option value='EA_S'>Archiver Server</option><option value='EA_W'>Archiver Wkst</option>"
	}
	if ( document.Registration.EventAlarm.checked ) {
		SelectedProductOptions = SelectedProductOptions + "<option value='EL_S'>Alarm Server</option><option value='EL_W'>Alarm Wkst</option>"
	}
	if ( document.Registration.EventRover.checked ) {
		SelectedProductOptions = SelectedProductOptions + "<option value='ER_S'>Rover Server</option><option value='ER_W'>Rover Wkst</option>"
	}
	if ( document.Registration.EventRover.checked ) {
		SelectedProductOptions = SelectedProductOptions + "<option value='UA'>UltraAdmin Users</option>"
	}
	
  	if (EventMonitorActive) {
		document.getElementById("OthersInfo").style.visibility = "visible"
		document.getElementById("ProductSelections").innerHTML = "<select name='OtherProduct' size='1'>" + SelectedProductOptions + "</select>" ;
	} else {
		document.getElementById("OthersInfo").style.visibility = "hidden"
	}

	if (UltraAdminActive && !EventMonitorActive)
	{ document.getElementById("SubmitButton").style.top = -100 }
	if (!UltraAdminActive && EventMonitorActive)
	{ document.getElementById("OthersInfo").style.top = -100
	document.getElementById("SubmitButton").style.top = -100 }
	if (UltraAdminActive && EventMonitorActive)
	{ document.getElementById("OthersInfo").style.top = 0
	document.getElementById("SubmitButton").style.top = 0 }

  }
}


/******************************************
* E-Card Send Button Helper
******************************************/
var send_ecard_button_been_here = 0;
function send_ecard_button()
{
  if (send_ecard_button_been_here++ > 0) return false;
  document.Personalize.SendCard.value="true";
  setTimeout("document.Personalize.submit()", 100);
  return false;
}

/******************************************
* E-Card textarea limiter
******************************************/
function textCounter(theField,maxChars,maxLines,maxPerLine)
{
	var strTemp = "";
	var strLineCounter = 0;
	var strCharCounter = 0;

	for (var i = 0; i < theField.value.length; i++)
	{
		var strChar = theField.value.substring(i, i + 1);
		if (strChar == '\n')
		{
			strTemp += strChar;
			strCharCounter = 1;
			strLineCounter += 1;
		}
		else if (strCharCounter == maxPerLine)
		{
			strTemp += '\n' + strChar;
			strCharCounter = 1;
			strLineCounter += 1;
		}
		else
		{
			strTemp += strChar;
			strCharCounter ++;
		}
	}

	if (theField.value.length > maxChars)
		theField.value = theField.value.substring(0, maxChars);
	
	if (strLineCounter > maxLines)
		theField.value = theField.value.substring(0, maxPerLine * maxLines);
}

/******************************************
* Download Popups Legal Validation
******************************************/
function ValidateLegalCheckbox()
{
	var errors = '';
	var boolval = false;

	document.ValidationResult = true;

	boolval = FindObject('LegalConsent')(0).checked;

	errors = "In order to download and use this software, you " +
	"must agree to the licensing agreement. Click OK to close this window or " +
	"click Cancel to change your response and agree to the license agreement..\n";

	if (!boolval)
	{
		boolval = confirm(errors);
		if (boolval)
			window.close();
		else
			document.ValidationResult = false;
	}

}

/******************************************
* Download Popups Legal Validation
******************************************/
function DisplayContinents()
{
 
  if (IEBrowser) {

    ResellerContactDesired = document.all.ContactReseller.checked

    if (ResellerContactDesired) {
      document.all.ContinentList.style.visibility = "visible"
	} else {
      document.all.ContinentList.style.visibility = "hidden"
	}

  } else {

    ResellerContactDesired = document.DoubleOptInSystem.ResellerContactDesired.checked || document.Registration.EventArchiver.checked || document.Registration.EventAlarm.checked || document.Registration.UltraAdmin.checked

  	if (ResellerContactDesired) {
      document.getElementById("ContinentList").visibility = "show"
    } else {
      document.getElementById("ContinentList").visibility = "hide"
	}

  }
}

function GoToResellerQuote()
{ 
	MM_goToURL("parent","http://www.doriansoft.com/resellersales/getaquote")
}

function GoToSalesQuote()
{ 
	MM_goToURL("parent","http://www.doriansoft.com/sales/autoquote")
}

function ReturnToDoriansoft()
{ 
	MM_goToURL("parent","http://www.doriansoft.com")
}






var arrExisting = new Array(
'Technical Support',
'Information or Quote on Support',
'A Quote on Additional Licensing',
'Registration Information',
'My Service Number');

var arrExistingKeys = new Array(
"http://www.doriansoft.com/support/index.htm",
"http://www.doriansoft.com/navigator/faq.htm#SupportServices",
"http://www.doriansoft.com/sales/quote.htm",
"http://www.doriansoft.com/navigator/faq.htm#Registration",
"http://www.doriansoft.com/navigator/faq.htm#ServiceNumbers");

var arrPotential = new Array(
"Technical Support",
"Pricing",
"Quote on Licensing or Support Services",
"Software for Download",
"Registration Information");

var arrPotentialKeys = new Array(
"http://www.doriansoft.com/support/index.htm",
"http://www.doriansoft.com/sales/pricing.htm",
"http://www.doriansoft.com/sales/quote.htm",
"http://www.doriansoft.com/download/index.htm",
"http://www.doriansoft.com/navigator/faq.htm#Registration");

var arrReseller = new Array(
"Pricing",
"Information on Sending Purchase Orders",
"A Quote",
"Registration Information for a Customer",
"Confirmation of An Order");

var arrResellerKeys = new Array(
"http://www.doriansoft.com/resellersales/resellersales.htm#Pricing",
"http://www.doriansoft.com/resellersales/resellersales.htm#PO",
"http://www.doriansoft.com/resellersales/resellersales.htm#Pricing",
"http://www.doriansoft.com/resellersales/resellersales.htm#Delivery",
"http://www.doriansoft.com/navigator/faq.htm#OrderConfirmation");

var arrProcure = new Array(
"Pricing",
"Information on Sending Purchase Orders",
"A Quote",
"Registration Information for Customer",
"Confirmation of An Order",
"Information or Quote on Support",
"My Service Number");

var arrProcureKeys = new Array(
"http://www.doriansoft.com/sales/pricing.htm",
"http://www.doriansoft.com/ourcompany/contact.htm#sales",
"http://www.doriansoft.com/sales/quote.htm",
"http://www.doriansoft.com/navigator/faq.htm#Registration",
"http://www.doriansoft.com/navigator/faq.htm#OrderConfirmation",
"http://www.doriansoft.com/navigator/faq.htm#SupportServices",
"http://www.doriansoft.com/navigator/faq.htm#ServiceNumbers");

function NavigatorUserTypeChange()
{
	var choice ;

	var box = document.forms[0].UserType;
	var secondbox = document.forms[0].LookingFor ;

	choice = box.options[box.selectedIndex].value;
	if (choice == "Select One:") choice = ""
	
	secondbox.options.length = 0 ;

	if ( choice == "existing" )
	{
		for ( i = 0 ; i < arrExisting.length ; i++ )
		{
			secondbox.options[i] = new Option ( arrExisting[i], arrExistingKeys[i] ) ;
		}
	}

	if ( choice == "potential" )
	{
		for ( i = 0 ; i < arrPotential.length ; i++ )
		{
			secondbox.options[i] = new Option ( arrPotential[i], arrPotentialKeys[i] ) ;
		}
	}

	if ( choice == "reseller" )
	{
		for ( i = 0 ; i < arrReseller.length ; i++ )
		{
			secondbox.options[i] = new Option ( arrReseller[i], arrResellerKeys[i] ) ;
		}
	}

	if ( choice == "procure" )
	{
		for ( i = 0 ; i < arrProcure.length ; i++ )
		{
			secondbox.options[i] = new Option ( arrProcure[i], arrProcureKeys[i] ) ;
		}
	}

	if ( IEBrowser )
	{
		document.all.SecondChoices.style.visibility = "visible"
	} else {
		document.getElementById("SecondChoices").style.visibility = "visible"
	}

	if ( choice == "" )
	{
		if ( IEBrowser )
		{
			document.all.SecondChoices.style.visibility = "hidden"
		} else {
			document.getElementById("SecondChoices").style.visibility = "hidden"
		}
	}
}

function KBValidation()
{
	var ProductSelected = false;

	for ( i = 0 ; i < FindObject('KBProducts').length ; i++ )
		ProductSelected = ProductSelected || FindObject('KBProducts')[i].checked;

	if ( !ProductSelected )
		alert ( "Please select one or more relevant software titles before performing your Knowledge Base search." ) ;

	document.KBReturnValue = ProductSelected;
}


/******************************************
* Layer Panel Popup - Used in Reseller Center
******************************************/


		  function toggleLayer(whichLayer)
{
if (document.getElementById)
{
// this is the way the standards work
var style2 = document.getElementById(whichLayer).style;
style2.display = style2.display? "":"block";
}
else if (document.all)
{
// this is the way old msie versions work
var style2 = document.all[whichLayer].style;
style2.display = style2.display? "":"block";
}
else if (document.layers)
{
// this is the way nn4 works
var style2 = document.layers[whichLayer].style;
style2.display = style2.display? "":"block";
}
}




/******************************************
***** Updated Registration System *********
******************************************/
var AdditionalCounter = 0

function RegVisibility()
{
  AtLeastOneSelected = false
  EventMonitorActive = false
  FortressActive = false

  if ( IEBrowser )
  {

    for ( var i=0 ; i < document.all.Products.length ; i++ )
	{
	  AtLeastOneSelected = AtLeastOneSelected || document.all.Products[i].checked

	  if ( (i < 4) || (i == 5) )
	  {
	    EventMonitorActive = EventMonitorActive || document.all.Products[i].checked
	  }
	}

    FortressActive = document.all.Products[4].checked

	if ( AtLeastOneSelected )
	{
		document.all.UserInfo.style.visibility = "visible"
		document.all.SubmitButton.style.visibility = "visible"
	} else {
		document.all.UserInfo.style.visibility = "hidden"
		document.all.SubmitButton.style.visibility = "hidden"
	}

	if ( FortressActive )
	{
		document.all.FortressDesktopInfo.style.visibility = "visible"
	} else {
		document.all.FortressDesktopInfo.style.visibility = "hidden"
	}

	if ( EventMonitorActive )
	{
		document.all.OtherCounter.value = 1;
		document.all.EventLogInfo.style.visibility = "visible"
	} else {
		document.all.OtherCounter.value = 0
		document.all.EventLogInfo.style.visibility = "hidden"
	}

  } else {

    for ( var i=0 ; i < document.all.Products.length ; i++ )
	{
	  AtLeastOneSelected = AtLeastOneSelected || document.Registration.Products[i].checked

	  if ( (i < 4) || (i == 5) )
	  {
	    EventMonitorActive = EventMonitorActive || document.Registration.Products[i].checked
	  }
	}

	FortressActive = document.all.Products[4].checked

    if (AtLeastOneSelected) {
		document.getElementById("UserInfo").style.visibility="visible";
		document.getElementById("SubmitButton").style.visibility="visible";
	} else {
		document.getElementById("UserInfo").style.visibility="hidden";
		document.getElementById("SubmitButton").style.visibility="hidden";
	}

  	if (FortressActive) {
		document.getElementById("FortressDesktopInfo").style.visibility = "visible"
	} else {
		document.getElementById("FortressDesktopInfo").style.visibility = "hidden"
	}
	
  	if (EventMonitorActive) {
		document.getElementById("EventLogInfo").style.visibility = "visible"
	} else {
		document.getElementById("EventLogInfo").style.visibility = "hidden"
	}

  }
  
  VerticallyAlignTables(EventMonitorActive,FortressActive);

  GenerateProductSelections();
}

function VerticallyAlignTables(ELAct,FTAct)
{
	document.getElementById("FortressDesktopInfo").style.position = "relative"
	document.getElementById("EventLogInfo").style.position = "relative"
	document.getElementById("SubmitButton").style.position = "relative"

	if (FTAct && !ELAct)
	{
		document.getElementById("FortressDesktopInfo").style.top = 0
		document.getElementById("EventLogInfo").style.top = 0
		document.getElementById("SubmitButton").style.top = -120
	}
	else if (FTAct && ELAct)
	{
		document.getElementById("FortressDesktopInfo").style.top = 0
		document.getElementById("EventLogInfo").style.top = 0
		document.getElementById("SubmitButton").style.top = 0
	}
	else if (!FTAct && ELAct)
	{
		document.getElementById("FortressDesktopInfo").style.top = 0
		document.getElementById("EventLogInfo").style.top = -100
		document.getElementById("SubmitButton").style.top = -100
	}
}

function GenerateProductSelections()
{
	SelectedProductOptions = "" ;

	if (IEBrowser)
	{

		if ( document.all.Products[0].checked ) {
			SelectedProductOptions = SelectedProductOptions + 
			"<option value='EN_S'>Analyst Server</option><option value='EN_W'>Analyst Wkst</option>"
		}
		if ( document.all.Products[1].checked ) {
			SelectedProductOptions = SelectedProductOptions + 
			"<option value='EA_S'>Archiver Server</option><option value='EA_W'>Archiver Wkst</option>"
		}
		if ( document.all.Products[2].checked ) {
			SelectedProductOptions = SelectedProductOptions + 
			"<option value='EL_S'>Alarm Server</option><option value='EL_W'>Alarm Wkst</option>"
		}
		if ( document.all.Products[3].checked ) {
			SelectedProductOptions = SelectedProductOptions + 
			"<option value='ER_S'>Rover Server</option><option value='ER_W'>Rover Wkst</option>"
		}
		if ( document.all.Products[5].checked ) {
			SelectedProductOptions = SelectedProductOptions + 
			"<option value='EI_S'>Importer Servers</option>"
		}

	} else {

		if ( document.Registration.Products[0].checked ) {
			SelectedProductOptions = SelectedProductOptions + 
			"<option value='EN_S'>Analyst Server</option><option value='EN_W'>Analyst Wkst</option>"
		}
		if ( document.Registration.Products[1].checked ) {
			SelectedProductOptions = SelectedProductOptions + 
			"<option value='EA_S'>Archiver Server</option><option value='EA_W'>Archiver Wkst</option>"
		}
		if ( document.Registration.Products[2].checked ) {
			SelectedProductOptions = SelectedProductOptions + 
			"<option value='EL_S'>Alarm Server</option><option value='EL_W'>Alarm Wkst</option>"
		}
		if ( document.Registration.Products[3].checked ) {
			SelectedProductOptions = SelectedProductOptions + 
			"<option value='ER_S'>Rover Server</option><option value='ER_W'>Rover Wkst</option>"
		}
		if ( document.Registration.Products[5].checked ) {
			SelectedProductOptions = SelectedProductOptions + 
			"<option value='EI_S'>Importer Servers</option>"
		}

	}

	document.getElementById("ProductSelections").innerHTML = "<select name='OtherProduct' size='1'>" + SelectedProductOptions + "</select>";
}

function RegAddInfoLine()
{
  if (IEBrowser)
  {
	var EventLogTable = document.getElementById("EventLogInfo") ;

    AdditionalCounter = AdditionalCounter + 1 ;

    document.getElementById("OtherCounter").value = AdditionalCounter + 1 ;

    var newrow = EventLogTable.insertRow(6);

    for ( var i=0 ; i < 4 ; i++ )
    {
      newrow.insertCell(i);
      newrow.cells[i].innerHTML = EventLogTable.rows[5].cells[i].innerHTML;
    }
  }
  else
  {
	alert("This option only works in Internet Explorer 6 and above. To submit multiple registrations, you may " +
		  "either submit them seperately here or switch to Internet Explorer before submitting your " +
		  "registration request.")
  }
}

function RegRemoveInfoLine()
{
  if ( AdditionalCounter > 0 )
  {
    AdditionalCounter = AdditionalCounter - 1;

    document.getElementById("OtherCounter").value = AdditionalCounter + 1 ;

    document.getElementById("EventLogInfo").deleteRow(6) ;
  }
}
