/* Load style sheet */
// common styles for all browsers and platforms
var CssStyles = '<link rel="stylesheet" type="text/css" href="/site/RightForYou.css" />';

// get user's browser 
var UserAgent = navigator.userAgent.toLowerCase(); 

//alert("UserAgent = " + UserAgent); // test ***

if(CheckFor('msie')){ // Microsoft Internet Explorer
	
	var UserBrowser = "IE";	
	
}else if(CheckFor('safari')){ // Safari
	
	var UserBrowser = "Safari"
	
	// load Safari CSS style sheet
	CssStyles = CssStyles + '<link rel="stylesheet" type="text/css" href="/site/Safari.css">';	
	
}else{ // use FireFox for all other browsers
	
	var UserBrowser = "FireFox";
	
	// load FireFox CSS style sheet
	CssStyles = CssStyles + '<link rel="stylesheet" type="text/css" href="/site/FireFox.css">';	
	
}

// get user's platform 
if(CheckFor('mac')){ // Mac 
	
    UserPlatform = "Mac";
	
	// load Macintosh CSS style sheet
    CssStyles = CssStyles + '<link rel="stylesheet" type="text/css" href="/site/Mac.css">';
   
}else{ // use Windows platfrom for all others
	
    UserPlatform = "Win32";
	
}

document.write(CssStyles);

function CheckFor(string){ // returns the starting character position or -1 if not found
	
	position = UserAgent.indexOf(string) + 1;
	
	return position;
}

/****************************/

// Create ActiveX Control for Flash

// Internet Explorer changed how it handles ActiveX controls with:
// Flash, QuickTime, RealOne, Acrobat Reader, Java Virtual Machine, and Windows Media Player. 
// Users will no longer be able to directly interact with Microsoft ActiveX controls without first activating their user interfaces. 
// Developers can update their web pages for ActiveX controls to function without user interaction. 
// More info: http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/overview/activating_activex.asp

function FlashControl(
					   DivID, 
					   ClassID, 
					   CodeBase, 
					   Width, 
					   Height, 
					   Movie, 
					   Quality, 
					   FlashVars,
					   Menu, 
					   WMode, 
					   BgColor
		){

  var FlashObjectDiv = document.getElementById(DivID);
  
  // <div id="FlashObject"></div> replaces the <oject> and <embed> code on the originating page
  
  FlashObjectDiv.innerHTML = "" +

	
	"<object classid='" + ClassID  + 	
	"' codebase='" + CodeBase + 	
	"'    width='" + Width    + 	
	"'   height='" + Height   + "'>" +
	"<param name='movie'     value='" + Movie     + "' />" +
	"<param name='quality'   value='" + Quality   + "' />" +
	"<param name='flashvars' value='" + FlashVars + "' />" +
	"<param name='menu'      value='" + Menu      + "' />" +
	"<param name='wmode'     value='" + WMode     + "' />" +
	"<param name='bgcolor'   value='" + BgColor   + "' />" +
	"<embed   type='application/x-shockwave-flash'" +
	"' pluginspage='http://www.macromedia.com/go/getflashplayer'" +
	"'        menu='" + Menu    + 
	"'     bgcolor='" + BgColor + 
	"'     quality='" + Quality +
	"'   flashvars='" + FlashVars +
	"'         src='" + Movie   + 
	"'       wmode='" + WMode   + 
	"'       width='" + Width   + 
	"'      height='" + Height  + 
	"'>" +
	"</embed>";	
	"</object>";

}


// Changes height of the right and left divs

function ChangeDivHeight(){
		 
	 if( document.getElementById('LeftDiv').offsetHeight >= document.getElementById('RightDiv').offsetHeight)
	 {
	  // subtract top and bottom padding
	  document.getElementById('RightDiv').style.height = (document.getElementById('LeftDiv'  ).offsetHeight - 50) + "px";
	 }
	 else
	 {
	 document.getElementById('LeftDiv'  ).style.height = (document.getElementById('RightDiv').offsetHeight  - 25) + "px";
	 };
 }
 
 /***********************************************/