default_odd_color = "#dedede";
default_even_color = "#ffffff";


function pop(URL) {
	newWindow = window.open(URL,'_blank','toolbar=no,location=no,scrollbars=no,resize=no,width=600,height=430,screenX=0,screenY=100,top=0,left=100');
}

function pop_sm(URL) {
	newWindow = window.open(URL,'_blank','toolbar=no,location=no,scrollbars=no,resize=no,width=340,height=360,screenX=0,screenY=100,top=0,left=100');
}

function showsite(val)
{
	if(val){
		this.open(val);
	}
}

/* VALIDATION */

function validRequired(formField,fieldLabel)
{
	var result = true;	
	if (formField.value == "")
	{
		alert('Please enter a value for the "' + fieldLabel +'" field.');
		formField.focus();
		result = false;
	}	
	return result;
}


function validateFeedbackForm(theForm)
{

	 
	if (!validRequired(theForm.name,"Name"))
		return false;
		
	if (!validRequired(theForm.comment,"Comment"))
		return false;	
	
	if (!validRequired(theForm.email,"Email"))
		return false;	

	return true;
}

function validateVolunteerForm(theForm)
{
	if (!validRequired(theForm.name,"Name"))
		return false;
		
	if (!validRequired(theForm.email,"Email"))
		return false;	

	return true;
}


function isEmailValid(emailStr) {
	/* The following pattern is used to check if the entered e-mail address
	   fits the user@domain format.  It also is used to separate the username
	   from the domain. */
	
	var emailPat=/^(.+)@(.+)$/;	 
	var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]";	 
	var validChars="\[^\\s" + specialChars + "\]";	 
	var quotedUser="(\"[^\"]*\")";	 
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;	 
	var atom=validChars + '+';	 
	var word="(" + atom + "|" + quotedUser + ")";	 
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$");	 
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");	
	/* check if the supplied address is valid. */   
	var matchArray=emailStr.match(emailPat);
	if (matchArray==null) { 
		alert("Email address seems incorrect (check @ and .'s)");	
		return false;	
	}
	var user=matchArray[1];
	var domain=matchArray[2];
	
	// See if "user" is valid 
	if (user.match(userPat)==null) {
		// user is not valid
		alert("The username doesn't seem to be valid.");
		return false;
	}
	
	/* if the e-mail address is at an IP address (as opposed to a symbolic
	   host name) make sure the IP address is valid. */
	var IPArray=domain.match(ipDomainPat);
	if (IPArray!=null) {
		// this is an IP address
		  for (var i=1;i<=4;i++) {
			if (IPArray[i]>255) {
				alert("Destination IP address is invalid!");
				return false;
			}
		}
		return true;
	}
	
	// Domain is symbolic name
	var domainArray=domain.match(domainPat)
	if (domainArray==null) {
		alert("The domain name doesn't seem to be valid.");
		return false;
	}	
	/* domain name seems valid, make sure that it ends in a
	   three-letter word (like com, edu, gov) or a two-letter word,
	   representing country (uk, nl), and that there's a hostname preceding 
	   the domain or country. */
	
	/* break up the domain to get a count of how many atoms
	   it consists of. */
	var atomPat=new RegExp(atom,"g");
	var domArr=domain.match(atomPat);
	var len=domArr.length;
	if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>3) {
	   // the address must end in a two letter or three letter word.
	   alert("The address must end in a three-letter domain, or two letter country.");
	   return false;
	}
	
	// Make sure there's a host name preceding the domain.
	if (len<2) {
	   var errStr="This address is missing a hostname!";
	   alert(errStr);
	   return false;
	}
	//  everything's valid.
	return true;
}

function myFunction(arg1, arg2) {
	if (typeof arg2 == 'undefined' ) arg2 = 'default';
}

  // this function is needed to work around 
  // a bug in IE related to element attributes
  function hasClass(obj) {
     var result = false;
     if (obj.getAttributeNode("class") != null) {
         result = obj.getAttributeNode("class").value;
     }
     return result;
  }   


/* hacked version of David F. Miller's "Zebra Tables" 
   (http://www.alistapart.com/d/stripedtables)
   to support alternating row or column coloring. */

function autoStripeTestTable(myTable, aClass) {
	return (myTable.className && myTable.className.match(new RegExp("\\b"+aClass+"\\b"))) ? true : false;
}

function autoStripe() {
	var evenColor = arguments[1] ? arguments[1] : default_even_color;
	var oddColor = arguments[2] ? arguments[2] : default_odd_color;
	var vertical = arguments[3] ? 1 : 0;
	var tables = document.body.getElementsByTagName("table");
	for (var t = 0; t < tables.length; t++) {
		if (autoStripeTestTable(tables[t], "striped")) {
			stripe(tables[t], evenColor, oddColor, vertical);
		}
		if (autoStripeTestTable(tables[t], "pinstriped")) {
			stripe(tables[t], evenColor, oddColor, vertical);
		}
	}
}

