function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


var ifOn = false;
function overOn(state) { ifOn = state }
function change(objName,x,theProp,theValue) { //v3.0
	
	if (ifOn == false) {
		var obj = MM_findObj(objName);
		if (obj && (theProp.indexOf("style.")==-1 || obj.style)) eval("obj."+theProp+"='"+theValue+"'");
	}
}


function MM_changeProp(objName,x,theProp,theValue) { //v3.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)) eval("obj."+theProp+"='"+theValue+"'");
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i>a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function IsAllValid(checkStr)
{
	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzfSOsoYÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ<ETH>ÑÒÓÔÕÖØÙÚÛÜY´<THORN>ßàáâãäåæçèéêëìíîï<eth>ñòóôõöøùúûüy´<thorn>0123456789-@._ \t\r\n\f";
    var allValid = true;
    for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
			if (ch == checkOK.charAt(j))
				break;
	
		if (j == checkOK.length)
		{
			allValid = false;
			break;
		}
	}

	return allValid;
}

function Form_Validator_Request(theForm)
{
	if (theForm.FirstName.value.length < 2 )
	{
		alert("Please enter your first name.");
		theForm.FirstName.focus();
		return false;
	}
	
	if (!IsAllValid(theForm.FirstName.value))
	{
		alert("Please enter only letter and whitespace characters in the \"First Name\" field.");
		theForm.FirstName.focus();
		return (false);
	}
	
	if (theForm.LastName.value.length < 2)
	{
		alert("Please enter your last name.");
		theForm.LastName.focus();
		return false;
	}

	if (!IsAllValid(theForm.LastName.value))
	{
		alert("Please enter only letter and whitespace characters in the \"Last Name\" field.");
		theForm.LastName.focus();
		return false;
	}

	if (theForm.Company.value.length < 2)
	{
		alert("Please enter your Company name.")
		theForm.Company.focus();
		return false;
	}

	if (theForm.Phone.value.length < 7)
	{
		alert("Please enter your phone number.");
		theForm.Phone.focus();
		return false;
	}

	if (theForm.Email.value.length < 5)
	{
		alert("Please enter your email address.  A valid email address is necessary to send you the password needed to run the demo.");
		theForm.Email.focus();
		return false;
	}

	if (theForm.Email.value.indexOf("@") == -1) 
    {
		alert("Please include a proper email address.");
		theForm.Email.focus();
		return false;
    }

	return true;
}

function Form_Validator_Detail(theForm)
{
	if (theForm.FirstName.value.length < 2 )
	{
		alert("Please enter your first name.");
		theForm.FirstName.focus();
		return false;
	}
	
	if (!IsAllValid(theForm.FirstName.value))
	{
		alert("Please enter only letter and whitespace characters in the \"First Name\" field.");
		theForm.FirstName.focus();
		return (false);
	}
	
	if (theForm.LastName.value.length < 2)
	{
		alert("Please enter your last name.");
		theForm.LastName.focus();
		return false;
	}

	if (!IsAllValid(theForm.LastName.value))
	{
		alert("Please enter only letter and whitespace characters in the \"Last Name\" field.");
		theForm.LastName.focus();
		return false;
	}

	if (theForm.Company.value.length < 2)
	{
		alert("Please enter your Company name.")
		theForm.Company.focus();
		return false;
	}

	if (theForm.Address1.value == "")
	{
		alert("Please enter your address.");
		theForm.Address1.focus();
		return false;
	}

	if (theForm.City.value == "")
	{
		alert("Please enter your city.");
		theForm.City.focus();
		return false;
	}

	if (theForm.Country.value == "United States" && theForm.State.value.length < 2)
	{
		alert("Because you have selected the United States as your country, you must enter your state/province.");
		theForm.State.focus();
		return false;
	}

	if (theForm.Country.value == "United States" && theForm.ZipCode.value.length < 5)
	{
		alert("Because you have selected the United States as your country, you must enter your postal code.");
		theForm.ZipCode.focus();
		return false;
	}

	if (theForm.Country.value == "")
	{
		alert("Please select a country from the list.");
		theForm.Country.focus();
		return false;
	}

	if (theForm.Phone.value.length < 7)
	{
		alert("Please enter your phone number.");
		theForm.Phone.focus();
		return false;
	}

	if (theForm.Email.value.length < 5)
	{
		alert("Please enter your email address.  A valid email address is necessary to send you the password needed to run the demo.");
		theForm.Email.focus();
		return false;
	}

	if (theForm.Email.value.indexOf("@") == -1) 
    {
		alert("Please include a proper email address.");
		theForm.Email.focus();
		return false;
    }

	if (theForm.Industry.value == "Other" && theForm.OtherIndustry.value == "")
	{
		alert("Because you have selected 'Other' in the Industry field, you must provide your industry.");
		theForm.OtherIndustry.focus();
		return false;
	}

	return true;
}

