var strDomain;
strDomain = '';

if (IsHttps()) {
	strDomain = 'http://qbstrainingonline.com';
} else {
	strDomain = '';
}

if (document.images) {
	
	// Top Menu Tabs
	tab_courses_off = new Image();
	tab_courses_off.src = '/qbs/images/bannernav-courses.jpg';
	tab_courses_on = new Image();
	tab_courses_on.src = '/qbs/images/bannernav-courses_lit.jpg';

	tab_powertools_off = new Image();
	tab_powertools_off.src = '/qbs/images/bannernav-powertools.jpg';
	tab_powertools_on = new Image();
	tab_powertools_on.src = '/qbs/images/bannernav-powertools_lit.jpg';
	
	tab_bookmark_off = new Image();
	tab_bookmark_off.src = '/qbs/images/bannernav-bookmark.jpg';
	tab_bookmark_on = new Image();
	tab_bookmark_on.src = '/qbs/images/bannernav-bookmark_lit.jpg';
	
	tab_myinfo_off = new Image();
	tab_myinfo_off.src = '/qbs/images/bannernav-myinfo.jpg';
	tab_myinfo_on = new Image();
	tab_myinfo_on.src = '/qbs/images/bannernav-myinfo_lit.jpg';
	
	/*
	tab_help_off = new Image();
	tab_help_off.src = '/qbs/images/bannernav-help.jpg';
	tab_help_on = new Image();
	tab_help_on.src = '/qbs/images/bannernav-help_lit.jpg';
	*/
		
	// Page Nav Buttons
	nav_continue_off = new Image();
	nav_continue_off.src = '/qbs/images/nav_continue.gif';
	nav_continue_on = new Image();
	nav_continue_on.src = '/qbs/images/nav_continue_lit.gif';
	
	nav_backward_off = new Image();
	nav_backward_off.src = '/qbs/images/nav_backward.gif';
	nav_backward_on = new Image();
	nav_backward_on.src = '/qbs/images/nav_backward_lit.gif';
	
	nav_forward_off = new Image();
	nav_forward_off.src = '/qbs/images/nav_forward.gif';
	nav_forward_on = new Image();
	nav_forward_on.src = '/qbs/images/nav_forward_lit.gif';
	
	nav_backward5_off = new Image();
	nav_backward5_off.src = '/qbs/images/nav_backward5.gif';
	nav_backward5_on = new Image();
	nav_backward5_on.src = '/qbs/images/nav_backward5_lit.gif';
	
	nav_forward5_off = new Image();
	nav_forward5_off.src = '/qbs/images/nav_forward5.gif';
	nav_forward5_on = new Image();
	nav_forward5_on.src = '/qbs/images/nav_forward5_lit.gif';
		
	nav_backwardb_off = new Image();
	nav_backwardb_off.src = '/qbs/images/nav_backward.gif';
	nav_backwardb_on = new Image();
	nav_backwardb_on.src = '/qbs/images/nav_backward_lit.gif';
	
	nav_forwardb_off = new Image();
	nav_forwardb_off.src = '/qbs/images/nav_forward.gif';
	nav_forwardb_on = new Image();
	nav_forwardb_on.src = '/qbs/images/nav_forward_lit.gif';
	
	nav_backward5b_off = new Image();
	nav_backward5b_off.src = '/qbs/images/nav_backward5.gif';
	nav_backward5b_on = new Image();
	nav_backward5b_on.src = '/qbs/images/nav_backward5_lit.gif';
	
	nav_forward5b_off = new Image();
	nav_forward5b_off.src = '/qbs/images/nav_forward5.gif';
	nav_forward5b_on = new Image();
	nav_forward5b_on.src = '/qbs/images/nav_forward5_lit.gif';
	
	//Buttons
	bttn_continue_off = new Image();
 	bttn_continue_off.src = "/qbs/images/buttons/bttn_continue.gif";	
 	bttn_continue_on = new Image();
 	bttn_continue_on.src = "/qbs/images/buttons/bttn_continue_lit.gif";	
		
		
	bttn_addfield_off = new Image();
 	bttn_addfield_off.src = "/qbs/images/buttons/bttn_addfield.gif";
 	bttn_addfield_on = new Image();
 	bttn_addfield_on.src = "/qbs/images/buttons/bttn_addfield_lit.gif";
	
	// Course Module Tab Tops	
	cTabTop_off = new Image();
 	cTabTop_off.src = "/qbs/images/modules_tabs-top.gif";
 	cTabTop_on = new Image();
 	cTabTop_on.src = "/qbs/images/modules_tabs-top_lit.gif";
}

function ChangeImages() {
	if (document.images) {
		for (var i=0; i<ChangeImages.arguments.length; i+=2) {
			document[ChangeImages.arguments[i]].src = eval(ChangeImages.arguments[i+1] + ".src");
		}
	}
}


/******************************************************************************/


// DETERMINES BROWSER TYPE

// Show/Hide functions for non-pointer layer/objects
		
ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false
// ie5+ & n6+ = ??? = DOM
			
function Show(id) {
//alert(id);
	if (ns4) document.layers[id].visibility = "show"
	else if (ie4) document.all[id].style.visibility = "visible"
	else document.getElementById(id).style.visibility='visible'; // DOM
}

function Hide(id) {
	if (ns4) document.layers[id].visibility = "hide"
	else if (ie4) document.all[id].style.visibility = "hidden"
	else document.getElementById(id).style.visibility='hidden'; // DOM
}



	
	
	
/******************************************************************************/

function Init() {
	HideAll();
	document.frInfo.CategoryID.value = 6; //HARD CODED BECAUSE NO CATEGORIES (also set in the functions.asp file)
	
	switch(document.frInfo.SelectedTab.value) {
		case 'courses':
			tab_courses_off.src = '/qbs/images/bannernav-courses_lit.jpg';
			ChangeImages('tab_courses', 'tab_courses_on');
			Show('divCourses');
			break
			
		case 'powertools':
			tab_powertools_off.src = '/qbs/images/bannernav-powertools_lit.jpg';
			ChangeImages('tab_powertools', 'tab_powertools_on');
			Show('divPowertools');
			break
			
		case 'bookmark':
			tab_bookmark_off.src = '/qbs/images/bannernav-bookmark_lit.jpg';
			ChangeImages('tab_bookmark', 'tab_bookmark_on');
			Show('divBookmark');
			break
			
		case 'myinfo':
			tab_myinfo_off.src = '/qbs/images/bannernav-myinfo_lit.jpg';
			ChangeImages('tab_myinfo', 'tab_myinfo_on');
			Show('divMyInfo');
			break
		/*
		case 'help':
			tab_help_off.src = '/qbs/images/bannernav-help_lit.jpg';
			ChangeImages('tab_help', 'tab_help_on');
			Show('divHelp');
			break	
		*/		
	}
}


/******************************************************************************/



function IsQBS() {
	if (document.location.href.search(/qbstrainingonline.com/i) == -1) {
		return false;
	} else {
		return true;
	}
}

function IsHttps() {
	if (document.location.href.search(/https:/i) == -1) {
		return false;
	} else {
		return true;
	}
}

function SetProtocol(p) {
	if (IsQBS() == true) {
		return p +'://qbstrainingonline.com'; //''; //
	} else {
		return '';
	}
}




// Contact Button
function ContactButton() {
	document.frInfo.SelectedTab.value = '';
	NextPage('/qbs/contact/index.asp');
}


// Privacy Policy Button
function PrivacyButton() {
	document.frInfo.SelectedTab.value = '';
	NextPage('/qbs/privacy/policy.asp');
}


// Go Button
function GoButton(cid) {
	if (document.frInfo.Search.value != '')	{
		document.frInfo.target = '_self';
		document.frInfo.action = strDomain +'/qbs/search/results.asp';
		document.frInfo.CourseID.value = cid;
		document.frInfo.submit();
	} else {
		alert("Please enter in a term or phrase first.");
	}
}


/* 
===========================================
Tabs
===========================================
*/
function SelectTab(t) {
	document.frInfo.SelectedTab.value = t;
	Init();
}

function ResetTabs() {
	ChangeImages('tab_courses', 'tab_courses_off');
	ChangeImages('tab_powertools', 'tab_powertools_off');
	ChangeImages('tab_bookmark', 'tab_bookmark_off');
	ChangeImages('tab_myinfo', 'tab_myinfo_off');
	//ChangeImages('tab_help', 'tab_help_off');
}

/* 
----------------------------------
Nav Bar
----------------------------------
*/
// COURSES
function CourseNav(cid, tid, tdo, tr) {
	//quick hack for older code
	document.frInfo.TrackID.value=tid;
	document.frInfo.TrackDisplayOrder.value=tdo;
	document.frInfo.TestRequired.value=tr;
	
	document.frInfo.target = '_self';
	if (cid == 11) {
		document.frInfo.action = strDomain +'/qbs/syllabus.asp';
	}else{
		document.frInfo.action = strDomain +'/qbs/course.asp';
	}	
	document.frInfo.CourseID.value = cid;
	document.frInfo.submit();
}

// POWERTOOLS
function ActivitiesNav() {
	document.frInfo.target = '_self';
	document.frInfo.action = strDomain +'/qbs/powertools/activities/list.asp';
	document.frInfo.submit();
}

function SuccessNav() {
	document.frInfo.target = '_self';
	document.frInfo.action = strDomain +'/qbs/powertools/successes/view.asp';
	document.frInfo.submit();
}

function GoalsNav() {
	document.frInfo.target='_self';
	document.frInfo.action = strDomain +'/qbs/powertools/goals/view.asp';
	document.frInfo.submit();
}

function NotepadNav() {
	document.frInfo.target='_self';
	document.frInfo.action = strDomain +'/qbs/powertools/notepad/view.asp';
	document.frInfo.submit();
}

function ReviewNav() {
	document.frInfo.target = '_self';
	document.frInfo.action = strDomain +'/qbs/powertools/review/view.asp';	
	document.frInfo.submit();
}

function GlossaryNav(cid, pid) {
	if (cid == '') {
		alert('You need to start a course before you can view it\'s glossary.');
	} else {
		document.frInfo.target = '_self';
		document.frInfo.action = strDomain +'/qbs/powertools/glossary/view.asp';	
		document.frInfo.CourseID.value = cid;
		document.frInfo.PageID.value = pid;
		document.frInfo.submit();
	}
}

