// JavaScript Document

<!--

var currentSelected = null;

$(function()
{
	$('#HEselect').mouseover(function()
	{
		$('#HEselect').css('background-image', getIcon('HEselect', true));
	}).mouseout(function()
	{
		if (currentSelected != 'HEselect')
		{
			$('#HEselect').css('background-image', getIcon('HEselect', false));
		}
	});
	$('#TIselect').mouseover(function()
	{
		$('#TIselect').css('background-image', getIcon('TIselect', true));
	}).mouseout(function()
	{
		if (currentSelected != 'TIselect')
		{
			$('#TIselect').css('background-image', getIcon('TIselect', false));
		}
	});
	$('#MAselect').mouseover(function()
	{
		$('#MAselect').css('background-image', getIcon('MAselect', true));
	}).mouseout(function()
	{
		if (currentSelected != 'MAselect')
		{
			$('#MAselect').css('background-image', getIcon('MAselect', false));
		}
	});
});

function showCampaign(Height,CampaignID, elem)
{
	document.getElementById('surveyContainer').innerHTML = "<iframe height=\"" + Height + "\" src=\"http:\/\/www.macwellness.com\/trainerinsite\/pages\/Survey.aspx?CID=" + CampaignID + "\" frameborder=\"0\" width=\"555\" allowtransparency=\"allowtransparency\"><\/iframe>";

	if (elem)
	{
		$('#' + currentSelected).css('background-image', getIcon(currentSelected, false));
		currentSelected = elem;
	}
}

function getIcon(elemName, isHover)
{
	switch (elemName)
	{
		case 'HEselect':
		default:
		{
			return (isHover) ? 'url("/_images/graphic-test/loc-01b.jpg")' : 'url("/_images/graphic-test/loc-01a.jpg")';
		}
		case 'TIselect':
		{
			return (isHover) ? 'url("/_images/graphic-test/loc-02b.jpg")' : 'url("/_images/graphic-test/loc-02a.jpg")';
		}
		case 'MAselect':
		{
			return (isHover) ? 'url("/_images/graphic-test/loc-03b.jpg")' : 'url("/_images/graphic-test/loc-03a.jpg")';
		}
	}
}

function popUpWindow(loc,name,w,h,pos,scroll,toolbar,menubar,addressbar,directories,resize,status)
{
  goWhere = loc;
  windowName = name;
  wWidth = w;
  wHeight = h;
  
  sBars = scroll;
  tBar = toolbar;
  mBar = menubar;
  aBar = addressbar;
  dBar = directories;
  statusBar = status;
  canResize = resize;
  
  if(pos=="center"){
	leftLoc = window.screen.width/2 - wWidth/2;
	topLoc = window.screen.height/2 - wWidth/2;
	}
  else if(pos=="left"){
	leftLoc = 0;
	topLoc = 0;
	}
  else if(pos=="right"){
	leftLoc = window.screen.width - wWidth - 10;
	topLoc = 0;
	}

  return window.open(goWhere,windowName,config='height='+wHeight+',width='+wWidth+',left='+leftLoc+',top='+topLoc+',toolbar='+tBar+',menubar='+mBar+',scrollbars='+sBars+',resizable='+canResize+',location='+aBar+',directories='+dBar+',status='+statusBar+'');
  
}

function popUp(loc,name,w,h,pos,scroll,toolbar,menubar,addressbar,directories,resize,status,bReOpen,theWin) {
	
	if ( theWin != null ) {
		if (theWin.closed) {
			theWin = popUpWindow(loc,name,w,h,pos,scroll,toolbar,menubar,addressbar,directories,resize,status); }
		else { 
		   if (bReOpen) {
			  theWin.close();
			  theWin = popUpWindow(loc,name,w,h,pos,scroll,toolbar,menubar,addressbar,directories,resize,status); }
		   else { 
			  theWin.location = loc;
			  theWin.focus(); }
		}
	}
	else { 
		theWin = popUpWindow(loc,name,w,h,pos,scroll,toolbar,menubar,addressbar,directories,resize,status);
	}
	
  return theWin;
}	

//-->

<!--
function chkNumeric(strString)//  check for valid numeric strings	
{
	var strValidChars = "0123456789.-";
	var strChar;
	var blnResult = 1;

	if (strString.length == 0)
	{
		blnResult = 0;
	}

	//  test strString consists of valid characters listed above
	for (i = 0; i < strString.length && blnResult == 1; i++)
	{
		  strChar = strString.charAt(i);
		  if (strValidChars.indexOf(strChar) == -1)
			 {
				blnResult = 0;
			 }
	}
	return blnResult;
}

