// JavaScript Document
function showtab(id){
	var wrapper = document.getElementById("tab_contents_wrapper");
	var divs = wrapper.getElementsByTagName("DIV")
	//var divs = document.tab_contents_wrapper.getElementsByTagName("DIV")
	for ( i = 0; i < divs.length; i++ ) { if ( divs[i].className == 'tab_content' ) { divs[i].style.display = 'none'; } }
	document.getElementById(id).style.display = 'block';
	}

function showhide(wrapper, show_div) {
	wrapper_div = document.getElementById(wrapper)
	divs = document.wrapper_div.getElementsByTagName("DIV")
	for ( i = 0; i < divs.length; i++ ) { divs[i].style.display = 'none';  }
	document.getElementById(show_div).style.display = 'block';	
	}

function showhideDIV(divID) {
	div = document.getElementById(divID); 
	div.style.display = (div.style.display == 'block') ? 'none' : 'block';
	} 
	
function check_product_freetrial_form(frm) {
	if ( frm.name.value == '' ) { alert("Please provide your name."); return false; }
	if ( frm.company.value == '' ) { alert("Please provide your company name."); return false; }
	if ( frm.position.value == '' ) { alert("Please provide your company position or title."); return false; }
	if ( frm.email.value == '' ) { alert("Please provide your email address.  A message with a link to download the free trial will be sent to the email address you provide."); return false; }
	if ( echeck(frm.email.value) == false ){ frm.email.value=""; frm.email.focus(); return false }
	if ( frm.phone.value == '' ) { alert("Please provide your phone number."); return false; }
	return true;
	}
	
/**
 * DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */
function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail address")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail address")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail address")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail address")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail address")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail address")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail address")
		    return false
		 }

 		 return true					
	}




function noSpam(user,domain) {
	locationstring = "mailto:" + user + "@" + domain;
	window.location = locationstring;
	}
 