// BOOKMARKS
function ViewBookmarksNav() {
	document.frInfo.target = '_self';
	document.frInfo.action = strDomain +'/qbs/bookmarks/list.asp';
	document.frInfo.submit();
}

function BookmarkPageNav(cid, pid) {
	//if (cid == '') {
	//	alert('You need to start a course before you can bookmark.');
	//} else {
		document.frInfo.target = '_self';
		//document.frInfo.action = '/qbs/bookmarks/update.asp';
		document.frInfo.action = document.location.href;
		document.frInfo.CourseID.value = cid;
		document.frInfo.PageID.value = pid;
		document.frInfo.WhatToDo.value = 'SetBookmark';
		document.frInfo.submit();
	//}
}

//MY INFO
function TranscriptNav() {
	document.frInfo.target = '_self';
	document.frInfo.action = strDomain +'/qbs/myinfo/transcript/view.asp';
	document.frInfo.submit();
}


function RegistrationNav() {
	document.frInfo.action = SetProtocol('https') + '/qbs/myinfo/registration/update.asp';
	document.frInfo.target = '_self';
	document.frInfo.submit();
}
	

//HELP
function HelpNav() {
	document.frInfo.target = '_self';
	document.frInfo.action = strDomain +'/qbs/help/index.asp';
	document.frInfo.submit();
}


function HideAll() {
	
	if (document.frInfo.SelectedTab.value != 'courses') {
		Hide('divCourses');
		tab_courses_off.src = '/qbs/images/bannernav-courses.jpg';
		ChangeImages('tab_courses', 'tab_courses_off');
	}
	if (document.frInfo.SelectedTab.value != 'powertools') {
		Hide('divPowertools');
		tab_powertools_off.src = '/qbs/images/bannernav-powertools.jpg';
		ChangeImages('tab_powertools', 'tab_powertools_off');
	}
	if (document.frInfo.SelectedTab.value != 'bookmark') {
		Hide('divBookmark');
		tab_bookmark_off.src = '/qbs/images/bannernav-bookmark.jpg';
		ChangeImages('tab_bookmark', 'tab_bookmark_off');
	}
	if (document.frInfo.SelectedTab.value != 'myinfo') {
		Hide('divMyInfo');
		tab_myinfo_off.src = '/qbs/images/bannernav-myinfo.jpg';
		ChangeImages('tab_myinfo', 'tab_myinfo_off');
	}
	/*
	if (document.frInfo.SelectedTab.value != 'help') {
		Hide('divHelp');
		tab_help_off.src = '/qbs/images/bannernav-help.jpg';
		ChangeImages('tab_help', 'tab_help_off');
	}
	*/
}


/******************************************************************************/



// LEFT MODULES TABLE
function CourseTabRollOver(tabid) {
	if (document.getElementById) {
		document.getElementById('c'+ tabid).className = 'ModuleTabsSelected';
		ChangeImages('cTabTop'+ tabid, 'cTabTop_on');
	}
}

function CourseTabRollOff(tabid) {
	if (document.getElementById) {
		document.getElementById('c'+ tabid).className = 'ModuleTabs';
		ChangeImages('cTabTop'+ tabid, 'cTabTop_off');
	}
}

function SelectModule(cid, mid, pid) {
	GoToPage(cid, mid, pid);
}

function ModuleRollOver(mid) {
	if (document.getElementById) {
		document.getElementById(mid).className = 'ModulesLit';
	}
}


function ModuleRollOverDisabled(mid) {
	if (document.getElementById) {
		document.getElementById(mid).className = 'ModuleDisabled';
	}
}



function ModuleRollOffDisabled(mid) {
	if (document.getElementById) {
		document.getElementById(mid).className = 'ModulesGreyed';
	}
}

function ModuleRollOff(mid) {
	if (document.getElementById) { //if DOM compatible
		if (mid == 'mIntro') { // if Introduction cell
			document.getElementById(mid).className = 'IntroModule';
		} else {
			document.getElementById(mid).className = 'Modules';
		}
	}
}

function ReturnToCourse() {
	document.frInfo.target = '_self';
	document.frInfo.action = strDomain +'/qbs/course.asp';
	document.frInfo.submit();
}

function TellAFriend() {
	document.frInfo.target = '_self';
	//document.frInfo.action = '/qbs/tell-a-friend/tellfriend.asp';
	document.frInfo.action = strDomain +'/qbs/tell-a-friend/form.asp';
	document.frInfo.submit();
}


function funBuyLicense() {
	document.frInfo.target = '_self';
	document.frInfo.action = strDomain +'/qbs/paypal/paypalgo.asp';
	document.frInfo.submit();
}

/* 
================================================================
CellRollOver(eid, cln)

Input:        Element ID As String,
			  Class Name to be used As String  
			   
Output:       N/A

Description:  Creates a rollover effect by using onmouseover 
              and onmouseout and passing which class to use.
================================================================ 
*/	
function CellRollOver(eid, cn) {
	if (document.getElementById) { //if DOM compatible
		document.getElementById(eid).className = cn;
	}
}


/******************************************************************************/

function LoadIntroPages() {
	document.frInfo.CourseID.value = 9;
	document.frInfo.PageID.value = 1010;
	document.frInfo.action = strDomain +'/qbs/introp1.asp';
	document.frInfo.target = '_self';
	document.frInfo.submit();
}

function LoadPowertoolActivity(aid) {
	ResetTabs(); 
	SelectTab('powertools'); 
	document.frInfo.ActivityViewer.value = 'StudentRefresher';
	document.frInfo.ActivityPageID.value = aid;
	document.frInfo.action = strDomain +'/qbs/powertools/activities/activity.asp';
	document.frInfo.target = '_self';
	document.frInfo.submit();
}
function LoadPowertoolActivityFromPopup(apid) {
	opener.ResetTabs(); 
	opener.SelectTab('powertools'); 
	window.opener.document.frInfo.ActivityViewer.value = 'StudentRefresher';
	window.opener.document.frInfo.ActivityPageID.value = apid;
	window.opener.document.frInfo.action = strDomain +'/qbs/powertools/activities/activity.asp';
	window.opener.document.frInfo.target = '_self';
	window.opener.document.frInfo.submit();
	opener.focus();
	window.close();
}


/* 
================================================================
GoToPage(cid, mid, pid, location)

Input:        CourseID As Integer,
			  ModuleID As Integer,
			  PageID As Integer,
			  Location on the page using href# -optional
			   
Output:       N/A
================================================================ 
*/	
function GoToPage(cid, mid, pid, location) {
	var strAction = '';
	if (location == undefined) {
		strAction = strDomain +'/qbs/course.asp';
	} else {
		strAction = strDomain +'/qbs/course.asp#'+ location;
	}
	document.frInfo.CourseID.value = cid;
	document.frInfo.ModuleID.value = mid;
	document.frInfo.PageID.value = pid;
	document.frInfo.target = '_self';
	document.frInfo.action = strAction;
	document.frInfo.submit();
}

function GoToPageFromPopup(cid, mid, pid, location) {
	var strAction = '';
	if (location == undefined) {
		strAction = strDomain +'/qbs/course.asp';
	} else {
		strAction = strDomain +'/qbs/course.asp#'+ location;
	}
	parent.window.opener.document.frInfo.CourseID.value = cid;
	parent.window.opener.document.frInfo.ModuleID.value = mid;
	parent.window.opener.document.frInfo.PageID.value = pid;
	parent.window.opener.document.frInfo.action = strAction;
	parent.window.opener.document.frInfo.target = '_self';
	parent.window.opener.document.frInfo.submit();
	parent.opener.focus();
	parent.window.close();
}


function NextPage(p) {
	document.frInfo.target = '_self';
	document.frInfo.action = strDomain + p;	
	document.frInfo.submit();
}


/******************************************************************************/



































/* 
================================================================
PlayAudio()

Input:        Path to flash audio file As String           

Output:       N/A

Description:  Embedds a Flash object which plays a Flash audio
              file located at the path passed to this function.
			  
Directions:   Simply insert the following javascript include
              into the content where you would like the "Play" 
			  button to be displayed where ABC.swf is the name
			  of your Flash audio file:
<script type="text/javascript">PlayAudio("/resources/10/flash/ABC.swf");</script>		  
================================================================ 
*/

function PlayAudio(soundURL)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="80" height="38" id="soundButton">');
	document.write('<param name=movie value="/qbs/flash/soundButton1.swf">');
	document.write('<param name=quality value=high>');
	document.write('<PARAM NAME=bgcolor value=#FFFFFF>');
	document.write('<param name=flashVars value="soundURL='+ soundURL +'">');
	document.write('<embed src="/qbs/flash/soundButton1.swf" quality=high bgcolor=#ffffff  flashVars="soundURL='+ soundURL +'" width="80" height="38" name="soundButton" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>');
	document.write('</object>');
}




			
function PlayNewAudio(audio) {
		
	var fo = new FlashObject("/qbs/flash/audioPlayer.swf", "test2", "100", "54", "7", "#E6EBEB");
	fo.addVariable("audioURL", audio); //1_15_2.mp3
	fo.addVariable("autoPlayVar", "0");
	// autoPlayVar > 1 = auto-start audio; 0 = wait for manual start //
	
	var strAudio = '' +
		'<div id="popup-a2">' +
			'<div id="wrapper-a2">' +
				'<div style="padding: 0;">' +
					'This video content requires Macromedia Flash player version 7 or newer. <a href="http://www.macromedia.com/go/getflashplayer">Update your flash player.</a>' +
				'</div>' +
			'</div>' +
		'</div>';
		
	document.write(strAudio);
	
	fo.write("wrapper-a2");
}










