<!--//--><![CDATA[//><!--
//initializeMenu = function() {
//	var sfEls = document.getElementById("menusystem").getElementsByTagName("LI");
//	for (var i=0; i<sfEls.length; i++) {
//		sfEls[i].onmouseover=function() {
//			this.className+=" hover";
//		}
//		sfEls[i].onmouseout=function() {
//			this.className=this.className.replace(new RegExp(" hover\\b"), "");
//		}
//	}
//}
//if (window.attachEvent) window.attachEvent("onload", initializeMenu);
//--><!]]>

// Use this to load the menu (properly) in IE7
function loadMenu()
{
   if (document.all && document.getElementById) {
	    var count = 1;
        while(document.getElementById("navsystem"+count)) {
            navRoot = document.getElementById("navsystem"+count);
            listhelper(navRoot);
            count = count + 1;
        }
    }
}
function listhelper(navRoot) {
	for (i=0; i < navRoot.childNodes.length; i++) {
		node = navRoot.childNodes[i];
		if (node.nodeName=="LI") {
			node.onmouseover=function() {
				this.className+=" over";
			}
			node.onmouseout=function() {
				this.className=this.className.replace(" over", "");
            }
        }
    }
}

// Older pages use this to automate the menu loader - won'twork with newer calculator.
startList = function() {
	if (document.all && document.getElementById) {
	    var count = 1;
        while(document.getElementById("navsystem"+count)) {
            navRoot = document.getElementById("navsystem"+count);
            listhelper(navRoot);
            count = count + 1;
        }
    }
}
window.onload=startList;

//function to pop up an embedded player window
// use this syntax on the calling page:
//<a href="http://www.streamguys.com/player_i.html" onClick="return player(this, 'temp');">Click Here</a>
function player(myUrl, name) 
{
	var mywin = window.open(myUrl.href, name, 'width=350,height=383');
	mywin.focus();
	return false;
}

function popup(myUrl, name) 
{
	var mywin = window.open(myUrl.href, name, 'width=660,height=510');
	mywin.focus();
	return false;
}

function popup_l(myUrl, name) 
{
	var mywin = window.open(myUrl.href, name, 'width=352,height=324');
	mywin.focus();
	return false;
}

function popup_m(myUrl, name) 
{
	var mywin = window.open(myUrl.href, name, 'width=320,height=140');
	mywin.focus();
	return false;
}

function popup_s(myUrl, name) 
{
	var mywin = window.open(myUrl.href, name, 'width=320,height=93');
	mywin.focus();
	return false;
}

<!-- This displays the current date -->
<!-- ONLY use with the "no announcements" announcement -->
<!-- otherwise, comment out and put the date of the announcement -->
	<!-- Begin
	var months=new Array(13);
	months[1]="January";
	months[2]="February";
	months[3]="March";
	months[4]="April";
	months[5]="May";
	months[6]="June";
	months[7]="July";
	months[8]="August";
	months[9]="September";
	months[10]="October";
	months[11]="November";
	months[12]="December";
	var time=new Date();
	var lmonth=months[time.getMonth() + 1];
	var date=time.getDate();
	var year=time.getYear();
	if (year < 2000)    // Y2K Fix, Isaac Powell
	year = year + 1900; // http://onyx.idbsu.edu/~ipowell
// End -->
					  						