function stripe(table) {
	// the flag we'll use to keep track of 
	// whether the current row is odd or even
	var even = false;

	// if arguments are provided to specify the colours
	// of the even & odd rows, then use the them;
	// otherwise use the following defaults:
	var evenColor = arguments[1] ? arguments[1] : default_even_color;
	var oddColor = arguments[2] ? arguments[2] : default_odd_color;
	
	// See if we want column alternation instead of row, 
	// any reasonable value passed as the fourth argument
	// should trigger vertical mode.
	var vertical = arguments[3] ? 1 : 0;

	// if no such table exists, abort
	if (! table) { return; }
	
	// by definition, tables can have more than one tbody
	// element, so we'll have to get the list of child
	// tbody's 
	var tbodies = table.getElementsByTagName("tbody");
	var tds = new Array;
	// and iterate through them...
	for (var h = 0; h < tbodies.length; h++) {
	
	 // find all the tr elements... 
		var trs = tbodies[h].getElementsByTagName("tr");
		
		// ... and iterate through them
		for (var i = 0; i < trs.length; i++) {

			// avoid rows that have a class attribute
			// or backgroundColor style
			if (! hasClass(trs[i]) && ! trs[i].style.backgroundColor) {
		
				// get all the cells (td or th) in this row...
				var tds = trs[i].getElementsByTagName("td");
// 				var elements = trs[i].getElementsByTagName("*");
// 				for (var k = 0; k < elements.length; k++) {
// 					if ((elements[k].tagName == "TD") || (elements[k].tagName == "TH")) {
// 						tds.push(elements[k]);
// 					}
// 				}
				
				// and iterate through them...
				for (var j = 0; j < tds.length; j++) {
					var mytd = tds[j];

					// avoid cells that have a class attribute
					// or backgroundColor style
					if (! hasClass(mytd) && ! mytd.style.backgroundColor) {
						mytd.style.backgroundColor = even ? evenColor : oddColor;
					}
				}
			}
			// if in row striping mode (default),
			// flip from odd to even, or vice-versa
			if (! vertical) even = ! even;
		}
		// if in column striping mode,
		// flip from odd to even, or vice-versa
		if (vertical) even = ! even;
	}
}


function validateTicketOrder(theForm)
{

  if (theForm.NAME.value == "")
  {
    alert("Please enter a value for the \"Name\" field.");
    theForm.NAME.focus();
    return (false);
  }

  if (theForm.NAME.value.length < 4)
  {
    alert("Please enter at least 4 characters in the \"Name\" field.");
    theForm.NAME.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ.,- \t\r\n\f";
  var checkStr = theForm.NAME.value;
  var allValid = true;
  var validGroups = 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, whitespace and \".,-\" characters in the \"Name\" field.");
    theForm.Contact_Name.focus();
    return (false);
  }

  if (theForm.ADDRESS.value == "")
  {
    alert("Please enter a value for the \"Street Address\" field.");
    theForm.ADDRESS.focus();
    return (false);
  }

  if (theForm.ADDRESS.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"Street Address\" field.");
    theForm.ADDRESS.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-.,# \t\r\n\f";
  var checkStr = theForm.ADDRESS.value;
  var allValid = true;
  var validGroups = 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 \"Street Address\" field.");
    theForm.ADDRESS.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 < 2)
  {
    alert("Please enter at least 2 characters in the \"City\" field.");
    theForm.CITY.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ \t\r\n\f";
  var checkStr = theForm.CITY.value;
  var allValid = true;
  var validGroups = 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 \"City\" field.");
    theForm.CITY.focus();
    return (false);
  }

  if (theForm.STATE.value == "")
  {
    alert("Please enter a value for the \"State/Province\" field.");
    theForm.STATE.focus();
    return (false);
  }

  if (theForm.STATE.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"State/Province\" field.");
    theForm.STATE.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ. \t\r\n\f";
  var checkStr = theForm.STATE.value;
  var allValid = true;
  var validGroups = 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, whitespace and \".\" characters in the \"State/Province\" field.");
    theForm.STATE.focus();
    return (false);
  }

  if (theForm.ZIP.value == "")
  {
    alert("Please enter a value for the \"Zip/Postal code\" field.");
    theForm.ZIP.focus();
    return (false);
  }

  if (theForm.ZIP.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"Zip/Postal code\" field.");
    theForm.ZIP.focus();
    return (false);
  }

  if (theForm.ZIP.value.length > 12)
  {
    alert("Please enter at most 12 characters in the \"Zip/Postal code\" field.");
    theForm.ZIP.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.ZIP.value;
  var allValid = true;
  var validGroups = 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 digit characters in the \"Zip/Postal code\" field.");
    theForm.ZIP.focus();
    return (false);
  }

  if (theForm.PHONE.value == "")
  {
    alert("Please enter a value for the \"Home Phone\" field.");
    theForm.PHONE.focus();
    return (false);
  }

  if (theForm.PHONE.value.length < 7)
  {
    alert("Please enter at least 7 characters in the \"Home Phone\" field.");
    theForm.PHONE.focus();
    return (false);
  }

  if (theForm.PHONE.value.length > 25)
  {
    alert("Please enter at most 25 characters in the \"Home Phone\" field.");
    theForm.PHONE.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-.,- \t\r\n\f";
  var checkStr = theForm.PHONE.value;
  var allValid = true;
  var validGroups = 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 \"Home Phone\" field.");
    theForm.PHONE.focus();
    return (false);
  }

  if (theForm.EMAIL.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"E-mail\" field.");
    theForm.EMAIL.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-@, .-_ \t\r\n\f";
  var checkStr = theForm.EMAIL.value;
  var allValid = true;
  var validGroups = 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.");
    theForm.EMAIL.focus();
    return (false);
  }

