// -----------------------------------------------------------------------------------------------------
// Default search box text as seen on simplebits.com, with help from this fellow: http://1976design.com/
// -----------------------------------------------------------------------------------------------------

// event handler
function addEventToObject(obj,evt,func) {
	var oldhandler = obj[evt];
	obj[evt] = (typeof obj[evt] != 'function') ? func : function(){oldhandler();func();};
}

// search box stuff
var Searchbox = {
	init : function()
		{
		var sBox = document.getElementById('ctl00_SearchText');
		if (sBox)
			{
			addEventToObject(sBox,'onclick',Searchbox.click);
			addEventToObject(sBox,'onblur',Searchbox.blur);
			}
		},
	click : function()
		{
		var sBox = document.getElementById('ctl00_SearchText');
		if (sBox.value == 'Enter search terms')
			{
			sBox.value = '';
			}
	  	},
	blur : function()
		{
		var sBox = document.getElementById('ctl00_SearchText');
		if (sBox.value == '' || sBox.value == ' ') {sBox.value = 'Enter search terms';}
		}
	};

// add event onload

addEventToObject(window,'onload',Searchbox.init);

// -----------------------------------------------------------------------------------------------------
// Pop for Guided Tour
// -----------------------------------------------------------------------------------------------------

function popitup(url) {
	newwindow=window.open(url,'name','height=500,width=790');
	if (window.focus) {newwindow.focus()}
	return false;
}

// -----------------------------------------------------------------------------------------------------
// Conferences accordian
// -----------------------------------------------------------------------------------------------------

//window.addEvent('domready', function() {

//var accordion = new Accordion('a.atStart', 'div.atStart', {
//	alwaysHide: true,
//	opacity: false,
//	display: false,
//	onActive: function(toggler, element) {
//		toggler.setStyles({});
//	},
//		
//	onBackground: function(toggler, element) {
//		toggler.setStyles({});
//	}
//}, $('content-primary'));

//});

// -----------------------------------------------------------------------------------------------------
// Popup for Video on home page
// -----------------------------------------------------------------------------------------------------

function playVideo(url) {
	newwindow=window.open(url,'name','height=300,width=450');
	if (window.focus) {newwindow.focus()}
	return false;
}

function launchActivity(url) {
	newwindow=window.open(url,'name','height=515,width=794');
	if (window.focus) {newwindow.focus()}
	return false;
}



// -----------------------------------------------------------------------------------------------------
// Launch Sample Activities
// -----------------------------------------------------------------------------------------------------

function MM_openBrWindow(theURL,winName,features) { //v2.0
		  window.open(theURL,winName,features);
		}		