

function addYouTubeEmbed(sId, videoId){
	var vidTarget = document.getElementById(sId);
	vidTarget.innerHTML = "<embed type='application/x-shockwave-flash' src='http://www.youtube.com/v/" + videoId + "' width='320' height='255'></embed>";
}

function popup(url, height, width){
MyNewWindow=window.open(url, 'newWindown', "HEIGHT="+height+",WIDTH="+width+",resizable=1'");//(url,name,settings);
MyNewWindow.focus();
}
function addFlashEmbed(sId, uri, width, height){
	var flTarget = document.getElementById(sId);
	flTarget.innerHTML = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='" + width + "' height='" + height + "'><param name='movie' value='" + uri + "'><param name='quality' value='high'><embed src='" + uri + "' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" + width + "' height='" + height + "'></object>";
}
function getObject(name) { 
   var ns4 = (document.layers) ? true : false; 
   var w3c = (document.getElementById) ? true : false; 
   var ie4 = (document.all) ? true : false; 

   if (ns4) return eval('document.' + name); 
   if (w3c) return document.getElementById(name); 
   if (ie4) return eval('document.all.' + name); 
   return false; 
}
var IE = document.all?true:false
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;
var tempX = 0
var tempY = 0
function getMouseXY(e) {
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft
	tempY=event.clientY+document.documentElement.scrollTop;// IE6 +4.01 but no scrolling going on
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
  }  
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
  var tooltip=getObject('tooltip')
  if(tooltip.style.visibility=='visible'){
	tooltip.style.left=(tempX)+"px";
	tooltip.style.top=(tempY+21)+"px";
  	
  }
  return true;
}
function legendtooltips(i, n){
	node = n
	var tooltip=getObject('tooltip')
	tooltip.innerHTML=i;
	tooltip.style.visibility='visible';
	tooltip.style.zindex=100;
	tooltip.style.position='absolute';

	tooltip.style.left=(tempX-55)+"px";
	tooltip.style.top=(tempY+24)+"px";
}
function removelegendtooltips(){
	var tooltip=getObject('tooltip')
	tooltip.style.visibility='hidden';
}

var global_i=0;
function changeheader(ele, text, i){
	global_i=i;
	setTimeout("changeheader_time('"+ele+"','"+text+"')",1);
	//changeheader_time(ele, text);
	//if(i==6)alert(i)
}
function changeheader_time(ele, text){
	i=global_i;
	//getObject('asdf').innerHTML=i;//alert(i)
		getObject('mediabubble').src='img/index_media_up.gif';
		getObject('mediabubbletext').className='frontheader';
		getObject('threedpic').src='img/3dpic_up.jpg';
		getObject('pointbubble').src='img/index_3d_up.gif';
		getObject('pointbubbletext').className='frontheader';
		getObject('communitybubble').src='img/index_community_up.gif';
		getObject('communitybubbletext').className='frontheader';
		
	if(i==0){
		getObject('mediabubble').src='img/index_media_down.gif';
		getObject('mediabubbletext').className='frontheader_down';
	}
	else if(i==1){
		getObject('mediabubble').src='img/index_media_up.gif';
		getObject('mediabubbletext').className='frontheader';
	}
	else if(i==2){
		getObject('threedpic').src='img/3dpic_down.jpg';
		getObject('pointbubble').src='img/index_3d_down.gif';
		getObject('pointbubbletext').className='frontheader_down';
	}
	else if(i==3){
		getObject('threedpic').src='img/3dpic_up.jpg';
		getObject('pointbubble').src='img/index_3d_up.gif';
		getObject('pointbubbletext').className='frontheader';
	}
	else if(i==4){
		getObject('communitybubble').src='img/index_community_down.gif';
		getObject('communitybubbletext').className='frontheader_down';
	}
	else if(i==5){
		getObject('communitybubble').src='img/index_community_up.gif';
		getObject('communitybubbletext').className='frontheader';
	}
	else if(i==6){
		//alert(i)
		getObject('mappic').src='img/archivepic_down_01.jpg';
		getObject('communitybubbletext').className='frontheader';
	}
}
var global_i2=0;
function changeheader_media(i){
	global_i2=i;
	//alert(i);
	setTimeout("changeheader_media_time('"+i+"')",10);
}
function changeheader_media_time(i){

	i=global_i2;
		getObject('media2').src='img/archivepic_up_03.jpg';
		getObject('media1').src='img/archivepic_up_02.jpg';
		getObject('media3').src='img/media.gif';
		getObject('mediatext').className="a_special";
		getObject('maptext').className="a_special";
		getObject('mappic').src='img/archivepic_up_01.jpg';
		getObject('map1').src='img/map.gif';
	if(i==1){
		//alert(getObject('media2').src)
		getObject('media2').src='img/archivepic_down_03.jpg';
		getObject('media1').src='img/archivepic_down_02.jpg';
		getObject('media3').src='img/sm_media_down.gif';
		getObject('mediatext').className="a_special_over";
	}	
	if(i==3){
		//alert(getObject('media2').src)
		getObject('mappic').src='img/archivepic_down_01.jpg';
		getObject('map1').src='img/sm_map_down.gif';
		getObject('maptext').className="a_special_over";
	}	

}