<!-- the following javascript code controls
	// behavior for the testimonial banner
	// this is where all the testimonals are set
	var testimonials = new Array();
   testimonials[0] = "<img src=\"images/main_ads/iphone_banner_02.png\" width=\"447\" height=\"125\" border=\"0\">";
   testimonials[1] = "<a href=\"http://www.streamguys.com/reflector/barix_reflector.html\" target=\"_blank\"><img src=\"images/barix_logo_reflector-animated.gif\" width=\"447\" height=\"125\" border=\"0\"></a>";
   testimonials[2] = "<a href=\"http://www.niftytv.com/af2\" target=\"_blank\"><img src=\"images/main_ads/sg_aftv_banner.jpg\" width=\"447\" height=\"125\" border=\"0\"></a>"; 
   testimonials[3] = "<table width=\"100%\" height=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr height=\"80%\">" +
					  "<td><span class=\"bannerText\"><h3>Para obtener asistencia o comprar servicios de StreamGuys.</h3></span></td> "+
					  "<th rowspan=2><div align=\"right\"><img src=\"images/earth_100px.jpg\" width=\"100\" height=\"100\" border=\"0\"></div></th></tr>" +
					  "<tr height=\"20%\">" +
					  "<td align=\"center\"><a href=\"http://www.streamguys.com.mx/\">Haga Click Aqui</a></td>" +
					  "</tr></table>";
	testimonials[4] = "<table width=\"100%\" height=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr height=\"80%\">" +
					  "<td><span class=\"bannerText\"><h3>TEDTalks, an iTunes Staff Favorite podcast, is hosted by StreamGuys.</h3></span></td> "+
					  "<th rowspan=2><div align=\"right\"><img src=\"images/ted_logo_100px.jpg\" width=\"100\" height=\"100\" border=\"0\"></div></th></tr>" +
					  "<tr height=\"20%\">" +
					  "<td align=\"center\"><a href=\"http://www.ted.com/tedtalks/\" target=\"_blank\">TED homepage...</a></td>" +
					  "</tr></table>";
	testimonials[5] = "<table width=\"100%\" height=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr height=\"80%\">" +
					  "<td><span class=\"bannerText\"><h3>StreamGuys helps Cisco CEO broadcast into Second Life.</h3></span></td> "+
					  "<th rowspan=2><div align=\"right\"><img src=\"images/cisco.jpg\" width=\"200\" height=\"100\" border=\"0\"></div></th></tr>" +
					  "<tr height=\"20%\">" +
					  "<td align=\"center\"><a href=\"http://www.streamguys.com/streamingservices/livestreaming.html\" target=\"_blank\">Live Streaming...</a></td>" +
					  "</tr></table>";
   testimonials[6] = "<a href=\"http://www.followyourfolly.com/index.html\" target=\"_blank\"><img src=\"images/main_ads/nbb_447x125.jpg\" width=\"447\" height=\"125\" border=\"0\"></a>";
   testimonials[7] = "<img src=\"images/main_ads/live_stream_banner_02.png\" width=\"447\" height=\"125\" border=\"0\">";

   

	// add more testimonials by using this format
	//    testimonials[increment this value] = "new testimonial";
	
	// start with a random testimonial
	var testimonial =  Math.floor(Math.random()*testimonials.length);
	var hexvalue = 255; // Initial color value.  Dont change this value unless you know whats what
	var displaytime = 4000 // change this value to change the display time of each testimonial
							   // displaytime value should be much greater than fadetime
	var fadetime = 50 // change this value to change the speed of the fade in/out
	
	fadeintimeout = null;
	startfadeouttimeout = null;
	fadeouttimeout = null;
	
	function start() {
		// this starts the banner
		// the number here determins how long each
		// testimonial is displayed.  2000 = 2 seconds
		//document.getElementById("banner").innerHTML = testimonials[testimonial];
		hex = hexvalue; // REALLY REALLY make sure hex is 255
		
		if (document.layers) { // Netscape 4
			bannerpos = document.bannerlayer;
			banner = bannerpos.document.banner;
			banner.document.write(testimonials[testimonial]);
			banner.document.close();
		} else if (document.all) { // IE
			banner.innerHTML = testimonials[testimonial];
		} else if (document.getElementById) { // Netscape 6
			document.getElementById("banner").innerHTML = testimonials[testimonial];
		}	
		
		testimonial++;
		if (testimonial == testimonials.length) {
			testimonial = 0;
		}
		
		textfade();	
	}
	function textfade() {
		// This function fades the text in
		if (hex > 0) { //If color is not black yet
			hex-=11; // increase color darkness
			if (document.layers) {
				document.banner.color="rgb("+hex+","+hex+","+hex+")";
			} else if (document.all) {
				banner.style.color="rgb("+hex+","+hex+","+hex+")";
			} else if (!document.all && document.getElementById) {
				document.getElementById("banner").style.color="rgb("+hex+","+hex+","+hex+")";
			}
			fadeintimeout = setTimeout("textfade()", fadetime);
		} else {
			hex = 0; //make sure it is set to zero for fade out
			startfadeouttimeout = setTimeout("textfadeout()", displaytime);
		}
	}
	
	
	function textfadeout() {
		// This function fades the text out 
		if (hex < 255 ) {
			hex+=11;
			if (document.layers) {
				document.banner.color="rgb("+hex+","+hex+","+hex+")";
			} else if (document.all) {
				banner.style.color="rgb("+hex+","+hex+","+hex+")";
			} else if (!document.all && document.getElementById) {
				document.getElementById("banner").style.color="rgb("+hex+","+hex+","+hex+")";
			}
			fadeouttimeout = setTimeout("textfadeout()", fadetime);
		} else {
			 hex = 255; //reset hex value
			 start();
		}
	}
	
	function next() {
		// this function controls the onclick behavior
		// if you click on the banner, clear all the timeouts
		// and then go back to start
		clearTimeout(fadeintimeout);
		clearTimeout(startfadeouttimeout);
		clearTimeout(fadeouttimeout);
	
		start();
	}
// end code for testimonial banner-->

function validateContactForm(formobj){
	// Enter name of mandatory fields
	var fieldRequired = Array("first_name", "last_name", "phone_number", "email_address", "organization");
	// Enter field description to appear in the dialog box
	var fieldDescription = Array("First Name", "Last Name", "Phone Number", "Email Address", "Company");
	// dialog message
	var alertMsg = "Please complete the following fields:\n";
	
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
			}
			if (obj.type == undefined){
				var blnchecked = false;
				for (var j = 0; j < obj.length; j++){
					if (obj[j].checked){
						blnchecked = true;
					}
				}
				if (!blnchecked){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
			}
		}
	}

	if (alertMsg.length == l_Msg){
		return true;
	}else{
		alert(alertMsg);
		return false;
	}
}

