



function GetPrintFriendly(){
	//determine the name of the page
	var thisPage = window.location.href;
	var splitArray = thisPage.split('?');
	location.href = 'news_detailsSecPrintFriendly.htm?'+splitArray[splitArray.length - 1];	
}

function HideTable(theIdentity){
	document.getElementById(theIdentity).style.display="none";
}
function expandFirst() {
			document.getElementById(expandFirst.arguments[0]).style.display = "block";
			for (var i=1; i<expandFirst.arguments.length; i++) {
				document.getElementById(expandFirst.arguments[i]).style.display = "none";
			}
		}
function expandCollapse() {
	for (var i=0; i<expandCollapse.arguments.length; i++) {
		var element = document.getElementById(expandCollapse.arguments[i]);
		element.style.display = (element.style.display == "none") ? "block" : "none";
	}
}
function mailpage(pageName, pageURL)
{
mail_str = "mailto:?subject=Page to check out ";
mail_str += "&body=I thought you might be interested in this page.";
mail_str += ". You can view it at, " + escape(location.href);
location.href = mail_str;
}
function comment(pageName, pageURL)
{
mail_str = "mailto:riley@marketsmediallc.com?subject=Comment on story";
mail_str += "&body=I wish to comment on this page: " + escape(location.href);
location.href = mail_str;
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


 function refreshClassesIn(theElement, theStyle, theLoop) {
	//alert ("refreshClassesIn: "+theElement+" | "+theStyle+" | "+theLoop);
		for(i=0;i<=theLoop;i++){
			if(i == theElement){
				document.getElementById(theStyle+i).className = "hilite";
				document.getElementById('arrowOver'+theStyle+i).style.display="block";
				 //alert ("Highlighted : "+document.getElementById('arrowOver'+i).style);
			}else{
				document.getElementById(theStyle+i).className = "lolite";
				document.getElementById('arrowOver'+theStyle+i).style.display="none";
				 //alert ("Lowlighted : "+document.getElementById('arrowOver'+i).style);
			}
		}
    }
function showDeArrow(theElement) {
	document.getElementById(theElement).style.display='none';
}
 
function doDaMenu() {
	//alert('doDaMenu!');
	//determine the name of the page
	var thisPage = window.location.href;
	//check to see if it ends in a '/', if so then we are at the site's url - eg www.sitedomain.com/
	if(thisPage.substring(thisPage.length-1, thisPage.length) == '/'){
		var pageName = 'index';
	}else{
		//if not, then we are at a URL that ends in the page name and so we need to isolate that and check it against the nav bar to highlight the right button
		//split up the URL
		var splitArray = thisPage.split('.');
		//we can assume that the page name is the second to last bit of the array
		var halfwayThere = splitArray[splitArray.length - 2];
		//should the page be in a directory (e.g www.domain.com/directory/page.php), we need to drop off all the slash stuff
		//GABB - NEED TO TEST THIS OUTSIDE TEST ONCE IT IS UP AND RUNNING
		var pageSplit = halfwayThere.split('/');
		/* var testString = '';
		for(i=0;i<pageSplit.length;i++){
			testString += pageSplit[i] +' | ';
		}
		alert("DUDE: "+testString); 
		}*/
		var pageName = pageSplit[pageSplit.length - 1];
		
		
		
		
		
		
		
		
		
		//alert ('Page Name: '+pageName);
		//go thru the menu and find a match with the div's id name
		var theMenuItems = document.getElementsByName('menuItem');
		//determine how many div's to look at
		for(i=0;i<theMenuItems.length;i++){
			if(theMenuItems[i].id == pageName){
				theMenuItems[i].className = "active";
				break;
			}
		}
	}
	
	
	
	//determine the name of the page
	var thisPage = window.location.href;
	//check to see if it ends in a '/', if so then we are at the site's url - eg www.sitedomain.com/
	if(thisPage.substring(thisPage.length-1, thisPage.length) == '/'){
		var pageName = 'index';
	}else{
		//if not, then we are at a URL that ends in the page name and so we need to isolate that and check it against the nav bar to highlight the right button
		//split up the URL
		var splitArray = thisPage.split('.');
		//we can assume that the page name is the second to last bit of the array
		var halfwayThere = splitArray[splitArray.length - 2];
		//should the page be in a directory (e.g www.domain.com/directory/page.php), we need to drop off all the slash stuff
		//GABB - NEED TO TEST THIS OUTSIDE TEST ONCE IT IS UP AND RUNNING
		var pageSplit = halfwayThere.split('/');
		var pageName = pageSplit[pageSplit.length - 1];
	}
	
	
	
	
	//var pageName = 'exchanges';
	
	
	
	
		switch(pageName){
			case 'institutions':
			MM_swapImage('navBar_r2_c2','','images/design/nav/navBar_r2_c2_f2.gif',1);
			break;
			case 'hedge_funds':
			MM_swapImage('navBar_r2_c4','','images/design/nav/navBar_r2_c4_f2.gif',1);
			break;
			case 'broker_dealers':
			MM_swapImage('navBar_r2_c6','','images/design/nav/navBar_r2_c6_f2.gif',1);
			break;
			case 'ats_ecn':
			MM_swapImage('navBar_r2_c8','','images/design/nav/navBar_r2_c8_f2.gif',1);
			break;
			case 'exchanges':
			MM_swapImage('navBar_r2_c10','','images/design/nav/navBar_r2_c10_f2.gif',1);
			break;
			case 'regulators':
			MM_swapImage('navBar_r2_c12','','images/design/nav/navBar_r2_c12_f2.gif',1);
			break;
			case 'vendors':
			MM_swapImage('navBar_r2_c14','','images/design/nav/navBar_r2_c14_f2.gif',1);
			break;
			case 'marketsmedialive':
			MM_swapImage('navBar_r2_c16','','images/design/nav/navBar_r2_c16_f2.gif',1);
			break;
			case 'index':
			MM_swapImage('navBar_r2_c18','','images/design/nav/navBar_r2_c18_f2.gif',1);
			break;
		}
	
	
}
	
function loginReveal(){
	//alert('loginReveal: '+document.getElementById("login_module").style.visibility);
	if(document.getElementById("login_module").style.visibility=="visible"){
		document.getElementById("login_module").style.visibility="hidden";
		document.getElementById("login_module").style.display="none";
		//document.getElementById("login_module").style.position="absolute";
	}else{
		document.getElementById("login_module").style.visibility="visible";
		document.getElementById("login_module").style.display="block";
	//document.getElementById("login_module").style.position="relative";
	}
}

function DoStuff(){
//alert("Doin stuff");
	doDaMenu();
}