
Event.observe(window, 'load', loadAccordions, false);
	
function loadAccordions() {
	var bottomAccordion = new accordion('vertical_container', {
		resizeSpeed : 8,
		classNames : {
		    toggle : 'accordion_toggle',
		    toggleActive : 'accordion_toggle_active',
		    content : 'accordion_content'
		},
		direction : 'vertical',
		onEvent : 'click'
	});
	var bottomAccordion2 = new accordion('vertical_container2', {
		resizeSpeed : 8,
		classNames : {
		    toggle : 'accordion_toggle2',
		    toggleActive : 'accordion_toggle_active2',
		    content : 'accordion_content2'
		},
		direction : 'vertical',
		onEvent : 'mouseover'
	});	
}
// locator
function explodeMapLocator(){
	setTimeout('explodeMapLocatorMapUp()',1);
}
function explodeMapLocatorMapUp(){
	document.getElementById('locatorExplodeMap').style.display = 'block';
	document.getElementById('mapThumb').style.display = 'none';
	document.getElementById('footer').style.zIndex = -1; 
	//xmlhttpPost('/O2Net/Applications/TransformDoc/default.aspx?XmlDoc=/xml/content/salesRepLocator.xml&XsltDoc=/xslt/locator_home.xslt','locatorExplodeMap');
	xmlhttpPost('/O2Net/Applications/TransformDoc/default.aspx?XmlDoc=/xml/content/salesContacts.xml&XmlVars=mapUse|homePage&XsltDoc=/xslt/salesRepsUsImgMap.xslt','locatorExplodeMap');
}
function compressExplodedMap(){
		document.getElementById('locatorExplodeMap').style.display = 'none';
		document.getElementById('mapThumb').style.display = 'block';
		document.getElementById('footer').style.zIndex = 1;
}
function viewMore(){
	if(document.getElementById('more').style.display == 'block')
	{
		document.getElementById('more').style.display = 'none';
		document.getElementById('homePage').style.height = '560px';
	}
	else
	{
		document.getElementById('more').style.display = 'block';
		document.getElementById('homePage').style.height = '940px';
	}	
}
function playVideo(){
	alert('play');
}

var presentationAreaHtml = "";

function loadVideo(vidId){
	var vidHeight = 385;
	var vidWidth = 640;	
	var htmlStr = '';
	

	if(presentationAreaHtml == ""){
		presentationAreaHtml = document.getElementById('slideShow').innerHTML;		//Store only if first time
	}	
	
	htmlStr += '<div id="youTubeAreaOuter" onMouseOver="displayCloseButton(\'on\');" onMouseOut="displayCloseButton(\'off\');">';
	htmlStr += '<div id="youTubeCloseBut">';
	htmlStr += '<a href="javascript:void(0);" onClick="closeVid();"><img alt="close" height="28" src="/images/interface/youTubeVid_close.png" width="88" /></a>';
	htmlStr += '</div>'; 			
	htmlStr += '<div id="youTubeArea">';
	htmlStr += '<object width="' + vidWidth + '" height="'+ vidHeight + '">';
	htmlStr += '<param name="movie" value="http://www.youtube.com/v/' + vidId + '&hl=en_US&fs=1&rel=0"></param>';
	htmlStr += '<param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>';
	htmlStr += '<embed src="http://www.youtube.com/v/' + vidId + '&autoplay=1&hl=en_US&fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="' + vidWidth + '" height="' + vidHeight + '" wmode="transparent"></embed>';
	htmlStr += '</object>';
	htmlStr += '</div>';
	htmlStr += '</div>';
	
	document.getElementById('slideShow').innerHTML = htmlStr;
	document.getElementById('slideShow').style.zIndex = "10";
	document.getElementById('youTubeCloseBut').style.display = "none";
	//$('div#slideShowNav').css('marginLeft','-999px');
	scroll(0,0);
}
function closeVid(){
	document.getElementById('slideShow').innerHTML = window.presentationAreaHtml;
	//document.getElementById('youTubeVid').style.zIndex = "0";
	//$('div#slideShowNav').css('marginLeft','0px');
	showAd(parseInt(window.slideOn) + 1);
}
function displayCloseButton(state){
	switch(state){
		case 'on':
			document.getElementById('youTubeCloseBut').style.display = 'block';
			break;
		case 'off':
			document.getElementById('youTubeCloseBut').style.display = 'none';
			break;
		default:
			document.getElementById('youTubeCloseBut').style.display = 'none';
	}
}