var rememberWin;

function showCoupon(n) 
{
	if (n == 1 || n == 2 || n == 3 || n == 4 )
	{
  		rememberWin = popUp("/select.asp?page=" + n,'rememberWin',630,600,'center','yes','no','no','no','no','no','no',false,rememberWin);
	}
	else 
	{
		if(chkNumeric(n) == 1)
		{
			rememberWin = popUp("/trainerinsite/pages/Survey.aspx?SID="+ n,'rememberWin',630,600,'center','yes','no','no','no','no','no','no',false,rememberWin);
		}
		else
		{
			rememberWin = popUp(n,'rememberWin',630,600,'center','yes','no','no','no','no','no','no',false,rememberWin);
		}	
	}
}
//	else 
//	{
//		rememberWin = popUp("/trainerinsite/pages/Survey.aspx?SID="+ n,'rememberWin',630,600,'center','yes','no','no','no','no','no','no',false,rememberWin);
//	}

//-->

<!--
// DO NOT EDIT BELOW THIS LINE
function loadImg(URL)
{
  if (document.images) 
  {
	newImg = new Image();
	newImg.src = URL;
	return newImg;
  }
}

function objImg(imgName,offImgURL,overImgURL,onImgURL)
{
  this.name = imgName
  this.state = "off";
  if (offImgURL) {this.offImg = loadImg(offImgURL);}
  if (overImgURL) {this.overImg = loadImg(overImgURL);}
  if (onImgURL) {this.onImg = loadImg(onImgURL);}
}

function swapImg(imgArray,imgName,newState)
{
  thisImage = imgName.name;
  thisState = imgName.state;

  if(newState=="over" && thisState != "on")
  {
	document.images[thisImage].src = imgName.overImg.src;
	imgName.state = "over";
  }
  if(newState=="off" && thisState != "on")
  {
	document.images[thisImage].src = imgName.offImg.src;
	imgName.state = "off";
  }
  if(newState=="on")
  {
	for(i=0;i<imgArray.length;i++)
	{
	  thisImage = imgArray[i].name;
	  thisState = imgArray[i].state;
	  if(thisImage == imgName.name)
	  {
		document.images[thisImage].src = imgArray[i].onImg.src;
		imgArray[i].state = "on";
	  }
	  else
	  {
		document.images[thisImage].src = imgArray[i].offImg.src;
		imgArray[i].state = "off";
	  }
	}
  }
}

function makeImgArray(n)
{
	this.length = n;
	for (var i = 1; i <= n; i++)
	{
		this[i] = 0
	}
	return this
}

//-->

<!--
	imgJoin = new objImg('imageJoin','/_images/internal/joinnow2.gif','/_images/internal/joinnow1.gif');
	imgArray = new Array(imgJoin);
//-->


function exp(strTag ,strAttribute){ 
var elem = document.getElementsByTagName(strTag); 
for (var i =0;i<elem.length;i++) 
	{ 
	if(elem[i].getAttribute('exp1')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp2')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp3')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp4')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp5')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp6')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp7')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp8')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp9')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp10')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp11')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp12')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp13')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp14')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp15')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp16')=="yes") 
		{elem[i].style.display='none';}
	else if(elem[i].getAttribute('exp17')=="yes") 
		{elem[i].style.display='none';}
	else if(elem[i].getAttribute('exp18')=="yes") 
		{elem[i].style.display='none';}
	else if(elem[i].getAttribute('exp19')=="yes") 
		{elem[i].style.display='none';}
	else if(elem[i].getAttribute('exp20')=="yes") 
		{elem[i].style.display='none';}
	else if(elem[i].getAttribute('exp21')=="yes") 
		{elem[i].style.display='none';}
	else if(elem[i].getAttribute('exp22')=="yes") 
		{elem[i].style.display='none';}
	else if(elem[i].getAttribute('exp23')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp24')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp25')=="yes") 
		{elem[i].style.display='none';} 
	} 
for (var i =0;i<elem.length;i++) 
	{ 
	if(elem[i].getAttribute(strAttribute)=="yes") 
		{ 
		elem[i].style.display=='none'? elem[i].style.display='block':elem[i].style.display='none'; 
		} 
	} 
} 