// ACTIVITIES (latest function preferred to use. 20060220, -dks)
function SaveActivityBttn(bttn, location, hc, cc) { //hc = hidden container id; cc = content container id
	
	document.write('<input type="hidden" name="fSaveLocation" value="" /><input type="hidden" name="fSaveHc" value="" /><input type="hidden" name="fSaveCc" value="" />');
	
	var strBttn = '';
	
	switch(bttn) {
		
		case 'save':
			if (document.images) {
				bttn_save_off = new Image();
 				bttn_save_off.src = "/qbs/images/buttons/bttn_save.gif";
 				bttn_save_on = new Image();
 				bttn_save_on.src = "/qbs/images/buttons/bttn_save_lit.gif";
			}
			strBttn = '<a href="javascript: SaveActivity(\''+ location +'\', \''+ hc +'\', \''+ cc +'\');" onmouseover="ChangeImages(\'bttn_save_activity\',\'bttn_save_on\'); return true;" onmouseout="ChangeImages(\'bttn_save_activity\',\'bttn_save_off\'); return true;"><img name="bttn_save_activity" src="/qbs/images/buttons/bttn_save.gif" alt="Save Activity" border="0" width="69" height="20" /></a>';
			break

		default: //'currently 'save'
			if (document.images) {
				bttn_save_off = new Image();
 				bttn_save_off.src = "/qbs/images/buttons/bttn_save.gif";
 				bttn_save_on = new Image();
 				bttn_save_on.src = "/qbs/images/buttons/bttn_save_lit.gif";
			}
			strBttn = '<a href="javascript: SaveActivity(\''+ location +'\', \''+ hc +'\', \''+ cc +'\');" onmouseover="ChangeImages(\'bttn_save_activity\',\'bttn_save_on\'); return true;" onmouseout="ChangeImages(\'bttn_save_activity\',\'bttn_save_off\'); return true;"><img name="bttn_save_activity" src="/qbs/images/buttons/bttn_save.gif" alt="Save Activity" border="0" width="69" height="20" /></a>';
			break
	}
	document.write(strBttn);
}


function SaveActivity(location, hc, cc) {
	document.frInfo.fSaveLocation.value = location;
	document.frInfo.fSaveHc.value = hc;
	document.frInfo.fSaveCc.value = cc;
	SubmitAnswers();
}












/* 
================================================================
SubmitButton()

Input:        N/A  
Output:       N/A

Description:  Creates a submit button that calls a "SubmitForm();" function
              that you would create for any page that this is called from.
			  
Directions:   Simply insert the following javascript code
              into the content where you would like the Submit Button to be:			  
<script type="text/javascript">SubmitButton();</script>		  
================================================================ 
*/

function SubmitButton() {
	bttn_submit_off = new Image();
 	bttn_submit_off.src = "/qbs/images/buttons/bttn_submit.gif";
 	bttn_submit_on = new Image();
 	bttn_submit_on.src = "/qbs/images/buttons/bttn_submit_lit.gif";
	document.write('<a href="javascript: SubmitForm();" onmouseover="ChangeImages(\'bttn_submit\',\'bttn_submit_on\'); return true;" onmouseout="ChangeImages(\'bttn_submit\',\'bttn_submit_off\'); return true;"><img name="bttn_submit" src="/qbs/images/buttons/bttn_submit.gif" alt="Submit" border="0" width="69" height="20" /></a>');
}












/* 
================================================================
SubmitAnswersButton()

Input:        N/A  
Output:       N/A

Description:  Creates a submit button so that it can be modified
              in one function if need be.
			  
Directions:   Simply insert the following javascript code
              into the content where you would like the Submit Button to be:			  
<script type="text/javascript">SubmitAnswersButton();</script>		  
================================================================ 
*/

function SubmitAnswersButton() {
	bttn_save_off = new Image();
 	bttn_save_off.src = "/qbs/images/buttons/bttn_save.gif";
 	bttn_save_on = new Image();
 	bttn_save_on.src = "/qbs/images/buttons/bttn_save_lit.gif";
	document.write('<a href="javascript: SubmitAnswers();" onmouseover="ChangeImages(\'bttn_save_answers\',\'bttn_save_on\'); return true;" onmouseout="ChangeImages(\'bttn_save_answers\',\'bttn_save_off\'); return true;"><img name="bttn_save_answers" src="/qbs/images/buttons/bttn_save.gif" alt="Save Answers" border="0" width="69" height="20" /></a>');
}


function SubAnsBttnSaveNextPage(bttn) {
	if (bttn == 'continue_exercise') {	
		bttn_continue_exercise_off = new Image();
 		bttn_continue_exercise_off.src = "/qbs/images/buttons/bttn_continue_exercise.gif";
 		bttn_continue_exercise_on = new Image();
 		bttn_continue_exercise_on.src = "/qbs/images/buttons/bttn_continue_exercise_lit.gif";		
		document.write('<a href="javascript: SubmitAnsToNextPage();" onmouseover="ChangeImages(\'bttn_continue_exercise\',\'bttn_continue_exercise_on\'); return true;" onmouseout="ChangeImages(\'bttn_continue_exercise\',\'bttn_continue_exercise_off\'); return true;"><img name="bttn_continue_exercise" src="/qbs/images/buttons/bttn_continue_exercise.gif" alt="Continue Exercise" border="0" width="157" height="20" /></a>');

	} else {
		bttn_save_off = new Image();
 		bttn_save_off.src = "/qbs/images/buttons/bttn_save.gif";
 		bttn_save_on = new Image();
 		bttn_save_on.src = "/qbs/images/buttons/bttn_save_lit.gif";
		document.write('<a href="javascript: SubmitAnsToNextPage();" onmouseover="ChangeImages(\'bttn_save_answers\',\'bttn_save_on\'); return true;" onmouseout="ChangeImages(\'bttn_save_answers\',\'bttn_save_off\'); return true;"><img name="bttn_save_answers" src="/qbs/images/buttons/bttn_save.gif" alt="Save Answers" border="0" width="69" height="20" /></a>');
	}
}

function BttnSaveGoalsNextPage() {
	bttn_save_off = new Image();
 	bttn_save_off.src = "/qbs/images/buttons/bttn_save.gif";
 	bttn_save_on = new Image();
 	bttn_save_on.src = "/qbs/images/buttons/bttn_save_lit.gif";
	document.write('<a href="javascript: SubmitAnsToNextPageGoals();" onmouseover="ChangeImages(\'bttn_save_answers\',\'bttn_save_on\'); return true;" onmouseout="ChangeImages(\'bttn_save_answers\',\'bttn_save_off\'); return true;"><img name="bttn_save_answers" src="/qbs/images/buttons/bttn_save.gif" alt="Save Answers" border="0" width="69" height="20" /></a>');
}





/* 
================================================================
SubAnsBttnShowFeedback(bttn, location)

Input:        button image (-optional, defaults to 'save')          

Output:       N/A

Description:  Same as the SubmitAnswersButton() function, except 
              that this one allows for the addition of a hidden
			  layer "Feedback" that is made visible when saved.
			  
Directions:   Simply insert the following javascript code
              into the content where you would like the Submit Button to be:
			  
<script>SubAnsBttnShowFeedback();</script>		  
================================================================ 
*/

function SubAnsBttnShowFeedback(bttn, location) {

	document.write('<input type="hidden" name="DisplayFeedback" value="" />');
	
	var strBttn = '';
	switch(bttn) {
		case 'answer':
			if (document.images) {
				bttn_answer_off = new Image();
				bttn_answer_off.src = '/qbs/images/buttons/bttn_answer.gif';
				bttn_answer_on = new Image();
				bttn_answer_on.src = '/qbs/images/buttons/bttn_answer_lit.gif';
			}				
			strBttn = '<a href="javascript: SubAnsShowFeedback(\''+ location +'\');" onmouseover="ChangeImages(\'bttn_answer\',\'bttn_answer_on\'); return true;" onmouseout="ChangeImages(\'bttn_answer\',\'bttn_answer_off\'); return true;"><img name="bttn_answer" src="/qbs/images/buttons/bttn_answer.gif" alt="Answer and Display Feedback" border="0" width="69" height="20" /></a>';			
			break
		
		case 'save':
			if (document.images) {
				bttn_save_off = new Image();
 				bttn_save_off.src = "/qbs/images/buttons/bttn_save.gif";
 				bttn_save_on = new Image();
 				bttn_save_on.src = "/qbs/images/buttons/bttn_save_lit.gif";
			}
			strBttn = '<a href="javascript: SubAnsShowFeedback(\''+ location +'\');" onmouseover="ChangeImages(\'bttn_save_answers\',\'bttn_save_on\'); return true;" onmouseout="ChangeImages(\'bttn_save_answers\',\'bttn_save_off\'); return true;"><img name="bttn_save_answers" src="/qbs/images/buttons/bttn_save.gif" alt="Save Answers and Display Feedback" border="0" width="69" height="20" /></a>';
			break

		default:
			if (document.images) {
				bttn_save_off = new Image();
 				bttn_save_off.src = "/qbs/images/buttons/bttn_save.gif";
 				bttn_save_on = new Image();
 				bttn_save_on.src = "/qbs/images/buttons/bttn_save_lit.gif";
			}
			strBttn = '<a href="javascript: SubAnsShowFeedback(\''+ location +'\');" onmouseover="ChangeImages(\'bttn_save_answers\',\'bttn_save_on\'); return true;" onmouseout="ChangeImages(\'bttn_save_answers\',\'bttn_save_off\'); return true;"><img name="bttn_save_answers" src="/qbs/images/buttons/bttn_save.gif" alt="Save Answers and Display Feedback" border="0" width="69" height="20" /></a>';
			break
	}
	document.write(strBttn);
}

function SubAnsShowFeedback(location) {
	Show('Feedback');
	
	if (location == '' || location == undefined) {
		document.frInfo.DisplayFeedback.value = 'Show';
	} else {
		document.frInfo.DisplayFeedback.value = location;
	}
	SubmitAnswers(); 	
}


function PositionPage(location) {	
	if (location != '' && location != undefined) {
		if (document.getElementById('Feedback') != null) {			
			Show('Feedback');
		}
		if (location != 'Show') {				
			document.location.href = '#'+ location;
		}	
	}
}
		
		


/* 
================================================================
SubAnsBttnCalculate()

Input:        N/A  
Output:       N/A

Description:  Creates a submit button so that it can be modified
              in one function if need be.
			  
Directions:   Simply insert the following javascript code
              into the content where you would like the Submit Button to be:			  
<script type="text/javascript">SubmitAnswersButton();</script>		  
================================================================ 
*/

function SubAnsBttnCalculate() {
	bttn_calculate_off = new Image();
 	bttn_calculate_off.src = "/qbs/images/buttons/bttn_calculate.gif";
 	bttn_calculate_on = new Image();
 	bttn_calculate_on.src = "/qbs/images/buttons/bttn_calculate_lit.gif";	
	document.write('<a href="javascript: SubmitAnswers();" onmouseover="ChangeImages(\'bttn_calculate_answers\',\'bttn_calculate_on\'); return true;" onmouseout="ChangeImages(\'bttn_calculate_answers\',\'bttn_calculate_off\'); return true;"><img name="bttn_calculate_answers" src="/qbs/images/buttons/bttn_calculate.gif" alt="Calculate and Save Answers" border="0" width="100" height="20" /></a>');
}




