//$Id: timeline.js,v 1.2 2007/10/01 18:07:16 ghoffman Exp $
//$Source: /bbsrc/web/docs/abouten/jscommon/timeline.js,v $
//$Revision: 1.2 $
 
function putFlash(swif,wth,ht) {
								   
	var tpid = swif;
	var ttxt = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+wth+'" height="'+ht+'" id="tl" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="/flashfiles/'+swif+'.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#FFFFFF" /><embed src="/flashfiles/'+swif+'.swf" quality="high" bgcolor="#FFFFFF" width="'+wth+'" height="'+ht+'" name="tl" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
    
	var ll = (document.getElementById)? document.getElementById(tpid): (document.all)? document.all[tpid]: (document.layers)? document.layers[tpid]: null;
	if (!ll) return;
	if (typeof ll.innerHTML!="undefined") {
		ll.innerHTML = ttxt;
	} else if (document.layers) {
		ll.document.write(ttxt);
		ll.document.close();
	}
}

function openpopWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}


//FLASH DETECT
// only edit the following variables
var requiredVersion = 5;			
var maxVersion = 9;
// ********************************


// no touch for you	
var gotFlash2 = false;	
var gotFlash3 = false;
var gotFlash4 = false;
var gotFlash5 = false;
var gotFlash6 = false;
var gotFlash7 = false;
var gotFlash8 = false;
var gotFlash9 = false;
var actualVersion = null;		
var rightVersion = false;	
var ie = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var win = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;
// ********************************