function Form_Validator_Detail_Postal(theForm)
{
	if (theForm.FirstName.value.length < 2 )
	{
		alert("Please enter your first name.");
		theForm.FirstName.focus();
		return false;
	}
	
	if (!IsAllValid(theForm.FirstName.value))
	{
		alert("Please enter only letter and whitespace characters in the \"First Name\" field.");
		theForm.FirstName.focus();
		return (false);
	}
	
	if (theForm.LastName.value.length < 2)
	{
		alert("Please enter your last name.");
		theForm.LastName.focus();
		return false;
	}

	if (!IsAllValid(theForm.LastName.value))
	{
		alert("Please enter only letter and whitespace characters in the \"Last Name\" field.");
		theForm.LastName.focus();
		return false;
	}

	if (theForm.Company.value.length < 2)
	{
		alert("Please enter your Company name.")
		theForm.Company.focus();
		return false;
	}

	if (theForm.Address1.value == "")
	{
		alert("Please enter your address.");
		theForm.Address1.focus();
		return false;
	}

	if (theForm.City.value == "")
	{
		alert("Please enter your city.");
		theForm.City.focus();
		return false;
	}

	if (theForm.Country.value == "United States" && theForm.State.value.length < 2)
	{
		alert("Because you have selected the United States as your country, you must enter your state/province.");
		theForm.State.focus();
		return false;
	}

	if (theForm.ZipCode.value.length < 5)
	{
		alert("Please enter your postal code.");
		theForm.ZipCode.focus();
		return false;
	}

	if (theForm.Country.value == "")
	{
		alert("Please select a country from the list.");
		theForm.Country.focus();
		return false;
	}

	if (theForm.Phone.value.length < 7)
	{
		alert("Please enter your phone number.");
		theForm.Phone.focus();
		return false;
	}

	if (theForm.Email.value.length < 5)
	{
		alert("Please enter your email address.  A valid email address is necessary to send you the password needed to run the demo.");
		theForm.Email.focus();
		return false;
	}

	if (theForm.Email.value.indexOf("@") == -1) 
    {
		alert("Please include a proper email address.");
		theForm.Email.focus();
		return false;
    }

	if (theForm.Industry.value == "Other" && theForm.OtherIndustry.value == "")
	{
		alert("Because you have selected 'Other' in the Industry field, you must provide your industry.");
		theForm.OtherIndustry.focus();
		return false;
	}

	return true;
}