function col(strTag ,strAttribute){ 
var elem = document.getElementsByTagName(strTag); 
for (var i =0;i<elem.length;i++) 
	{ 
	if(elem[i].getAttribute('exp1')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp2')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp3')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp4')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp5')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp6')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp7')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp8')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp9')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp10')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp11')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp12')=="yes") 
		{elem[i].style.display='none';}
	else if(elem[i].getAttribute('exp13')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp14')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp15')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp16')=="yes") 
		{elem[i].style.display='none';}
	else if(elem[i].getAttribute('exp17')=="yes") 
		{elem[i].style.display='none';}
	else if(elem[i].getAttribute('exp18')=="yes") 
		{elem[i].style.display='none';}
	else if(elem[i].getAttribute('exp19')=="yes") 
		{elem[i].style.display='none';}
	else if(elem[i].getAttribute('exp20')=="yes") 
		{elem[i].style.display='none';}
	else if(elem[i].getAttribute('exp21')=="yes") 
		{elem[i].style.display='none';}
	else if(elem[i].getAttribute('exp22')=="yes") 
		{elem[i].style.display='none';}
	else if(elem[i].getAttribute('exp23')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp24')=="yes") 
		{elem[i].style.display='none';} 
	else if(elem[i].getAttribute('exp25')=="yes")
		{elem[i].style.display='none';} 
	} 
}
function showVideoMAC(path,title)
{
	var sPath = (path == null) ? 'none' : path;
	var sTitle = (title == null) ? 'none' : title;
	if ((sPath == 'none' || sPath == '') || (sTitle == 'none' || sTitle == ''))
	{
		var mySwf = document.getElementById('myVideoSpace');
		mySwf.innerHTML='<div style="WIDTH:400px; text-align:center; background:#ef5227; font-weight:bold; color:#ffffff; HEIGHT:355px;">Error Loading Selected Flash File</div>';
		var myVN = document.getElementById('vidFooter');
		myVN.innerHTML = "Problem Loading Selected File.";
	}
	else
	{
		var mySwf = document.getElementById('myVideoSpace');
		mySwf.innerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH="400" HEIGHT="355" id="ShockwaveFlash1" VIEWASTEXT><param name="wmode" value="transparent"><param NAME="movie" VALUE="' + sPath + '.swf?r=' + Math.round(Math.random() * 99999) + '"><param NAME="menu" VALUE="false"><param NAME="quality" VALUE="high"><embed wmode="transparent" src="/flash/inthenews/' + sPath + '.swf?r=' + Math.round(Math.random() * 99999) + '" menu="false" quality="high" scale="exactfit" bgcolor="transparent" WIDTH="400" HEIGHT="355" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></object>';
		var myVN = document.getElementById('vidFooter');
		myVN.innerHTML = sTitle;
	}	
}

function showVideo2()
{
	var myVidName = new Array('WBFF: Pre-Natal Yoga At MAC Wellness','WBFF: Get Fit With FOX','FOX45: Get Ready For Summer With MAC!','Lisa Burdette: Getting Started With MAC Wellness','WBAL: Nutrition Labels with Laurie Badolato','WBFF: New MAC Athletic Center','WMAR-TV Grand Opening of Harbor East featuring Mayor Sheila Dixon','WBAL-TV Nutrition and Exercise for the entire family: featuring Laurie Badalato, nutritionist and Steven Ehasz, Fitness Director','Harbor East WBAL-TV Swimming for Fitness');
	var selectedVideo;
	var myOption;
	selectedVideo = document.getElementById('videoOption');
	myOption = selectedVideo.options[videoOption.options.selectedIndex].value;
	if (myOption != 'notValid')
	{
		var mySwf = document.getElementById('myVideoSpace');
		mySwf.innerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH="400" HEIGHT="355" id="ShockwaveFlash1" VIEWASTEXT><param name="wmode" value="transparent"><param NAME="movie" VALUE="/flash/inthenews/' + myOption + '.swf?r=' + Math.round(Math.random() * 99999) + '"><param NAME="menu" VALUE="false"><param NAME="quality" VALUE="high"><embed wmode="transparent" src="/flash/inthenews/' + myOption + '.swf?r=' + Math.round(Math.random() * 99999) + '" menu="false" quality="high" scale="exactfit" bgcolor="transparent" WIDTH="400" HEIGHT="355" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></object>';
		var myVN = document.getElementById('vidFooter');
		myVN.innerHTML = myVidName[videoOption.options.selectedIndex - 1];
	}
	else
	{
		var myVN = document.getElementById('vidFooter');
		myVN.innerHTML = "Select A Video From The Drop-Down List";
	}	
}