if (ie && win) { 
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('gotFlash2 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
	document.write('gotFlash3 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
	document.write('gotFlash4 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
	document.write('gotFlash5 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');
	document.write('gotFlash6 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');
	document.write('gotFlash7 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');
	document.write('gotFlash8 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n');	
document.write('gotFlash9 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9"))) \n');
	document.write('<\/SCR' + 'IPT\> \n'); 
}

function gotFlash() {	
	if (navigator.plugins) {								
		if ((navigator.plugins["Shockwave Flash 2.0"]) || (navigator.plugins["Shockwave Flash"])) {	
			var ver2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDesc = navigator.plugins["Shockwave Flash" + ver2].description;
			var curVersion = parseInt(flashDesc.charAt(flashDesc.indexOf(".") - 1));
			gotFlash2 = curVersion == 2;		
			gotFlash3 = curVersion == 3;
			gotFlash4 = curVersion == 4;
			gotFlash5 = curVersion == 5;
			gotFlash6 = curVersion == 6;
			gotFlash7 = curVersion == 7;
			gotFlash8 = curVersion == 8;
			gotFlash9 = curVersion == 9;
		}
	}
	for (var i = 2; i <= maxVersion; i++) {	
		if (eval("gotFlash" + i) == true) {
			actualVersion = i;
		}
	}
	if (actualVersion >= requiredVersion) {
		rightVersion = true;
	}	
}

gotFlash();



//*************** Top Navigation Javascript Code *************************************//

//Preload navigation rollover images
var myimages=new Array()
function preloadimages(){
for (i=0;i<preloadimages.arguments.length;i++){
myimages[i]=new Image()
myimages[i].src="http://images.bloomberg.com/abouten/"+preloadimages.arguments[i]+".gif";
}
}
preloadimages("bprof_blk","bn_blk","careers_blk","gcs_blk","bprof_blu","bn_blu","careers_blu","gcs_blu","bprof_oj_side","bn_oj_side","careers_oj_side","gcs_oj_side","bprof_oj_und","bn_oj_und","careers_oj_und","gcs_oj_und")


//simple rollover function
function roll_over(img_name, img_src)
   {
   document[img_name].src = img_src;
   }
   

		var df = 'blank';
		
		function AllOff(){		
			if (document.all) {			
			
				document.all['news'].style.display = 'none';	
				document.all['bbprof'].style.display = 'none';
				document.all['careers'].style.display = 'none';
				document.all['contact'].style.display = 'none';	
				document.all['blank'].style.display = 'none';	
								
				}
				
				
				
			else if (document.getElementById)	{		
			document.getElementById('news').style.display = 'none';	
			document.getElementById('bbprof').style.display = 'none';
			document.getElementById('careers').style.display = 'none';	
			document.getElementById('contact').style.display = 'none';
			document.getElementById('blank').style.display = 'none';	
							
												}
			
		}	

		function displayOn(nr){	
		 	AllOff();	
			if (document.all)		
			document.all[nr].style.display = 'block';
			
		else if (document.getElementById)			
			document.getElementById(nr).style.display = 'block';	
		}	
		
		
		function displaySet(nr){
			AllOff();		
			if (document.all)	{		
			document.all[nr].style.display = 'block';	
			df = nr; 
			}	
		else if (document.getElementById)  {			
			document.getElementById(nr).style.display = 'block';	
			df = nr; 
			}
		}	
		
				
		function displayDefault(nr){
			AllOff();		
			if (document.all)
					document.all[nr].style.display = 'block';
			     	        
		else if (document.getElementById)			
			document.getElementById(nr).style.display = 'block';	
		}	
		
	
		
if (document.images) {
     image0 = new Image();
     image0.src = "http://images.bloomberg.com/abouten/bprof_blu.gif";
	 
	 image1 = new Image();
     image1.src = "http://images.bloomberg.com/abouten/bn_blu.gif";
	 
	 image2 = new Image();
     image2.src = "http://images.bloomberg.com/abouten/careers_blu.gif";
	 
	 image3 = new Image();
     image3.src = "http://images.bloomberg.com/abouten/gcs_blu.gif";
	 
}

var blackimage = new Array(4);
var blueimage = new Array(4);
var orangeimage = new Array(4);
var orangeulimage = new Array(4);
var status= new Array(4);

blackimage[0] = "http://images.bloomberg.com/abouten/bprof_blk.gif";
blackimage[1] = "http://images.bloomberg.com/abouten/bn_blk.gif";
blackimage[2] = "http://images.bloomberg.com/abouten/careers_blk.gif";
blackimage[3] = "http://images.bloomberg.com/abouten/gcs_blk.gif";


blueimage[0] = "http://images.bloomberg.com/abouten/bprof_blu.gif";
blueimage[1] = "http://images.bloomberg.com/abouten/bn_blu.gif";
blueimage[2] = "http://images.bloomberg.com/abouten/careers_blu.gif";
blueimage[3] = "http://images.bloomberg.com/abouten/gcs_blu.gif";


orangeimage[0] = "http://images.bloomberg.com/abouten/bprof_oj_side.gif";
orangeimage[1] = "http://images.bloomberg.com/abouten/bn_oj_side.gif";
orangeimage[2] = "http://images.bloomberg.com/abouten/careers_oj_side.gif";
orangeimage[3] = "http://images.bloomberg.com/abouten/gcs_oj_side.gif";


orangeulimage[0] = "http://images.bloomberg.com/abouten/bprof_oj_und.gif";
orangeulimage[1] = "http://images.bloomberg.com/abouten/bn_oj_und.gif";
orangeulimage[2] = "http://images.bloomberg.com/abouten/careers_oj_und.gif";
orangeulimage[3] = "http://images.bloomberg.com/abouten/gcs_oj_und.gif";


status[0]=false; 
status[1]=false;
status[2]=false;
status[3]=false;



//var img_path = "http....";
function clicked_nav(img_clicked, imgNumber) {

	// Check for clicked images and turn off
	for (var x=0; x<5; x++) {
		if (status[x] == true) {
			var temp = "image" + x;
  			document [temp].src = blackimage[x];
			//document [temp].src = eval(img_path + "image" + x + "white.src");
			status[x] = false;
		} 
	} 
	//set the clicked image
	
	document [img_clicked].src = orangeimage[imgNumber];
	status[imgNumber] = true;
	                    
	

}

function mouseOutNav(img_clicked, imgNumber){

	if (status[imgNumber] != true) {
		document [img_clicked].src = blackimage[imgNumber];
	}

}

function mouseOnNav(img_clicked, imgNumber){

	if (status[imgNumber] != true) {
		document [img_clicked].src = blueimage[imgNumber];
		
		}
	}
	
	
	
function oju(imgNumber) {

	// Check for clicked image and give oj und
	
	
	for (var x=0; x<5; x++) {
	   
	   if ((status[x] && status[imgNumber]) != true) {
		if (status[x] == true) {
			var temp = "image" + x;
			document [temp].src = orangeulimage[x];
			                                    
			//document [temp].src = eval(img_path + "image" + x + "white.src");
		}	
		}
		
	} 
	}
	
	function ojuo() {

	// Check for clicked image and give oj und
	for (var x=0; x<5; x++) {
		if (status[x] == true) {
			var temp = "image" + x;
  			document [temp].src = orangeimage[x];
			//document [temp].src = eval(img_path + "image" + x + "white.src");
			
		} 
	} 
	}


//*************** END of Top Navigation Javascript Code ******************************//