function Form_Validator(theForm)
{

  if (theForm.name.value == "")
  {
    alert("Please enter a value for the \"Name\" field.");
    theForm.name.focus();
    return (false);
  }

  if (theForm.name.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"Name\" field.");
    theForm.name.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzfSOsoYÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ0123456789-@._ \t\r\n\f";
  var checkStr = theForm.name.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter and whitespace characters in the \"Name\" field.");
    theForm.name.focus();
    return (false);
  }

  if (theForm.company.value == "")
  {
    alert("Please enter a value for the \"Company\" field.");
    theForm.company.focus();
    return (false);
  }

  if (theForm.phone.value == "")
  {
	alert("Please enter a phone number.");
	theForm.phone.focus();
	return (false);
  }

  if (theForm.phone.value.length < 7)
  {
	alert("Please enter your complete phone number.");
	theForm.phone.focus();
	return (false);
  }
 
  if (theForm.email.value == "")
  {
    alert("Please enter a value for the \"Email\" field.");
    theForm.email.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzfSOsoYÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ0123456789-@._ \t\r\n\f";
  var checkStr = theForm.email.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter, digit, whitespace and \"@\" characters in the \"Email\" field.");
    theForm.email.focus();
    return (false);
  }
  
  if (theForm.email.value.indexOf("@") == -1) 
    {
		alert("Please include a proper email address.");
		theForm.email.focus();
		return(false);
    }
  
		
  if (theForm.comments.value.length > 255)
	{
		alert("Please limit your comments to 255 characters.");
		theForm.comments.focus();
		return(false);
	}

  return (true);
}

function ValidateFormA(frm)
{
	if((frm.Name.value == "") || (frm.Name.value.length < 5))
	{
		alert("You must enter your name \(at least 5 characters\).");
		frm.Name.focus();
		return(false);
	}
	if((frm.Company.value == "") || (frm.Company.value.length < 2))
	{
		alert("You must enter the name of your company \(at least 2 characters\).");
		frm.Company.focus();
		return(false);
	}
	if((frm.Addr1.value == "") || (frm.Addr1.value.length < 5))
	{
		alert("You must enter your address \(at least 5 characters\).");
		frm.Addr1.focus();
		return(false);
	}
	if((frm.City.value == "") || (frm.City.value.length < 3))
	{
		alert("You must enter your city \(at least 3 characters\).");
		frm.City.focus();
		return(false);
	}
	if((frm.Phone.value == "") || (frm.Phone.value.length < 7))
	{
		alert("You must enter at your phone number \(at least 7 characters\).");
		frm.Phone.focus();
		return(false);
	}
	if (!frm.Payment[0].checked &&
		!frm.Payment[1].checked &&
		!frm.Payment[2].checked &&
		!frm.Payment[3].checked) {
	// no radio button is selected
		alert("Please select a payment method.");
		return(false);
	}

	var checkOK = "0123456789-().";
	var checkStr = frm.Phone.value;
	var allValid = true;
	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		  if (ch == checkOK.charAt(j))
			break;
		if (j == checkOK.length)
		{
		  allValid = false;
		  break;
		}
	}
	if (!allValid)
	{
		alert("Please enter only digits, hyphens, or parentheses in the Phone field.");
		frm.Phone.focus();
		return (false);
	}
	
	var checkOK = "0123456789-().";
	var checkStr = frm.Fax.value;
	var allValid = true;
	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		  if (ch == checkOK.charAt(j))
			break;
		if (j == checkOK.length)
		{
		  allValid = false;
		  break;
		}
	}
	if (!allValid)
	{
		alert("Please enter only digits, hyphens, or parentheses in the Fax field.");
		frm.Fax.focus();
		return (false);
	}

	if((frm.Email.value == "") || (frm.Email.value.length < 5))
	{
		alert("You must complete the email field \(at least 5 characters\).");
		frm.Email.focus();
		return(false);
	}
	
	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzfSOsoYÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ0123456789-@._ \t\r\n\f";
	var checkStr = frm.Email.value;
	var allValid = true;
	for (i = 0;  i < checkStr.length;  i++)
	{
	  ch = checkStr.charAt(i);
	  for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
	  if (j == checkOK.length)
	  {
	    allValid = false;
	   break;
	  }
	}
	
	if (!allValid)
	{
	  alert("Please enter only letter, digit, whitespace and \"@\" characters in the E-mail field.");
	  frm.Email.focus();
	  return (false);
	}

	return(true);
}