function showVideo3(passedFlash,num)
{
	var myVidName = new Array('WBFF: Pre-Natal Yoga At MAC Wellness','WBFF: Get Fit With FOX','GET READY FOR SUMMER with trainer Dominic Sessa','GET STARTED AT THE MAC with owner Liz Rhode','WBAL: Nutrition Labels with Laurie Badolato','WBFF: New MAC Athletic Center','WMAR-TV Grand Opening of Harbor East featuring Mayor Sheila Dixon','WBAL-TV Nutrition and Exercise for the entire family: featuring Laurie Badalato, nutritionist and Steven Ehasz, Fitness Director','Harbor East WBAL-TV Swimming for Fitness','Get Fit With Fox: Steve Ehasz','Get Fit With Fox: Dominic Sessa','CBS 13: Yoga With Melisa Deane','Harbor East Promo Spot');
	if (passedFlash != "")
	{
		var mySwf = document.getElementById('myVideoSpace');
		mySwf.innerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH="400" HEIGHT="355" id="ShockwaveFlash1" VIEWASTEXT><param name="wmode" value="transparent"><param NAME="movie" VALUE="/flash/inthenews/' + passedFlash + '.swf?r=' + Math.round(Math.random() * 99999) + '"><param NAME="menu" VALUE="false"><param NAME="quality" VALUE="high"><embed wmode="transparent" src="/flash/inthenews/' + passedFlash + '.swf?r=' + Math.round(Math.random() * 99999) + '" menu="false" quality="high" scale="exactfit" bgcolor="transparent" WIDTH="400" HEIGHT="355" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></object>';
		var myVN = document.getElementById('vidFooter');
		myVN.innerHTML = myVidName[num];
	}
	else
	{
		var myVN = document.getElementById('vidFooter');
		myVN.innerHTML = "Select A Video From The Drop-Down List";
	}	
}
var intRun = 0;
function randTimer()
{
	if(intRun == 0)
	{
		setInterval("doChange()",0)
		intRun = 1;
	}
	else
	{
		setInterval("doChange()",5000)
	}
}
function changeLnI()
{
	var bSpace = document.getElementById("randButton");
	var r = (Math.floor(Math.random()*9));
	//alert(r);
	var rLink = new Array();
	var rImg = new Array();
	var rTxt = new Array();
	var bURL = "/trainerfinder/websites/60046"
	var bImg = "/_images/randomImg/";
	var ID_Name = "name='Rimg' id='Rimg'";
	var wh = "width='250' height='86'";
	rLink[0] = bURL + "/programs/weightmanagement.html"
	rLink[1] = bURL + "/programs/personaltraining.html"
	rLink[2] = bURL + "/programs/personaltraining.html"
	rLink[3] = bURL + "/programs/aquatics.html"
	rLink[4] = bURL + "/programs/weightmanagement.html"
	rLink[5] = bURL + "/programs/weightmanagement.html"
	rLink[6] = bURL + "/programs/weightmanagement.html"
	rLink[7] = bURL + "/downloads/PhysicalActiveflyer2.pdf"
	rLink[8] = "http://www.coalitionforahealthymaryland.org/' target='_blank"
	rImg[0] = "LoseWeight_";
	rImg[1] = "PT_Buy10_";
	rImg[2] = "PT_3for99_";
	rImg[3] = "SwimYearRound_"
	rImg[4] = "EatLess_"
	rImg[5] = "PantsSizes_"
	rImg[6] = "Muscleandfat_"
	rImg[7] = "GettingExercise_"
	rImg[8] = "CoalitionButton_"
	rTxt[0] = "Lose weight in 6 weeks";
	rTxt[1] = "Buy 10 Personal Training sessions, get the 11th free!";
	rTxt[2] = "3 Personal Training sessions for $99";
	rTxt[3] = "Swim Year-Round at the MAC!";
	rTxt[4] = "Do you have to eat less to lose weight?"
	rTxt[5] = "Can you actually drop 2 pant-sizes?"
	rTxt[6] = "Does muscle REALLY weigh more than fat?"
	rTxt[7] = "Are You Getting Enough Exercise?"
	rTxt[8] = "MAC Supports: Coalition for a Healthy Maryland"
	var iOn = 1;
	var iOff = 0;
	var eJ = ".jpg"
	var eG = ".gif"
	var eP = ".png"
	var mOver = " onmouseover=\"Rimg.src=\'" +  bImg + rImg[r] + iOn + eJ + "\';\" ";
	var mOut =  " onmouseout=\"Rimg.src=\'" +  bImg + rImg[r] + iOff + eJ + "\';\" ";
	var myStr = "<a href='" + rLink[r] + "' style='float:left; margin-left:40px;' " + mOver + mOut + "><img src='" + bImg + rImg[r] + iOff + eJ + "' " + wh + " alt='" + rTxt[r] + "' border='0' " + ID_Name + " /></a>";
	bSpace.innerHTML = myStr;
}
//-->
