// Browser Detection //



    var agt = navigator.userAgent.toLowerCase();



	var is_major = parseInt(navigator.appVersion);

	var is_minor = parseFloat(navigator.appVersion);

	

	// Browser Family -------- CSS File You Need To Edit

	

	// Internet Explorer ----- ie.css

	var is_ie    = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));

	

	// Mozilla Family -------- main.css

	var is_moz   = ((agt.indexOf("gecko") != -1) && (agt.indexOf("khtml") == -1));

	

	// Safari, Konqueror ----- khtml.css

	var is_khtml = (agt.indexOf("KHTML") != -1);

	

	// Opera Family ---------- opera.css

	var is_opera = (agt.indexOf("opera") != -1);



// end Browser Detection





	// Second Nav Items generated by XML template



// -- initializes the page behaviors

//  - Auto-selects second nav



function select_nav() {



	var nav_links = document.getElementById('main-nav').getElementsByTagName('a');

	// change this var to be only the keyword (e.g. http://www.l10-dev.com/engineering.html becomes engineering)

	// also change deeper links: http://www.l10-dev.com/engineering/Prototyping.html = engineering

	var selected = location.pathname;



	// for each nav link, check and see if the url contains the section which think link points to

	// if it does point to the section we're in, show its subnav in the bar - rollOver()

	for (var i = 0; i < nav_links.length; i++) {

		var link = nav_links[i].pathname;

		if (link.substring(0, 1) != '/') link = '/' + link; // fiddle IE's view of the link

		if (link == selected) {

			var section = link.substring(1,(link.length - 5));

			rollOver(section);

		}

	}

}



// -- Main Nav rollovers

// When you mouseover the main navigation items, their internal 

// sections appear in the second row



function rollOver(section) {

	

	document.getElementById("n-"+section).src = "images/n_" + section + "_o.gif";

	secondNav(section);

	

}







function resetSegments() {

	document.successForm.segmentid.selectedIndex = 0;

}



function truncate(string, length, mode) {

	

	var output = '';

	var array = new Array();

	

	if (mode == 'words') {

		array = string.split(" ");

		for (i = 0; i <= length; i++) {

			output += array[i] + " ";

		}

	} else {

		output = string.substring(0,length);

	}



	return output;

}



function prettyDate(datestring,format) {

	var output = '';

	

	if (format == 'mmddyyyy') {

		var theDate = datestring.split(" ");

		var pieces = theDate[0].split("-");

		output = pieces[1] + "\/" + pieces[2] + "\/" + pieces[0];

	}

	

	return output;

}





function popUp(url) {

	var popUp = window.open(url+'?refer=http://www.realworldtraining.com'+location.pathname,'emailWindow','width=420,height=400,location=no,menubar=no,scrollbars=no');

	return false;

}



function printPage() {

	window.print();

	return false;

}



function showInfoTab(activeTab) {

	

	// get tabs and info boxes

	var theInfo = $('product-info-tabs').getElementsByTagName('div');

	var theTabs = $('info-tabs').getElementsByTagName('li');

	

	// hide all

	for(var i = 0; i <= theInfo.length - 1; i++) {

		theInfo[i].style.display = 'none';

		theTabs[i].style.borderBottom = "1px solid #333333";

	}



	// set active

	theInfo[activeTab].style.display = 'block';

	theTabs[activeTab].style.borderBottom = '1px solid #ffffff';

}


function showInfoTab2(activeTab) {

	

	// get tabs and info boxes

	var theInfo = $('product-info-tabs2').getElementsByTagName('div');

	var theTabs = $('info-tabs2').getElementsByTagName('li');

	

	// hide all

	for(var i = 0; i <= theInfo.length - 1; i++) {

		theInfo[i].style.display = 'none';
		theTabs[i].style.backgroundImage = 'url(../images/certify_tab_back_off.gif)';
		theTabs[i].style.height = '19px';
		theTabs[i].style.marginTop = '7px';
		theTabs[i].style.color = '#000000';
	theTabs[i].style.borderBottom = '1px solid #365ebf';

	}



	// set active

	theInfo[activeTab].style.display = 'block'; 
	theTabs[activeTab].style.backgroundImage = 'url(../images/certify_tab_back_on.gif)';
	theTabs[activeTab].style.height = '22px';
	theTabs[activeTab].style.marginTop = '4px';
	theTabs[activeTab].style.color = '#ffffff';
    theTabs[activeTab].style.borderBottom = '1px solid #365ebf';

}




function validateCCForm() {

	

	return true;

	

}



// opens a window with a Flash demo in it

function demoWindow(swfURL) {



	 window.open ("http://www.realworldtraining.com/demos/"+swfURL,"demoWindow","status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=1,scrollbars=0,width=640,height=516");

	 

	 return false;



}



function emailFriend(url){

	

	var popUp = window.open(url+'?refer='+L10_SITE_URL+''+location.pathname.substr(1, location.pathname.length-1),'emailWindow','width=420,height=400,location=no,menubar=no,scrollbars=no');

	

	return false;

}





function checkSafari() {

	

	alert(is_khtml);

	if (is_khtml) { document.write('<link rel="stylesheet" href="/includes/khtml.css" type="text/css" />'); }

	

}





// moved HC tracking code here because it can't exist in an XSLT template

function L10Analytics() {

	

	var L10success = 0; L10sections=""; L10points=""; L10cRef=""; L10cRefType=""; L10cPage="";

	var L10qstr,L10pc,L10ref,L10a,L10pg; L10pg = document.URL.toString(); L10ref = document.referrer;

	if(top.document.location==document.referrer || (document.referrer == "" && top.document.location != "")) {L10ref=top.document.referrer;}

	L10qStr = "pg="+escape(L10pg)+"&ref="+escape(L10ref)+"&os="+escape(navigator.userAgent)+"&nn="+escape(navigator.appName)+"&nv="+escape(navigator.appVersion)+"&nl="+escape(navigator.language)+"&sl="+escape(navigator.systemLanguage)+"&sa="+L10success+"&sec="+L10sections+"&pts="+L10points+"&cR="+escape(L10cRef)+"&cRT="+escape(L10cRefType)+"&cPg="+escape(L10cPage);

	if(navigator.appVersion.substring(0,1) > "3") { L10d = new Date(); L10qStr = L10qStr+"&cd="+screen.colorDepth+"&sx="+screen.width+"&sy="+screen.height+"&tz="+L10d.getTimezoneOffset();}

	<!-- The L10 Hit Counter logo and links must not be removed or altered -->

	if((location.href.substr(0,6)=="https:") || (location.href.substr(0,6)=="HTTPS:")) { L10pc="https"; } else { L10pc="http"; }

	var trackingCode = '<a href="'+L10_SITE_URL+'L10Apps/L10HC/L10HC_Reporter.html" target="_blank"><img src="'+ L10pc +'://www.realworldtraining.com/L10Apps/L10HC/L10HC_Counter.php?'+ L10qStr +'" alt="LevelTen Hit Counter 4.0" style="width: 68px; height: 32px; " \/><\/a>';

		

	return trackingCode

	

}

function changeForm(theForm){
	
	if(theForm.seminarType.value == "C"){
		theForm.action = "find-seminars-results-construction.php";	
	}else{
		theForm.action = "find-seminars-results-mastering.php";
	}
	
}

function selectURL(select){
	if(select.selectedIndex != -1){
		if(select.options[select.selectedIndex].value != ""){
			window.location = select.options[select.selectedIndex].value;
		}
	}
}
