window.onload=init;

function init() {
	hover();
}

// JavaScript Document
if(document.images){
Nav01Roll = new Image();
Nav01Roll.src = "../images/nav5-roll.gif";
Nav01Off = new Image();
Nav01Off.src = "../images/nav5.gif";
}

function imgRoll(n){
	if(document.getElementById(n+"Link")){document.getElementById(n+"Link").src = eval(n+"Roll").src}
}

function imgOff(n){
	if(document.getElementById(n+"Link")){document.getElementById(n+"Link").src = eval(n+"Off").src}
}


function openWin(url, winwidth, winheight, name, scroll) {

	if(screen.width<=800){
	winwidth=winwidth+20;
	winheight=screen.height;
	scroll=1;
	}
	
	var ie = navigator.appName;
	var seven = navigator.appVersion;
	
	//if(ie.indexOf("Internet Explorer")!=-1 && seven.indexOf("MSIE 7")!=-1){
		if(screen.height<=850){
			winwidth=winwidth+20;
			winheight=screen.height;
			scroll = 1;
		}
	//}

	if (scroll == 1) {
		var scrolling = 'scrollbars\,';
	} else {
		var scrolling = '';
	}
	var window_left = (screen.width-winwidth)/2;
	var window_top = (screen.height-winheight)/2;
	
	window.open(url,name,'width='+winwidth+',height='+winheight+',left='+window_left+',top='+window_top+','+scrolling+'\'');
}


function closeWin(){
	opener.document.location.href="/";
	self.close();
}


// FLASH DETECTION

function flashDetect(){
	
	var flashinstalled = 0;
	var flashversion = 0;
	
	MSDetect = "false";
	
	if (navigator.plugins && navigator.plugins.length)
	{
		x = navigator.plugins["Shockwave Flash"];
		if (x)
		{
			flashinstalled = 2;
			if (x.description)
			{
				y = x.description;
				flashversion = y.charAt(y.indexOf('.')-1);
			}
		}
		else
			flashinstalled = 1;
		if (navigator.plugins["Shockwave Flash 2.0"])
		{
			flashinstalled = 2;
			flashversion = 2;
		}
	}
	else if (navigator.mimeTypes && navigator.mimeTypes.length)
	{
		x = navigator.mimeTypes['application/x-shockwave-flash'];
		if (x && x.enabledPlugin)
			flashinstalled = 2;
		else
			flashinstalled = 1;
	}
	else
		flashversion=vbsGetFlashVersion();
		
//	return flashversion;
	
	if (flashversion>7) 
	{
		document.getElementById("flash8-notpresent").style.display = "none";
		document.getElementById("flash8-present").style.display = "block";
	} 
	else
	{
		document.getElementById("flash8-present").style.display = "none";
		document.getElementById("flash8-notpresent").style.display = "block";
	}
}



// insight for flash
function ixtracking(mep1){
	
	var if_Site_ID = "ftbusiness";
	var if_sid="18";
	
	//var if_protocol=window.location.protocol;
	
	var if_tag = "<script language='JavaScript' " + "defer src=http" + "://a248.e.akamai.net/7/836/1132/102403/"+ if_Site_ID +".247realmedia.com/scripts/" + if_Site_ID + "_if.js" + "></scr" +"ipt>";
	//alert(if_tag);
	//var mep1="&test=yes&UserStatus=not_logged_in&Section=Homepage&Title="+document.title;""
	
	document.write(if_tag);
}


function hover() {
	var wrapper;
	if (wrapper = document.getElementById("workout-wrapper"))
	{
		for(var i=0;i<wrapper.childNodes.length;i++)
		{
			if(wrapper.childNodes[i].nodeType == 1)
			{
				wrapper.childNodes[i].onmouseover = function(){boxOn(this);}
				wrapper.childNodes[i].onmouseout = function(){boxOff(this);}
			}
		}
	}
}

function boxOn(box) {
	//box.setAttribute("class", "panel-workout-container box-hovered");
	//box.className = "panel-workout-container box-hovered";
}

function boxOff(box) {
	//box.setAttribute("class", "panel-workout-container");
	//box.className = "panel-workout-container";
}
var FC={$:function(id){var el=document.getElementById(id);return el;},getElementsByClassName:function(cls){var arr=new Array(),t=document.body.getElementsByTagName('*'),pattern=new RegExp("(^|\\s)"+cls+"(\\s|$)");for (var i=Number(0),j=Number(0),x=Number(t.length);i<x;i++){if (pattern.test(t[i].className)){arr[j]=t[i];j++;}}return arr;},createNode:function(id){var d=document.createElement("div"),b=document.body;d.id=id;d.className="flash";b.insertBefore(d,b.firstChild);},classSwitch:function(cls,val){var arr=this.getElementsByClassName(cls);for (var i=Number(0),x=Number(arr.length);i<x;i++){arr[i].style.display=val;};},checkId:function(id){if(this.$(id)){this.classSwitch("no-flash","none");this.classSwitch("flash-inline","inline");this.classSwitch("flash-block","block");}},deleteNode:function(id){document.body.removeChild(this.$(id));},init:function(){var t="tmp",swfId="swf-test",fo;this.createNode(t);fo=new FlashObject("/flash/temp.swf",swfId,"1","1","8","#ffffff");fo.write(t);this.checkId(swfId);this.deleteNode(t);}};