/*   if (theForm.Ordering_CardHolderName.value.length < 1) */
/*   { */
/*     alert("Please enter at least 1 characters in the \"Ordering_CardHolderName\" field."); */
/*     theForm.Ordering_CardHolderName.focus(); */
/*     return (false); */
/*   } */

/*   var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-.,- \t\r\n\f"; */
/*   var checkStr = theForm.Ordering_CardHolderName.value; */
/*   var allValid = true; */
/*   var validGroups = 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 \"Ordering_CardHolderName\" field."); */
/*     theForm.Ordering_CardHolderName.focus(); */
/*     return (false); */
/*   } */
/*  */
/*   if (theForm.Ordering_CardNumber.value.length < 12) */
/*   { */
/*     alert("Please enter at least 12 characters in the \"Ordering_CardNumber\" field."); */
/*     theForm.Ordering_CardNumber.focus(); */
/*     return (false); */
/*   } */

/*   var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-., - \t\r\n\f"; */
/*   var checkStr = theForm.Ordering_CardNumber.value; */
/*   var allValid = true; */
/*   var validGroups = 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 \"Ordering_CardNumber\" field."); */
/*     theForm.Ordering_CardNumber.focus(); */
/*     return (false); */
/*   } */
/*  */
/*   if (theForm.Ordering_CardExpiration.value == "") */
/*   { */
/*     alert("Please enter a value for the \"Ordering_CardExpiration\" field."); */
/*     theForm.Ordering_CardExpiration.focus(); */
/*     return (false); */
/*   } */
/*  */
/*   if (theForm.Ordering_CardExpiration.value.length < 4) */
/*   { */
/*     alert("Please enter at least 4 characters in the \"Ordering_CardExpiration\" field."); */
/*     theForm.Ordering_CardExpiration.focus(); */
/*     return (false); */
/*   } */
/*  */
/*   if (theForm.Ordering_CardExpiration.value.length > 6) */
/*   { */
/*     alert("Please enter at most 6 characters in the \"Ordering_CardExpiration\" field."); */
/*     theForm.Ordering_CardExpiration.focus(); */
/*     return (false); */
/*   } */

  /* var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-/,-\\ \t\r\n\f"; */
/*   var checkStr = theForm.Ordering_CardExpiration.value; */
/*   var allValid = true; */
/*   var validGroups = 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 \"Ordering_CardExpiration\" field."); */
/*     theForm.Ordering_CardExpiration.focus(); */
/*     return (false); */
/*   } */
  var temp_month = theForm.EXPMONTH.value;
  theForm.EXPDATE.value = temp_month + "/" + theForm.EXPYEAR.value;
  return (true);
}

var monthsAry = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sept','Oct','Nov','Dec'];

function cc_expiration_fields(month, year) {
	var today=new Date();
	var selected_month = document.getElementById(month);
	var selected_year = document.getElementById(year);
	for (var month_cnt = 0; month_cnt < 12; month_cnt++) {
		if (month_cnt <= 9) {
			month_num_txt = "0" + (month_cnt + 1).toString();
		} else {
			month_num_txt = (month_cnt + 1).toString();
		}
			selected_month.options[month_cnt]=new Option(monthsAry[month_cnt], month_num_txt);
	}
	var this_month_txt = "0" + (today.getMonth()+1).toString();
	selected_month.options[today.getMonth()]=new Option(monthsAry[today.getMonth()], this_month_txt, true, true);
	var curr_year = today.getFullYear();
	for (var year_cnt = 0; year_cnt < 10; year_cnt++) {
			selected_year.options[year_cnt]=new Option(curr_year, curr_year);
			curr_year++;
	}
	selected_year.options[0]=new Option(today.getFullYear(), today.getFullYear(), true, true);
}