function SubAnsBttnCalcNextPage() {
	bttn_calculate_off = new Image();
 	bttn_calculate_off.src = "/qbs/images/buttons/bttn_calculate.gif";
 	bttn_calculate_on = new Image();
 	bttn_calculate_on.src = "/qbs/images/buttons/bttn_calculate_lit.gif";	
	document.write('<a href="javascript: SubmitAnsToNextPage();" onmouseover="ChangeImages(\'bttn_calculate_answers\',\'bttn_calculate_on\'); return true;" onmouseout="ChangeImages(\'bttn_calculate_answers\',\'bttn_calculate_off\'); return true;"><img name="bttn_calculate_answers" src="/qbs/images/buttons/bttn_calculate.gif" alt="Calculate and Advance Page" border="0" width="100" height="20" /></a>');
}


function SubmitAnsToNextPage() {
	document.frInfo.WhatToDo.value = 'SubmitAnswersAdvance1Page';
	document.frInfo.PageID.value = intNextPage;
	document.frInfo.target = '_self';
	document.frInfo.action = strDomain +'/qbs/course.asp';
	document.frInfo.submit();
}

function SubmitAnsToNextPageGoals() {
	document.frInfo.WhatToDo.value = 'SubmitAnswersAdvance1PageGoals';
	document.frInfo.PageID.value = intNextPage;
	document.frInfo.target = '_self';
	document.frInfo.action = strDomain +'/qbs/course.asp';
	document.frInfo.submit();
}



/* 
================================================================
ContinueBttn(param, location)

Input:        Button Type As String /OR/ Next PageID As Integer,
              HREF Location As String -optional
Output:       N/A

Description:  Creates a continue button so that it will go to
              the next page OR Show 'Feedback' div.
			  
Directions:   Simply insert the following javascript code  
              into the content where you would like the 
			  Continue Button to be:			  
<script type="text/javascript">ContinueBttn(intNextPage);</script>		  
================================================================ 
*/

function ContinueBttn(param, location) {
	if (location == undefined) {
		location = '';
	}
	switch(param) {
		
		case 'ShowDissectClosingSentence':
			if (document.images) {
				bttn_disectclosingsentence_off = new Image();
				bttn_disectclosingsentence_off.src = '/qbs/images/buttons/bttn_disectclosingsentence.gif';
				bttn_disectclosingsentence_on = new Image();
				bttn_disectclosingsentence_on.src = '/qbs/images/buttons/bttn_disectclosingsentence_lit.gif';
			}
			document.write('<a href="javascript: Show(\'Feedback\'); PositionPage(\''+ location +'\');" onmouseover="ChangeImages(\'bttn_disectclosingsentence\',\'bttn_disectclosingsentence_on\'); return true;" onmouseout="ChangeImages(\'bttn_disectclosingsentence\',\'bttn_disectclosingsentence_off\'); return true;"><img name="bttn_disectclosingsentence" src="/qbs/images/buttons/bttn_disectclosingsentence.gif" alt="Show Dissect Closing Sentence" border="0" width="177" height="20" /></a>');
			
			break
			
		case 'ShowWorksheet':
			if (document.images) {
				bttn_worksheet_off = new Image();
				bttn_worksheet_off.src = '/qbs/images/buttons/bttn_worksheet.gif';
				bttn_worksheet_on = new Image();
				bttn_worksheet_on.src = '/qbs/images/buttons/bttn_worksheet_lit.gif';
			}
			document.write('<a href="javascript: Show(\'Feedback\');" onmouseover="ChangeImages(\'bttn_worksheet\',\'bttn_worksheet_on\'); return true;" onmouseout="ChangeImages(\'bttn_worksheet\',\'bttn_worksheet_off\'); return true;"><img name="bttn_worksheet" src="/qbs/images/buttons/bttn_worksheet.gif" alt="Exercise Worksheet" border="0" width="157" height="20" /></a>');
			break
			
		case 'ShowVoiceMail':
			if (document.images) {
				bttn_samplevoicemail_off = new Image();
				bttn_samplevoicemail_off.src = '/qbs/images/buttons/bttn_samplevoicemail.gif';
				bttn_samplevoicemail_on = new Image();
				bttn_samplevoicemail_on.src = '/qbs/images/buttons/bttn_samplevoicemail_lit.gif';
			}
			document.write('<a href="javascript: Show(\'Feedback\');" onmouseover="ChangeImages(\'bttn_samplevoicemail\',\'bttn_samplevoicemail_on\'); return true;" onmouseout="ChangeImages(\'bttn_samplevoicemail\',\'bttn_samplevoicemail_off\'); return true;"><img name="bttn_samplevoicemail" src="/qbs/images/buttons/bttn_samplevoicemail.gif" alt="Continue" border="0" width="130" height="20" /></a>');
			break
		
		case 'ShowFeedback':
			document.write('<a href="javascript: Show(\'Feedback\'); PositionPage(\'nModule\');" onmouseover="ChangeImages(\'bttn_continue\',\'bttn_continue_on\'); return true;" onmouseout="ChangeImages(\'bttn_continue\',\'bttn_continue_off\'); return true;"><img name="bttn_continue" src="/qbs/images/buttons/bttn_continue.gif" alt="Continue" border="0" width="100" height="20" /></a>');			
			break
		
		case 'ShowFeedbackGoToButton':
			document.write('<a href="javascript: Show(\'Feedback\'); PositionPage(\'goToButton\');" onmouseover="ChangeImages(\'bttn_continue\',\'bttn_continue_on\'); return true;" onmouseout="ChangeImages(\'bttn_continue\',\'bttn_continue_off\'); return true;"><img name="bttn_continue" src="/qbs/images/buttons/bttn_continue.gif" alt="Continue" border="0" width="100" height="20" /></a>');			
			break
		
		default:
			document.write('<a href="javascript: ChangePage('+ param +');" onmouseover="ChangeImages(\'bttn_continue\',\'bttn_continue_on\'); return true;" onmouseout="ChangeImages(\'bttn_continue\',\'bttn_continue_off\'); return true;"><img name="bttn_continue" src="/qbs/images/buttons/bttn_continue.gif" alt="Continue" border="0" width="100" height="20" /></a>');
			break
	}
	
	//if (location != undefined) {
	//	PositionPage(location);
	//}	
}


function PopupContinueButton(pid, pu) {
	document.write('<p align="right"><a href="javascript: LoadPopup('+ pid +','+ pu +');" onmouseover="ChangeImages(\'bttn_continue\',\'bttn_continue_on\'); return true;" onmouseout="ChangeImages(\'bttn_continue\',\'bttn_continue_off\'); return true;"><img name="bttn_continue" src="/qbs/images/buttons/bttn_continue.gif" alt="Continue" border="0" width="100" height="20" /></a></p>');
}
function LoadPopup(pid, pu) {
	document.location.href = 'puwin.asp?pid='+ pid +'&popupid='+ pu;
}


function ChangePage(pid) {
	document.frInfo.PageID.value = pid;
	document.frInfo.target = '_self';
	document.frInfo.action = strDomain +'/qbs/course.asp';
	document.frInfo.submit();
}




/* 
================================================================
ClickHereBttn()

Input:        N/A 
Output:       N/A

Description:  Creates a click here button that executes a 
              ClickHere() function in the RightContent field.
			  
Directions:   Simply insert the following javascript code  
              into the content where you would like the 
			  Click Here Button to be:			  
<script>ClickHereBttn();</script>		  
================================================================ 
*/
function ClickHereBttn(f, n) {
	if (document.images) {
		bttn_clickhere_off = new Image();
 		bttn_clickhere_off.src = "/qbs/images/buttons/bttn_clickhere.gif";
 		bttn_clickhere_on = new Image();
 		bttn_clickhere_on.src = "/qbs/images/buttons/bttn_clickhere_lit.gif";
	}
	if (f == undefined) {
		f = 'ClickHere()';
	}
	if (n == undefined) {
		n = 'bttn_clickhere';
	}	
	
	var strClickHere = '' +
		'<a href="javascript: '+ f +';" onmouseover="ChangeImages(\''+ n +'\', \'bttn_clickhere_on\'); return true;" onmouseout="ChangeImages(\''+ n +'\', \'bttn_clickhere_off\'); return true;">' +
			'<img name="'+ n +'" src="/qbs/images/buttons/bttn_clickhere.gif" width="100" height="20" alt="" border="0" />' +		
		'</a>';	
	document.write(strClickHere);
}





/* 
================================================================
ClickForCoachingBttn()

Input:        N/A 
Output:       N/A

Description:  Creates a click here button for additional coaching.
			  
Directions:   Simply insert the following javascript code  
              into the content where you would like the 
			  Click Here Button to be:			  
<script>ClickForCoachingBttn();</script>		  
================================================================ 
*/
function ClickForCoachingBttn(op) {
	if (op == undefined) {
		op = '';
	}
	if (document.images) {
		bttn_clickforcoaching_off = new Image();
 		bttn_clickforcoaching_off.src = "/qbs/images/buttons/bttn_clickforcoaching.gif";
 		bttn_clickforcoaching_on = new Image();
 		bttn_clickforcoaching_on.src = "/qbs/images/buttons/bttn_clickforcoaching_lit.gif";
	}
	
	var strClickForCoachingBttn = '' +
		'<a href="javascript: ClickForCoaching(\''+ op +'\');" onmouseover="ChangeImages(\'bttn_clickforcoaching\', \'bttn_clickforcoaching_on\'); return true;" onmouseout="ChangeImages(\'bttn_clickforcoaching\', \'bttn_clickforcoaching_off\'); return true;">' +
			'<img name="bttn_clickforcoaching" src="/qbs/images/buttons/bttn_clickforcoaching.gif" width="217" height="20" alt="" border="0" />' +		
		'</a>';	
	document.write(strClickForCoachingBttn);
}


function ClickForCoaching(op) {
	switch(op) {
		case 'ShowFeedback':
			Show('divHidden');
			document.getElementById('divHidden').innerHTML = document.getElementById('divContent').innerHTML;
			PositionPage('bttm');
			break
		
		case '':
			alert('Additional Coaching function.');
			break
	}	
}