function ValidateFormT(theForm)
{
	if (theForm.Name.value == "")
	{
		alert("Please enter a value for the \"Name\" field.");
		theForm.Name.focus();
		return (false);
	}
	if (theForm.Name.value.length < 5)
	{
		alert("Please enter at least 5 characters in the \"Name\" field.");
		theForm.Name.focus();
		return (false);
	}
  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzfSOsoYÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ0123456789-@._ \t\r\n\f";
  var checkStr = theForm.Name.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter and whitespace characters in the \"Name\" field.");
    theForm.Name.focus();
    return (false);
  }



  if (theForm.Company.value == "")
  {
    alert("Please enter a value for the \"Company\" field.");
    theForm.Company.focus();
    return (false);
  }
	if (theForm.Company.value.length < 2)
	{
		alert("Please enter at least 2 characters in the \"Company\" field.");
		theForm.Company.focus();
		return (false);
	}



  if (theForm.Addr1.value == "")
  {
    alert("Please enter a value for the \"Address\" field.");
    theForm.Addr1.focus();
    return (false);
  }
	if (theForm.Addr1.value.length < 5)
	{
		alert("Please enter at least 5 characters in the \"Address\" field.");
		theForm.Addr1.focus();
		return (false);
	}



  if (theForm.City.value == "")
  {
    alert("Please enter a value for the \"City\" field.");
    theForm.City.focus();
    return (false);
  }
	if (theForm.City.value.length < 3)
	{
		alert("Please enter at least 3 characters in the \"City\" field.");
		theForm.City.focus();
		return (false);
	}



  if (theForm.State.value == "")
  {
    alert("Please enter a value for the \"State\" field.");
    theForm.State.focus();
    return (false);
  }
	if (theForm.State.value.length < 2)
	{
		alert("Please enter at least 2 characters in the \"State\" field.");
		theForm.State.focus();
		return (false);
	}



  if (theForm.Zip.value == "")
  {
    alert("Please enter a value for the \"Zip\" field.");
    theForm.Zip.focus();
    return (false);
  }
	if (theForm.Zip.value.length < 5)
	{
		alert("Please enter at least 5 characters in the \"Zip\" field.");
		theForm.Zip.focus();
		return (false);
	}



  if (theForm.Phone.value == "")
  {
    alert("Please enter a value for the \"Phone\" field.");
    theForm.Phone.focus();
    return (false);
  }
	if (theForm.Phone.value.length < 7)
	{
		alert("Please enter at least 7 characters in the \"Phone\" field.");
		theForm.Phone.focus();
		return (false);
	}

	var checkOK = "0123456789-().";
	var checkStr = theForm.Phone.value;
	var allValid = true;
	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		  if (ch == checkOK.charAt(j))
			break;
		if (j == checkOK.length)
		{
		  allValid = false;
		  break;
		}
	}
	if (!allValid)
	{
		alert("Please enter only digits, hyphens, or parentheses in the Phone field.");
		theForm.Phone.focus();
		return (false);
	}
	
	var checkOK = "0123456789-().";
	var checkStr = theForm.Fax.value;
	var allValid = true;
	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		  if (ch == checkOK.charAt(j))
			break;
		if (j == checkOK.length)
		{
		  allValid = false;
		  break;
		}
	}
	if (!allValid)
	{
		alert("Please enter only digits, hyphens, or parentheses in the Fax field.");
		theForm.Fax.focus();
		return (false);
	}
	
	
	

  if (theForm.Email.value == "")
  {
    alert("Please enter a value for the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }
	if (theForm.Email.value.length < 5)
	{
		alert("Please enter at least 5 characters in the \"Email\" field.");
		theForm.Email.focus();
		return (false);
	}

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzfSOsoYÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ0123456789-@._ \t\r\n\f";
  var checkStr = theForm.Email.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter, digit, whitespace and \"@\" characters in the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }
  
  if (theForm.Email.value.indexOf("@") == -1) 
    {
		alert("Please include a proper email address.");
		theForm.Email.focus();
		return(false);
    }
  
		
  if (theForm.Additional.value.length > 255)
	{
		alert("Please limit your comments to 255 characters.");
		theForm.Additional.focus();
		return(false);
	}

	return(true);
}



function Form_Validator_RepIncident(form1)
{
	if (form1.version.value == "")
	{
		alert("Please enter the version of Relex you are using.");
		form1.version.focus();
		return false;
	}

	if (form1.module.value == "")
	{
		alert("Please enter the module you are having trouble with.");
		form1.module.focus();
		return false;
	}


	if (form1.OS.value == "")
	{
		alert("Please select your operating system.");
		form1.OS.focus();
		return false;
	}

	return true;
}



// Flash Detection Below ===================================================

// initialize a variable to test for JavaScript 1.1.

// which is necessary for the window.location.replace method

var javascriptVersion1_1 = false;


javascriptVersion1_1 = true;


// initialize global variables

var detectableWithVB = false;

var pluginFound = false;





function goURL(daURL) {

    // if the browser can do it, use replace to preserve back button

    if(javascriptVersion1_1) {

	window.location.replace(daURL);

    } else {

	window.location = daURL;

    }

    return;

}



function redirectCheck(pluginFound, redirectURL, redirectIfFound) {

    // check for redirection

    if( redirectURL && ((pluginFound && redirectIfFound) || 

	(!pluginFound && !redirectIfFound)) ) {

	// go away

	goURL(redirectURL);

	return pluginFound;

    } else {

	// stay here and return result of plugin detection

	return pluginFound;

    }	

}



function canDetectPlugins() {

    if( detectableWithVB || (navigator.plugins && navigator.plugins.length > 0) ) {

	return true;

    } else {

	return false;

    }

}



function detectFlash(redirectURL, redirectIfFound) {

    pluginFound = detectPlugin('Shockwave','Flash'); 

    // if not found, try to detect with VisualBasic

    if(!pluginFound && detectableWithVB) {

	pluginFound = detectActiveXControl('ShockwaveFlash.ShockwaveFlash.1');

    }

    // check for redirection

    return redirectCheck(pluginFound, redirectURL, redirectIfFound);

}



function detectDirector(redirectURL, redirectIfFound) { 

    pluginFound = detectPlugin('Shockwave','Director'); 

    // if not found, try to detect with VisualBasic

    if(!pluginFound && detectableWithVB) {

	pluginFound = detectActiveXControl('SWCtl.SWCtl.1');

    }

    // check for redirection

    return redirectCheck(pluginFound, redirectURL, redirectIfFound);

}



function detectQuickTime(redirectURL, redirectIfFound) {

    pluginFound = detectPlugin('QuickTime');

    // if not found, try to detect with VisualBasic

    if(!pluginFound && detectableWithVB) {

	pluginFound = detectQuickTimeActiveXControl();

    }

    return redirectCheck(pluginFound, redirectURL, redirectIfFound);

}



function detectReal(redirectURL, redirectIfFound) {

    pluginFound = detectPlugin('RealPlayer');

    // if not found, try to detect with VisualBasic

    if(!pluginFound && detectableWithVB) {

	pluginFound = (detectActiveXControl('rmocx.RealPlayer G2 Control') ||

		       detectActiveXControl('RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)') ||

		       detectActiveXControl('RealVideo.RealVideo(tm) ActiveX Control (32-bit)'));

    }	

    return redirectCheck(pluginFound, redirectURL, redirectIfFound);

}



function detectWindowsMedia(redirectURL, redirectIfFound) {

    pluginFound = detectPlugin('Windows Media Player');

    // if not found, try to detect with VisualBasic

    if(!pluginFound && detectableWithVB) {

	pluginFound = detectActiveXControl('MediaPlayer.MediaPlayer.1');

    }

    return redirectCheck(pluginFound, redirectURL, redirectIfFound);

}



function detectPlugin() {

    // allow for multiple checks in a single pass

    var daPlugins = detectPlugin.arguments;

    // consider pluginFound to be false until proven true

    var pluginFound = false;

    // if plugins array is there and not fake

    if (navigator.plugins && navigator.plugins.length > 0) {

	var pluginsArrayLength = navigator.plugins.length;

	// for each plugin...

	for (pluginsArrayCounter=0; pluginsArrayCounter < pluginsArrayLength; pluginsArrayCounter++ ) {

	    // loop through all desired names and check each against the current plugin name

	    var numFound = 0;

	    for(namesCounter=0; namesCounter < daPlugins.length; namesCounter++) {

		// if desired plugin name is found in either plugin name or description

		if( (navigator.plugins[pluginsArrayCounter].name.indexOf(daPlugins[namesCounter]) >= 0) || 

		    (navigator.plugins[pluginsArrayCounter].description.indexOf(daPlugins[namesCounter]) >= 0) ) {

		    // this name was found

		    numFound++;

		}   

	    }

	    // now that we have checked all the required names against this one plugin,

	    // if the number we found matches the total number provided then we were successful

	    if(numFound == daPlugins.length) {

		pluginFound = true;

		// if we've found the plugin, we can stop looking through at the rest of the plugins

		break;

	    }

	}

    }

    return pluginFound;

} // detectPlugin





// Here we write out the VBScript block for MSIE Windows

if ((navigator.userAgent.indexOf('MSIE') != -1) && (navigator.userAgent.indexOf('Win') != -1)) {

    document.writeln('<scr' + 'ipt language="VBscript">');



    document.writeln('\'do a one-time test for a version of VBScript that can handle this code');

    document.writeln('detectableWithVB = False');

    document.writeln('If ScriptEngineMajorVersion >= 2 then');

    document.writeln('  detectableWithVB = True');

    document.writeln('End If');



    document.writeln('\'this next function will detect most plugins');

    document.writeln('Function detectActiveXControl(activeXControlName)');

    document.writeln('  on error resume next');

    document.writeln('  detectActiveXControl = False');

    document.writeln('  If detectableWithVB Then');

    document.writeln('     detectActiveXControl = IsObject(CreateObject(activeXControlName))');

    document.writeln('  End If');

    document.writeln('End Function');



    document.writeln('\'and the following function handles QuickTime');

    document.writeln('Function detectQuickTimeActiveXControl()');

    document.writeln('  on error resume next');

    document.writeln('  detectQuickTimeActiveXControl = False');

    document.writeln('  If detectableWithVB Then');

    document.writeln('    detectQuickTimeActiveXControl = False');

    document.writeln('    hasQuickTimeChecker = false');

    document.writeln('    Set hasQuickTimeChecker = CreateObject("QuickTimeCheckObject.QuickTimeCheck.1")');

    document.writeln('    If IsObject(hasQuickTimeChecker) Then');

    document.writeln('      If hasQuickTimeChecker.IsQuickTimeAvailable(0) Then ');

    document.writeln('        detectQuickTimeActiveXControl = True');

    document.writeln('      End If');

    document.writeln('    End If');

    document.writeln('  End If');

    document.writeln('End Function');



    document.writeln('</scr' + 'ipt>');

}

// -->



function MM_goToURL() { //v3.0

  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() { //v3.0

  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]+"'");

}


// Cookie Setter Below ===================================================
function setCookie(name, value)
{
  window.document.cookie = name+"="+value;
}


// Flash Embedder Part 1 Below ===================================================
//v1.0
//Copyright 2006 Adobe Systems, Inc. All rights reserved.
function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '<object ';
  for (var i in objAttrs)
    str += i + '="' + objAttrs[i] + '" ';
  str += '>';
  for (var i in params)
    str += '<param name="' + i + '" value="' + params[i] + '" /> ';
  str += '<embed ';
  for (var i in embedAttrs)
    str += i + '="' + embedAttrs[i] + '" ';
  str += ' ></embed></object>';

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "id":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}


// Flash Embedder Part 2 Below ===================================================
//v1.1
//Copyright 2006 Adobe Systems, Inc. All rights reserved.
function AC_AX_RunContent(){
  var ret = AC_AX_GetArgs(arguments);
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_AX_GetArgs(args){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "pluginspage":
      case "type":
      case "src":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "data":
      case "codebase":
      case "classid":
      case "id":
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  return ret;
}