function submitDonation() {
	var cc_amount_chosen = false;
	if (
		document.Form1.cc_amount[0].checked 
		|| document.Form1.cc_amount[1].checked 
		|| document.Form1.cc_amount[2].checked 
		|| document.Form1.cc_amount[3].checked
		|| document.Form1.cc_amount[4].checked
		|| document.Form1.cc_amount[5].checked
		|| document.Form1.cc_amount[6].checked
		)
	{ cc_amount_chosen = true; }
	
	if ( 
		( cc_amount_chosen )
		&&
		(document.Form1.first_name.value!='')
		&&
		(document.Form1.last_name.value!='')
		&&
		(document.Form1.address1.value!='')
		&&
		(document.Form1.city.value!='')
		&&
		(document.Form1.state.value!='')
		&&
		(document.Form1.zip.value!='')
		&&
		(document.Form1.email.value!='')
		&&
		(document.Form1.cc_num.value!='')
		&&
		(document.Form1.cc_month.options[document.Form1.cc_month.selectedIndex].value!='')
		&&
		(document.Form1.cc_year.options[document.Form1.cc_year.selectedIndex].value!='')
		&&
		(document.Form1.cc_first_name.value!='')
		&&
		(document.Form1.cc_last_name.value!='')
		&&
		(document.Form1.cc_address.value!='')
		&&
		(document.Form1.cc_city.value!='')
		&&
		(document.Form1.cc_state.value!='')
		&&
		(document.Form1.cc_zip.value!='')
	) {
		document.Form1.action='/forms/donate.jsp';
		document.Form1.submit();
	} else {
		alert('You have not filled out all of the required (*) fields.');
	}
}

function insertQuicktime() {	
	var default_args = {
		'qtfilename' : "http://vrcincinnati.com/cincy/carewhi.mov",
		'width' : "320",
		'height' : "240",
		'autoplay' : false,
		'controller' : true,
		'cache' : true
	}
	
	var options = arguments[0];
	for(var index in default_args) {
		if(typeof options[index] == "undefined") options[index] = default_args[index];
	}
	
	if (options['controller'] == true) {
		options['height'] = parseInt(options['height']) + 16;
	}
	
/* 	var temp = ""; */
/* 	for (x in options) { */
/* 		temp = temp + (x + " = " + options[x] + "\r\n"); */
/* 	} */
/* 	alert (temp); */
	
	document.write('<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="' + options['width'] +'" height="'+ options[
'height'] + '" codebase="http://www.apple.com/qtactivex/qtplugin.cab">\n');
	document.write('<param name="src" value="' + options['qtfilename'] + '" />\n');
	document.write('<param name="autoplay" value="' + options['autoplay'] + '" />\n');
	document.write('<param name="controller" value="' + options['controller'] + '" />\n');
	document.write('<embed src="' + options['qtfilename'] + '" width="' + options['width'] + '" HEIGHT="' + options['height'] + '" autoplay="' + options['autoplay'] + '" controller="' + options['controller'] + '" pluginspage="http://www.apple.com/quicktime/download/" cache="' + options['cache'] + '">\n');
	document.write('</embed></object>\n');
}


/**
* Function : dump()
* Arguments: The data - array,hash(associative array),object
*    The level - OPTIONAL
* Returns  : The textual representation of the array.
* This function was inspired by the print_r function of PHP.
* This will accept some data as the argument and return a
* text that will be a more readable version of the
* array/hash/object that is given.
*/
function dump(arr,level) {
var dumped_text = "";
if(!level) level = 0;

//The padding given at the beginning of the line.
var level_padding = "";
for(var j=0;j<level+1;j++) level_padding += "    ";

if(typeof(arr) == 'object') { //Array/Hashes/Objects
 for(var item in arr) {
  var value = arr[item];
 
  if(typeof(value) == 'object') { //If it is an array,
   dumped_text += level_padding + "'" + item + "' ...\n";
   dumped_text += dump(value,level+1);
  } else {
   dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\n";
  }
 }
} else { //Stings/Chars/Numbers etc.
 dumped_text = "===>"+arr+"<===("+typeof(arr)+")";
}
return dumped_text;
} 