function HowToDragDropBttn(popupid) {
	if (document.images) {
		bttn_howtodragdrop_off = new Image();
 		bttn_howtodragdrop_off.src = "/qbs/images/buttons/bttn_howtodragdrop.gif";
 		bttn_howtodragdrop_on = new Image();
 		bttn_howtodragdrop_on.src = "/qbs/images/buttons/bttn_howtodragdrop_lit.gif";
	}
	
	var strDragDrop = '' +
		'<a href="javascript: PopupWindow('+ popupid +');" onmouseover="ChangeImages(\'bttn_howtodragdrop\', \'bttn_howtodragdrop_on\'); return true;" onmouseout="ChangeImages(\'bttn_howtodragdrop\', \'bttn_howtodragdrop_off\'); return true;">' +
			'<img name="bttn_howtodragdrop" src="/qbs/images/buttons/bttn_howtodragdrop.gif" width="157" height="20" alt="" border="0" />' +		
		'</a>';	
	document.write(strDragDrop);
}































var arrInput = new Array(1);
var arrInputValue = new Array(1);
/* 
================================================================
SetupInputs(s, min, max, l, t, nc, af)

Input:			Starting number of input fields As Integer,
				Minimum number of input fields As Integer,
				Maximum number of input fields As Integer,
				Length of the input box in pixels As Integer,
				Number of allowable characters As Integer,
				Optional text As String,
				Numbered Columns As Boolean (0=no, 1=yes),
				Add Fields Amount As Integer

Output:			N/A

Description:	Dynamically Generated Input Boxes for activities.
					eg.
<script type="text/javascript">SetupInputs(20, 20, 30, 250, 200, '<br />', 0, 1)</script>
				
================================================================ 
*/
function SetupInputs(s, min, max, w, numchar, t, nc, af) {
	
	if (nc == undefined) {
		nc = 0;
	}
	if (af == undefined) {
		af = 1;
	}
	
	document.write('<div id=\'inputlayer\'></div>');
	
	// Determine if there are fields filled in that should be displayed,
	// and then display the required number of fields
	intNumFields = 0;	
	for (j=1; j<arrInputValue.length; j++) {
		//if (Trim(arrInputValue[j]) != '') {
		if (arrInputValue[j] != '') {
			intNumFields = j;
		}
	}
	if (s > intNumFields) {
		intNumFields = s;
	}
	intNumFields = intNumFields+1;
	
	document.getElementById('inputlayer').innerHTML="";
	strMsg = "";
	for (i=1; i<=intNumFields; i++) {
		AddInput(min, max, w, numchar, t, nc);
	}
	//alert('<br /><a href="javascript: AddInput('+ min +', '+ max +', '+ w +', '+ numchar +', \''+ t +'\', '+ nc +')');

	document.write('<br /><a href="javascript: AddFields('+ min +', '+ max +', '+ w +', '+ numchar +', \''+ t +'\', '+ nc +', '+ af +');" onmouseover="ChangeImages(\'bttn_addfield\',\'bttn_addfield_on\'); return true;" onmouseout="ChangeImages(\'bttn_addfield\',\'bttn_addfield_off\'); return true;"><img name="bttn_addfield" src="/qbs/images/buttons/bttn_addfield.gif" alt="Add Field" border="0" width="100" height="20" /></a>')
	//document.write(' &nbsp; ');
	//document.write('<a href="javascript: DeleteInput('+ min +', '+ max +', '+ w +', '+ numchar +', \''+ t +'\', '+ nc +')" onmouseover="ChangeImages(\'bttn_removefield\',\'bttn_removefield_on\'); return true;" onmouseout="ChangeImages(\'bttn_removefield\',\'bttn_removefield_off\'); return true;"><img name="bttn_removefield" src="/qbs/images/buttons/bttn_removefield.gif" alt="Remove Field" border="0" width="100" height="20" /></a>')
	document.write(' &nbsp; ');
}

function AddFields(min, max, w, numchar, t, nc, af) {
	
	for (m=1; m<=af; m++) {
		AddInput(min, max, w, numchar, t, nc);
	}
	
	
	if (strMsg != '') {
		alert(strMsg);
	}
}

function ReplaceCharsCheck(nc) {
	//prevent the auto creation of the closing html tag		
	if (nc == 1) {		
		strReplaceChars = "@table@@tr valign=top@@td@@table class='Data'@" + document.getElementById('inputlayer').innerHTML;

		strReplaceChars = strReplaceChars.replace (/@table@/g, '<table>');
		strReplaceChars = strReplaceChars.replace (/@table class='Data'@/g, "<table class='Data'>");
		strReplaceChars = strReplaceChars.replace (/@tr@/g, '<tr>');
		strReplaceChars = strReplaceChars.replace (/@tr valign=top@/g, '<tr valign=top>');
		strReplaceChars = strReplaceChars.replace (/@td@/g, '<td>');
		strReplaceChars = strReplaceChars.replace (/@td align=right@/g, '<td align=right>');
				
		strReplaceChars = strReplaceChars.replace (/@\/td@/g, '</td>');
		strReplaceChars = strReplaceChars.replace (/@\/tr@/g, '</tr>');
		strReplaceChars = strReplaceChars.replace (/@\/table@/g, '</table>');
		
		document.getElementById('inputlayer').innerHTML = strReplaceChars;
		//alert(document.getElementById('inputlayer').innerHTML);
	}
}









/* 
------------------------------------------------------
Input:	Minimum number of input fields As Integer,
		Maximum number of input fields As Integer,
		Width of the input box in pixels As Integer,
		Number of allowable characters As Integer,
		Optional text As String,
		Numbered Columns As Boolean (0=no, 1=yes)
------------------------------------------------------
*/
function AddInput(min, max, w, numchar, t, nc) {
	//arrInput.push(createInput(arrInput.length));
	arrInput.push(arrInput.length);
	//arrInputValue.push(arrInputValue.length);
	arrInputValue.push("");
	Display(min, max, w, numchar, t, nc);
	ReplaceCharsCheck(nc);
}

/* 	
------------------------------------------------------
Input:	Minimum number of input fields As Integer,
		Maximum number of input fields As Integer,
		Width of the input box in pixels As Integer,
		Number of allowable characters As Integer,
		Optional text As String,
		Numbered Columns As Boolean (0=no, 1=yes)
------------------------------------------------------
*/
function Display(min, max, w, numchar, t, nc) {
	//strMsg = "";
	document.getElementById('inputlayer').innerHTML="";
	
	for (i=1; i<arrInput.length; i++) {
		if (i <= max) {
			document.getElementById('inputlayer').innerHTML += CreateInput(arrInput[i], arrInputValue[i], w, numchar, t, nc, arrInput.length);
		} else {
			strMsg = "The maximum number of allowable fields has already been added.";
		}
	}
	while(arrInput.length - 1 > max) {
		DeleteInput(min, max, w, numchar, t, nc);
	}
	//if (strMsg != '') {
	//	alert(strMsg);
	//}
	
	ReplaceCharsCheck(nc);
}

/*
------------------------------------------------------
Input:	Input field value As String,
		Input ID As Integer
------------------------------------------------------
*/
function SaveValue(intId,strValue) {
	arrInputValue[intId]=strValue;
}  

/*
------------------------------------------------------
Input:	Input field value As String,
		Input ID As Integer,
		Width of the input box in pixels As Integer,
		Number of allowable characters As Integer,
		Optional text As String,
		Numbered Columns As Boolean (0=no, 1=yes)
------------------------------------------------------
*/
function CreateInput(id, value, w, numchar, t, nc, arrlen) {
	strText = "";
	//strText += "<input type='text' id='test "+ id +"'  name='Input"+ id +"' onChange='javascript: SaveValue("+ id +",this.value)' value='"+ value +"' style='width: "+ w +"px;' maxlength='"+ numchar +"'>"
	if (nc == 1) { //Math.round((arrlen/2-.1) * Math.pow(10, 0)) / Math.pow(10, 0)
		strText = "@tr@@td align=right@&nbsp;"+ id +".&nbsp;@/td@@td@<input type='text' id='test "+ id +"'  name='Input"+ id +"' onChange='javascript: SaveValue("+ id +",this.value)' value='"+ value +"' style='width: "+ w +"px;' maxlength='"+ numchar +"'>&nbsp;&nbsp;@/td@@/tr@";
		if (id==Math.round((arrlen/2-.1) * Math.pow(10, 0)) / Math.pow(10, 0)) { //Math.round((arrlen/2-.1) * Math.pow(10, 0)) / Math.pow(10, 0)
			strText += "@/table@@/td@@td@@table class='Data'@";			
		}
		
	} else {
		strText = "<input type='text' id='test "+ id +"'  name='Input"+ id +"' onChange='javascript: SaveValue("+ id +",this.value)' value='"+ value +"' style='width: "+ w +"px;' maxlength='"+ numchar +"'>" + t;
	}
	return strText;
}

/*
------------------------------------------------------
Input:	Minimum number of input fields As Integer,
		Maximum number of input fields As Integer,
		Width of the input box in pixels As Integer,
		Number of allowable characters As Integer,
		Optional text As String,
		Numbered Columns As Boolean (0=no, 1=yes)
------------------------------------------------------
*/
function DeleteInput(min, max, w, numchar, t, nc) {
	if (arrInput.length > min+1) { 
		arrInput.pop(); 
		arrInputValue.pop();
	} else {
		strMsg = 'You must have at least '+ min +' field';
		if (min == 1) {
			strMsg = strMsg + '.'
		} else {
			strMsg = strMsg + 's.'
		}
		alert(strMsg);			
	}
	Display(min, max, w, numchar, t, nc); 
}
	


/*
**********************************************************************************
**********************************************************************************
*/














// DETERMINE OPERATING SYSTEM
function getOS()
{
	if (navigator.appVersion.indexOf("Mac") != -1 ) OS = "Mac";
	else if (navigator.appVersion.indexOf("PowerPC") != -1 ) OS = "Mac";
	else if (navigator.appVersion.indexOf("Win") != -1 ) OS = "Win";
	else OS = "Win"; // as default just in case - D.K.S.
}

getOS();
	
amountdown  = (screen.height / 2) - 205;
amountright = (screen.width / 2) - 370;

intHeight = 400;	
if (OS == "Win") {
	intWidth = 720;
} else {
	intWidth = 687;
}



/* 
================================================================
NewWindow(p,w,h)

Input:        Page As String,
              Width of new window As Integer,
			  Height of new window As Integer        

Output:       N/A

Description:  Simply creates a new window.
================================================================ 
*/	
function NewWindow(p, w, h, n) {
	
	var winNewWindow = null;
	
	if (n == undefined || n == '') {
		n = 'nwdks';
	}
	
	screenWidth = screen.width;
	screenHeight = screen.height;
	
	if ( (!w || !h) || (w >= screenWidth || h >= screenHeight) || (w==0 && h==0)) {
		pw = screenWidth -10;
		ph = screenHeight - 55;		
		amountright = 0;
		amountdown  = 0;	
	} else {
		pw = w;
		ph = h;		
		amountright = (screenWidth / 2) - (pw / 2) - 10;
		amountdown  = (screenHeight / 2) - (ph / 2) - 20;	
	}
	var opened = 0;
	// store new window object in global variable
	winNewWindow = window.open(p, n, "toolbar=no, location=no, directory=no, status=no, menubar=no, scrollbars=yes, resizable=no, width= " + pw + ", height=" + ph + ", screenX=" + amountright + ", screenY=" + amountdown + ", top=" + amountdown + ", left=" + amountright);
	winNewWindow.focus();	
}



function ShadowWindow(p, w, h) {
	
	var winShadowWindow = null;
	
	screenWidth = screen.width;
	screenHeight = screen.height;
	
	if ( (!w || !h) || (w >= screenWidth || h >= screenHeight) || (w==0 && h==0)) {
		pw = screenWidth;
		ph = screenHeight - 55;		
		amountright = 0;
		amountdown  = 0;	
	} else {
		pw = w;
		ph = h;		
		amountright = (screenWidth / 2) - (pw / 2) - 10;
		amountdown  = (screenHeight / 2) - (ph / 2) - 20;	
	}
	// store new window object in global variable
	winShadowWindow = window.open(p, 'ShadowWindow', "toolbar=yes, location=yes, directories=yes, status=yes, menubar=yes, scrollbars=yes, resizable=yes, width= " + pw + ", height=" + ph + ", screenX=" + amountright + ", screenY=" + amountdown + ", top=" + amountdown + ", left=" + amountright);
	winShadowWindow.focus();	
}



/* 
****************************************************************
Right Column Launchers:
****************************************************************
*/







function SetupPopupIcon(theme) {
	if (theme == undefined) {
		theme = '';
	}
	if (document.images) {	
		pubox_icon_off = new Image();
		pubox_icon_off.src = '/qbs/popups/pubox_icon'+ theme +'.gif';
		pubox_icon_on = new Image();
		pubox_icon_on.src = '/qbs/popups/pubox_icon'+ theme +'_lit.gif';
	}
}

function GetConsiderThis() {
	SetupPopupIcon();
	if (document.images) {	
		ct_launch_off = new Image();
		ct_launch_off.src = '/qbs/popups/ct_launch.gif';
		ct_launch_on = new Image();
		ct_launch_on.src = '/qbs/popups/ct_launch_lit.gif';
	}
}

function GetCallOut(text, image) { //height
	strPopupBox = '' +
		'<img src="/qbs/popups/callout_topbar.gif" width="156" height="32" alt="" border="0">';
		if (image != undefined) {
			strPopupBox += '<img src="'+ image +'" width="156" />';
		}
	strPopupBox += '<table width="100%">' +		
			'<tr valign="top">' +
				'<td class="CallOutBorder">' + 
					'<table>' +
						'<tr valign="top">' +
							'<td class="CallOut">';
								//if (height != undefined) {
								//	strPopupBox += '<img src="/images/spacer.gif" width="1" height="'+ height +'" align="left" />';
								//}
								strPopupBox += text +
							'</td>' +
						'</tr>' +
					'</table>' +
				'</td>' +
			'</tr>' +			
		'</table>&nbsp;';
	return strPopupBox;
}

function GetCallOutExpand(text, image) {
	strPopupBox = '' +
		'<img src="/qbs/popups/callout_topbar.gif" width="156" height="32" alt="" border="0">';
		if (image != undefined) {
			strPopupBox += '<img src="'+ image +'" width="156" height="157" />';
			intHeight = 133;
		} else {
			intHeight = 290;
		}
	strPopupBox += '<table width="100%">' +		
			'<tr valign="top">' +
				'<td class="CallOutBorder">' + 
					'<table>' +
						'<tr valign="top">' +
							'<td class="CallOut"><img src="/images/spacer.gif" width="1" height="'+ intHeight +'" align="left" />'+ text +'</td>' +
						'</tr>' +
					'</table>' +
				'</td>' +
			'</tr>' +			
		'</table>&nbsp;';
	return strPopupBox;
}

function GetTip(popupid, text) {
	if (document.images) {	
		tips_launch_off = new Image();
		tips_launch_off.src = '/qbs/popups/tips_launch.gif';
		tips_launch_on = new Image();
		tips_launch_on.src = '/qbs/popups/tips_launch_lit.gif';
	}
	
	var strPopupBox = '' +
		'<table class="Tips">' +		
			'<tr valign="top">' +
				'<td width="35"><img src="/qbs/popups/tips_icon.gif" width="35" height="32" alt="" border="0"></td>' +
				'<td width="121"><img src="/qbs/popups/tips_title.gif" width="121" height="32" alt="" border="0"></td>' +
			'</tr>' +			
			'<tr valign="top">' +
				'<td class="TipsContent" colspan="2">' +
					text + 
				'</td>' +
			'</tr>' +
			'<tr valign="top">' +
				'<td colspan="2"><a href="javascript: PopupWindow('+ popupid +', \'tip\');" onmouseover="ChangeImages(\'tips_launch\', \'tips_launch_on\'); return true;" onmouseout="ChangeImages(\'tips_launch\', \'tips_launch_off\'); return true;"><img name="tips_launch" src="/qbs/popups/tips_launch.gif" width="156" height="19" alt="" border="0"></a></td>' +
			'</tr>' +			
		'</table>&nbsp;';
	return strPopupBox;
}


function GetImageBottom(popupid, text, image, popupimage, pagetype, theme) {
	
	if (image == undefined) {
		var image = '/qbs/popups/pubox_imagebottom_default.gif';
	}
	if (pagetype == undefined) {
		pagetype = '';
	}
	if (theme == undefined) {
		theme = '';
	}
	
	SetupPopupIcon(theme);
	var strPopupBox = '' +
		'<table class="PopupBoxImageBottom" onmouseover="ChangeImages(\'pubox_icon'+ popupid +'\', \'pubox_icon_on\'); return true;" onmouseout="ChangeImages(\'pubox_icon'+ popupid +'\', \'pubox_icon_off\'); return true;" onclick="PopupWindow('+ popupid +', \'reg\', \''+ popupimage +'\', \''+ pagetype +'\', \''+ theme +'\');">' +		
			'<tr valign="top">' +
				'<td width="35"><img name="pubox_icon'+ popupid +'" src="/qbs/popups/pubox_icon'+ theme +'.gif" width="35" height="32" alt="" border="0"></td>' +
				'<td width="118" class="PopupBoxImageBottomTitle'+ theme +'">'+ text +'</td>' +
				'<td width="3"><img src="/qbs/popups/pubox_toprightcorner'+ theme +'.gif" width="3" height="32" alt="" border="0"></td>' +
			'</tr>' +			
			'<tr valign="top">' +
				'<td colspan="3"><img src="'+ image +'" width="156" alt="" border="0" /></td>' +
			'</tr>' +		
		'</table>&nbsp;';
	return strPopupBox;
}




function GetImagePopup(popupid, text, image, popupimage, pagetype, theme) {
	
	if (image == undefined) {
		var image = '/qbs/popups/pubox_imagebottom_default.gif';
	}
	if (pagetype == undefined) {
		pagetype = '';
	}
	if (theme == undefined) {
		theme = '';
	}
	
	SetupPopupIcon(theme);
	var strPopupBox = '' +
		'<table class="PopupBoxImageBottom" onmouseover="ChangeImages(\'pubox_icon'+ popupid +'\', \'pubox_icon_on\'); return true;" onmouseout="ChangeImages(\'pubox_icon'+ popupid +'\', \'pubox_icon_off\'); return true;" onclick="PopupImage('+ popupid +', \'reg\', \''+ popupimage +'\', \''+ pagetype +'\', \''+ theme +'\');">' +		
			'<tr valign="top">' +
				'<td width="35"><img name="pubox_icon'+ popupid +'" src="/qbs/popups/pubox_icon'+ theme +'.gif" width="35" height="32" alt="" border="0"></td>' +
				'<td width="118" class="PopupBoxImageBottomTitle'+ theme +'">'+ text +'</td>' +
				'<td width="3"><img src="/qbs/popups/pubox_toprightcorner'+ theme +'.gif" width="3" height="32" alt="" border="0"></td>' +
			'</tr>' +			
			'<tr valign="top">' +
				'<td colspan="3"><img src="'+ image +'" width="156" alt="" border="0" /></td>' +
			'</tr>' +		
		'</table>&nbsp;';
	return strPopupBox;
}




/* 
================================================================
PopupBox(pid, text, style, image, popupimage, theme)

Input:        Popup ID As Integer,
              Box Text As String,
			  Style As String,      -optional, defaults to 'imagebottom' 
			                               others include: 'imagetop', 
										   'reg', 
										   'tip', 
										   'callout',
										   'callout2',
										   'considerthis'
              Theme As String
										   
              Box Image As String,  -optional, defaults to the default image in the popups directory
			  PopupImage As String  -optional, defaults to none
Output:       N/A

Description:  Creates a popup box with , multiple entries 
              are permitted.
eg.
<script type="text/javascript">PopupBox(1, 'FINANCIAL SERVICES', '/resources/9/images/Mod2_pg26i1.jpg', '/resources/9/images/Mod2_pg26pui1.jpg');</script>

Last Modified: 20051125, DKS, created (replaces all previous 
                                       popup types/versions)
================================================================ 
*/

function PopupBox(popupid, text, style, image, popupimage, theme) {

	var strPopupBox = '';
		
	/*if (document.images) {	
		pubox_icon_off = new Image();
		pubox_icon_off.src = '/qbs/popups/pubox_icon.gif';
		pubox_icon_on = new Image();
		pubox_icon_on.src = '/qbs/popups/pubox_icon_lit.gif';
	}*/
	SetupPopupIcon();
	
	//if (popupimage == undefined) {
	//	var popupimage = '/qbs/popups/puwin_image_default.gif';
	//}
		
	switch(style) {
		
		case 'considerthis':
		
			GetConsiderThis();

			strPopupBox = '' +
				'<table class="ConsiderThis">' +		
					'<tr valign="top">' +
						'<td><img src="/qbs/popups/ct_icon.gif" width="35" height="32" alt="" border="0"></td>' +
						'<td width="118" class="ConsiderThisTitle">&nbsp;CONSIDER THIS</td>' +
						'<td width="3"><img src="/qbs/popups/ct_toprightcorner.gif" width="3" height="32" alt="" border="0"></td>' +
					'</tr>' +			
				'</table>' +
		
				'<table class="ConsiderThis">' +
					'<tr valign="top">' +
						'<td class="ConsiderThisBorder" width="1"><img src="/qbs/images/spacer.gif" width="1" height="1" alt="" border="0"></td>' +
						'<td class="ConsiderThisContent" width="154"><br />' + text + '<br />&nbsp;</td>' +
						'<td class="ConsiderThisBorder" width="1"><img src="/qbs/images/spacer.gif" width="1" height="1" alt="" border="0"></td>' +
					'</tr>' +
					'<tr valign="top">' +
						'<td colspan="3"><a href="javascript: PopupWindow('+ popupid +', \'considerthis\');" onmouseover="ChangeImages(\'ct_launch\', \'ct_launch_on\'); return true;" onmouseout="ChangeImages(\'ct_launch\', \'ct_launch_off\'); return true;"><img name="ct_launch" src="/qbs/popups/ct_launch.gif" width="156" height="20" alt="" border="0"></a></td>' +
					'</tr>' +			
				'</table>&nbsp;';
				break
		
		
		case 'callout':
			
			strPopupBox = GetCallOut(text, image);			
			break
			
			
		case 'callout2':
			strPopupBox = '' +
			'<img src="/qbs/popups/callout_topbar_solid.gif" width="156" height="18" alt="" border="0">' +
			'<table width="100%">' +		
				'<tr valign="top">' +
					'<td class="CallOut_Solid">' + 
						text + '<br />&nbsp;' +
					'</td>' +
				'</tr>' +			
			'</table>&nbsp;';
			break
			
			
		case 'calloutexpand':
			
			strPopupBox = GetCallOutExpand(text, image);			
			break
			
			
		case 'tip':
			
			strPopupBox = GetTip(popupid, text);			
			break			
		
		case 'imagetop': //Regular Popup A
			
			if (image == undefined) {
				var image = '/qbs/popups/pubox_imagetop_default.gif';
			}
			//if (pagetype == undefined) {
				pagetype = '';
			//}		
			if (theme == undefined) {
				theme = '';
			}
	
			strPopupBox += '' +
				'<table class="PopupBoxImageTop" onmouseover="ChangeImages(\'pubox_icon'+ popupid +'\', \'pubox_icon_on\'); return true;" onmouseout="ChangeImages(\'pubox_icon'+ popupid +'\', \'pubox_icon_off\'); return true;" onclick="PopupWindow('+ popupid +', \'reg\', \''+ popupimage +'\', \''+ pagetype +'\', \''+ theme +'\');">' +		
					'<tr valign="top">' +
						'<td width="35"><img name="pubox_icon'+ popupid +'" src="/qbs/popups/pubox_icon.gif" width="35" height="32" alt="" border="0"></td>' +
						'<td width="121"><img src="'+ image +'" width="121" height="32" alt="" border="0" /></td>' +
					'</tr>' +			
					'<tr valign="top">' +
						'<td colspan="2" class="PopupBoxImageTopTitle">' + text + '</td>' +
					'</tr>' +
					'<tr valign="top">' +
						'<td colspan="2">' +
							'<img src="/qbs/popups/pubox_bottom.gif" width="156" height="4" alt="" border="0" />' +
						'</td>' +
					'</tr>' +
				'</table>&nbsp;';
			break
		
		case 'imagepopup':
		
			strPopupBox = GetImagePopup(popupid, text, image, popupimage, '', theme);			
			break
		
		default: //case 'imagebottom': //Regular Popup B
			
			strPopupBox = GetImageBottom(popupid, text, image, popupimage, '', theme);			
			break
	}
		
	document.write(strPopupBox);
}




function CreatePopup(pid, popupid, ptype, pimage, pagetype, theme) {
	if (pimage == undefined) {
		pimage = '';
	}
	if (pagetype == undefined) {
		pagetype = '';
	}
	if (theme == undefined) {
		theme = '';
	}
	
	intHeight = 400;	
	if (OS == "Win") {
		intWidth = 720;
	} else {
		intWidth = 687;
	}
		
	var winPopupWindow = null;
	winPopupWindow = window.open('/qbs/popups/puwin.asp?pid='+ pid +'&popupid='+ popupid +'&ptype='+ ptype +'&pimage='+ pimage +'&pagetype='+ pagetype +'&theme='+ theme,'puw'+ pid,'toolbar=no,location=no,director=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=' + intWidth + ',height=' + intHeight + ',screenX=' + amountright + ',screenY=' + amountdown + ',top=' + amountdown + ',left=' + amountright);
	winPopupWindow.focus();
}



function CreatePopupImage(pid, popupid, ptype, pimage, pagetype, theme) {
	if (pimage == undefined) {
		pimage = '';
	}
	if (pagetype == undefined) {
		pagetype = '';
	}
	if (theme == undefined) {
		theme = '';
	}
	
	intHeight = 467;	
	//if (OS == "Win") {
	//	intWidth = 720;
	//} else {
	//	intWidth = 687;
	//}
	intWidth = 689;
	
	var tmpAR = amountright;
	var tmpAD = amountdown;
	amountright = amountright + 10;
	amountdown = amountdown - 43;
		
	var winPopupImage = null;
	winPopupImage = window.open('/qbs/popups/puwin.asp?pid='+ pid +'&popupid='+ popupid +'&ptype='+ ptype +'&pimage='+ pimage +'&pagetype='+ pagetype +'&theme='+ theme,'puiw'+ pid,'titlebar=no,toolbar=no,location=no,director=no,status=no,menubar=no,scrollbars=no,resizable=no,width=' + intWidth + ',height=' + intHeight + ',screenX=' + amountright + ',screenY=' + amountdown + ',top=' + amountdown + ',left=' + amountright);
	winPopupImage.focus();
	
	amountright = tmpAR;
	amountdown = tmpAD;
}











var intAudioId = 0;
function GetAudioPopup(pid, title, audio, image, popupimage) {
	intAudioId = intAudioId + 1;
	if (document.images) {	
		audiopopup_icon_off = new Image();
		audiopopup_icon_off.src = '/qbs/popups/audiopopup_icon.gif';
		audiopopup_icon_on = new Image();
		audiopopup_icon_on.src = '/qbs/popups/audiopopup_icon_lit.gif';
	}

	var strAudioPopup = '' +
		'<table class="AudioBox" onmouseover="ChangeImages(\'audiopopup_icon'+ pid +'\', \'audiopopup_icon_on\'); return true;" onmouseout="ChangeImages(\'audiopopup_icon'+ pid +'\', \'audiopopup_icon_off\'); return true;" onclick="AudioPopupWindow('+ pid +', \''+ audio +'\', \''+ popupimage +'\');">' +		
			'<tr valign="top">' +
				'<td width="35"><img name="audiopopup_icon'+ pid +'" src="/qbs/popups/audiopopup_icon.gif" width="35" height="32" alt="" border="0"></td>' +
				'<td width="121"><img src="'+ image +'" width="121" height="32" alt="" border="0" /></td>' +
			'</tr>' +			
			'<tr valign="top">' +
				'<td colspan="2" class="AudioBoxTitle">' + title + '</td>' +
			'</tr>' +
			'<tr valign="top">' +
				'<td colspan="2">' +
					'<img src="/qbs/popups/audiopopup_bottom.gif" width="156" height="4" alt="" border="0" />' +
				'</td>' +
			'</tr>' +
		'</table>&nbsp;' +
		
		'<div class="HiddenAbsoluteDiv">' +
			'<script>EmbedAudio(\''+ audio +'\', \'ui'+ intAudioId +'\');</script>' +
		'</div>';
		
		return strAudioPopup;
}

/* 
================================================================
SetupAudioPopup(pid, title, audio, image, popupimage)

Input:       PopupID As Integer,
             Title As String,
			 Audio Path As String,
			 Image Path As String,
			 PopupImage Path As String
Output:      N/A

Description: Insert the following code wherever you would
             like the Audio popup to be created.
eg.
<script type="text/javascript">
<!--
	var strTitle = 'REAL ESTATE';
	var strAudio = '/resources/9/flash/m02p26pu1.jpg';
	var strImage = '/resources/9/images/Mod2_pg26i1.jpg';
	var strPopupImage = '/resources/9/images/Mod2_pg26pui1.jpg';
	SetupAudioPopup(1, strTitle, strAudio, strImage, strPopupImage)
// -->
</script>
================================================================ 
*/

function SetupAudioPopup(pid, title, audio, image, popupimage) {
	
	strAudioPopup = GetAudioPopup(pid, title, audio, image, popupimage);	
		
	document.write(strAudioPopup);
}




function GetAudio(popupid, title, intro, audio, boximage, popupimage) {
	if (document.images) {	
		audio_launch_off = new Image();
		audio_launch_off.src = '/qbs/popups/audio_launch.gif';
		audio_launch_on = new Image();
		audio_launch_on.src = '/qbs/popups/audio_launch_lit.gif';
	}
	
	if (boximage == undefined || boximage == '') {
		strBoxImage = ''; //'<img src="/qbs/popups/audio_image.jpg" width="156" height="158" alt="" border="0">';
	} else {
		strBoxImage = '<img src="'+ boximage +'" alt="" border="0" />';
	}
	
	if (popupimage == undefined) {
		popupimage = '';
	}
	
	var strAudio = '' +
		'<table class="Audio">' +		
			'<tr valign="top">' +
				'<td><img src="/qbs/popups/audio_icon.gif" width="35" height="32" alt="" border="0"></td>' +
				'<td width="118" class="AudioTitle">&nbsp;'+ title +'</td>' +
				'<td width="3"><img src="/qbs/popups/audio_toprightcorner.gif" width="3" height="32" alt="" border="0"></td>' +
			'</tr>' +
		'</table>' +
		strBoxImage +				
		'<table class="Audio">' +
		'</tr>';
		
	if (intro != ''){
		strAudio += ''+
			'<tr valign="top">' +
				'<td class="AudioContent"><br />' + intro + '<br />&nbsp;</td>' +				
			'</tr>';
	}
		strAudio += ''+
			'<tr valign="top">' +
				'<td><a href="javascript: AudioWindow('+ popupid +', \''+ audio +'\', \''+ popupimage +'\');" onmouseover="ChangeImages(\'audio_launch\', \'audio_launch_on\'); return true;" onmouseout="ChangeImages(\'audio_launch\', \'audio_launch_off\'); return true;"><img name="audio_launch" src="/qbs/popups/audio_launch.gif" width="156" height="19" alt="" border="0"></a></td>' +
			'</tr>' +			
		'</table>&nbsp;' +
		
		'<div class="HiddenAbsoluteDiv">' +
			'<script>EmbedAudio(\''+ audio +'\', \'ui'+ intAudioId +'\');</script>' +
		'</div>';
	
	return strAudio;
}


/* 
================================================================
SetupAudio(pid, title, intro, audio, boximage)

Input:       PopupID As Integer,
             Title As String,
             Intro text As String,
			 Audio path As String,
			 Box Image As String 	//optional, defaults to Tom
Output:      N/A

Description: Insert the following code wherever you would
             like the Audio launcher to be created.
eg.
<script type="text/javascript">
<!--
	var strTitle = 'AUDIO: T. FREESE';	
	var strIntro = 'A few years ago, my office assistant received a call from IBM world headquarters. As it turned out, the Vice President of Eastern Operations from IBM...';
	var strAudio = '/resources/9/flash/m02p10.jpg';
	SetupAudio(1, strTitle, strIntro, strAudio);
// -->
</script>
================================================================ 
*/

function SetupAudio(popupid, title, intro, audio, boximage, popupimage)
{		
	var strAudio = GetAudio(popupid, title, intro, audio, boximage, popupimage);			
	document.write(strAudio);
}




function EmbedAudio(audio, ui, color, ap) { // ui is optional (unique identifier if more than one on page)
										// color is optional, defaults to #E1E7E7
										// ap is optional, default is 0 (0=no autoplay, 1=autoplay)
	
	if (ui == undefined || ui == '') {
		ui = 'a1';
	}
	if (color == undefined || color == '') {
		color = '#E1E7E7';
	}
	if (ap == undefined || ap == '') {
		ap = 0;
	}
	
	var strDiv = '' +
		'<div id="wrappera'+ ui +'">' +
			'<div style="padding: 0;">' +
				'This video content requires Macromedia Flash player version 7 or newer. <a href="http://www.macromedia.com/go/getflashplayer">Update your flash player.</a>' +
			'</div>' +
		'</div>';
	document.write(strDiv);	
	
	// <![CDATA[
		var fo = new FlashObject("/qbs/flash/audioPlayer.swf", "test", "100", "54", "7", color);
		fo.addVariable("audioURL", audio);
		fo.addVariable("autoPlayVar", ap); // autoPlayVar > 1 = auto-start audio; 0 = wait for manual start //
		fo.write("wrappera" + ui);
	// ]]>
}


/* 20060426 - DKS */
/*
function AudioTab(tabid, title, subtitle, text, audio) {
	var strAudioTab;
	strAudioTab = ''+
		'<table width="100%">'+
			'<tr valign="top">'+
				'<td width="96%"></td>'+
				'<td width="1%"><img src="/qbs/images/spacer.gif" width="156" height="1" alt="" border="0" /></td>'+
				'<td width="1%"><img src="/qbs/images/spacer.gif" width="170" height="1" alt="" border="0" /></td>'+
			'</tr>'+
			'<tr valign="top">'+
				'<td></td>'+
				'<td></td>'+
				'<td align="right"><script>EmbedAudio(\''+ audio +'\', \''+ tabid +'\');</script></td>'+
			'</tr>'+
			'<tr valign="top">'+
				'<td><div id="div'+ tabid +'" class="HiddenDiv" style="border-top: 1px solid #E5CC7F; border-left: 1px solid #E5CC7F; width: 100%; height: 31px;"></div></td>'+
				'<td style="border-top: 1px solid #E5CC7F;" onclick="ShowHideTab(\''+ tabid +'\');"></td>'+
				'<td style="border-top: 1px solid #E5CC7F; padding-left: 15px;">'+ subtitle +'</td>'+
			'</tr>'+
	''+
	''+
	''+
	''+
	''+
	''+
	''+
	''+
	''+
	''+
	''+
	''+
	''+
	''+
	'</table>'+
		
	'';
	document.write(strAudioTab);
}
function ShowHideTab(tabid) {
	//if (eval('div'+ tabid ==)
}
*/




function GetVideo(popupid, title, intro, video) {
	if (document.images) {	
		video_launch_off = new Image();
		video_launch_off.src = '/qbs/popups/video_launch.gif';
		video_launch_on = new Image();
		video_launch_on.src = '/qbs/popups/video_launch_lit.gif';
	}
	
	var strVideo = '' +
		'<table class="Video">' +		
			'<tr valign="top">' +
				'<td><img src="/qbs/popups/video_icon.gif" width="35" height="32" alt="" border="0"></td>' +
				'<td width="118" class="VideoTitle">&nbsp;'+ title +'</td>' +
				'<td width="3"><img src="/qbs/popups/video_toprightcorner.gif" width="3" height="32" alt="" border="0"></td>' +
			'</tr>' +
		'</table>' +
		'<img src="/qbs/popups/video_image.jpg" width="156" height="126" alt="Tom Freese" border="0"><br />' +				
		'<img src="/qbs/popups/video_bottom.gif" width="156" height="32" alt="" border="0"><br />' +				
		'<table class="Video">' +
			'<tr valign="top">' +
				'<td class="VideoContent"><br />' + intro + '<br />&nbsp;</td>' +				
			'</tr>' +
			'<tr valign="top">' +
				'<td><a href="javascript: VideoWindow('+ popupid +', \''+ video +'\');" onmouseover="ChangeImages(\'video_launch\', \'video_launch_on\'); return true;" onmouseout="ChangeImages(\'video_launch\', \'video_launch_off\'); return true;"><img name="video_launch" src="/qbs/popups/video_launch.gif" width="156" height="19" alt="" border="0"></a></td>' +
			'</tr>' +			
		'</table>';
	return strVideo;
}


/* 
================================================================
SetupVideo(pid, title, intro, video)

Input:       PopupID As Integer,
             Title As String,
             Intro text As String,
			 Video path As String
Output:      N/A

Description: Insert the following code wherever you would
             like the Video launcher to be created.
eg.
<script>SetupVideo(1, 'VIDEO: T. FREESE', 'When training salespeople, it has always made sense to start with the topic of needs development, before discussing your value proposition.', '/resources/9/video/m02_p01__TomVid-2_1.flv') ;</script>
================================================================ 
*/

function SetupVideo(popupid, title, intro, video)
{
	var strVideo = GetVideo(popupid, title, intro, video);		
	document.write(strVideo);
}






function PlayIntroVideo() {
	amountright = (screen.width / 2) - 268;
	amountdown  = (screen.height / 2) - 265;
	window.open('/qbs/popups/opener_SA.asp', 'newWin', 'status="false", width=536, height=490, screenX=' + amountright + ', screenY=' + amountdown + ', top=' + amountdown + ', left=' + amountright);
}








function SetupLearningTab(popupid, css) {
	if (document.images) {	
		lo_off = new Image();
		lo_off.src = '/qbs/popups/lo_tab.gif';
		lo_on = new Image();
		lo_on.src = '/qbs/popups/lo_tab_lit.gif';
	}
	var strLo = '' +
		'<div class="'+ css +'">' +
			'<a href="javascript: PopupWindow('+ popupid +', \'lo\');" onmouseover="ChangeImages(\'lo\', \'lo_on\'); return true;" onmouseout="ChangeImages(\'lo\', \'lo_off\'); return true;">' +
				'<img name="lo" src="/qbs/popups/lo_tab.gif" width="156" height="32" alt="" border="0" />' +
			'</a>' +
		'</div>';
	
	document.write(strLo);
}


function LearnObjBtn(popupid) {
	if (document.images) {	
		lo_button_off = new Image();
		lo_button_off.src = '/qbs/popups/lo_button.gif';
		lo_button_on = new Image();
		lo_button_on.src = '/qbs/popups/lo_button_lit.gif';
	}
	var strLoBttn = '' +
		'<a href="javascript: PopupWindow('+ popupid +', \'lo\');" onmouseover="ChangeImages(\'lo_button\', \'lo_button_on\'); return true;" onmouseout="ChangeImages(\'lo_button\', \'lo_button_off\'); return true;">' +
			'<img name="lo_button" src="/qbs/popups/lo_button.gif" width="237" height="23" alt="" border="0" />' +
		'</a>';
	
	document.write(strLoBttn);
}















/* 
================================================================
Quote(text, author)

Input:        Text As String,
              Author As String
Output:       N/A

Description:  Creates a Quote style.
eg.
<script type="text/javascript">Quote("Selling is a creative act--one that requires salespeople to go out in their respective territories and create business opportunities that otherwise wouldn't exist.", "Thomas A. Freese");</script>	

Last Modified: 20051121, DKS, created
================================================================ 
*/

function Quote(text, author) {
	var strQuote = '' +
		'<table width="100%">' +
			'<tr>' +
				'<td class="PageTitleUnderline" colspan="2"><img src="/qbs/images/spacer.gif" alt="" border="0" height="1" width="1"></td>' +
			'</tr>' +
			'<tr>' +
				'<td colspan="2"><img src="/qbs/images/spacer.gif" alt="" border="0" height="5" width="1"></td>' +
			'</tr>' +
		'</table>' +
		
		'<table width="100%">' +
			'<tr>' +
				'<td class="QuoteText">' + text + '</td>' +
			'</tr>' +
			'<tr>' +
				'<td class="QuoteAuthor">-- ' + author + '</td>' +
			'</tr>' +
		'</table>' +
		
		'<table width="100%">' +
			'<tr>' +
				'<td colspan="2"><img src="/qbs/images/spacer.gif" alt="" border="0" height="4" width="1"></td>' +
			'</tr>' +
			'<tr>' +
				'<td class="PageTitleUnderline" colspan="2"><img src="/qbs/images/spacer.gif" alt="" border="0" height="1" width="1"></td>' +
			'</tr>' +			
		'</table>';
		
	document.write(strQuote);
}



function RemoveRColBg() {
	if (document.getElementById) {
		document.getElementById('tdRightColumn').className = '';
	}
}

function SetWhatToDo(wtd) {
	document.frInfo.WhatToDo.value = wtd;
}