//++ 
// include other scripts
//++ 


//++ 
// sIFR
//++

//sIFR.delayCSS  = true;
// var sans = { src: GE_baselink + 'html_view/flash/sans.swf' };
// sIFR.useStyleCheck = true;
// sIFR.activate(sans);
// sIFR.replace(sans, { selector: '.splash_content .page_title', wmode: 'transparent', css: {'.sIFR-root': {'color': '#666666','leading':'-1','font-size':'24px'} } });
// sIFR.replace(sans, { selector: '.splash_content p', wmode: 'transparent', css: {'.sIFR-root': {'color': '#505060','leading':'8','font-size':'17px'} } });


//++ 
// print links
//++
GE_Main.mapCSSToFn('bhv_print',
	function(el) {
      $(el).observe("click", function(e) {
         window.print();
		 e.stop();
      })
	}
);


//++ 
// fix for omniture image showing up
//++ 

GE_Main.addInitFn( function() { var imgEl = $('ge_footer').nextSiblings().each( function(el) { el.hide() }) });


//++ 
// external linking functionality
//++ 
function GE_makeExternalLink(link) {
 if (link.readAttribute('title')) {
  if ( link.readAttribute('title').indexOf('(opens in new window)') < 0 ) {
   link.writeAttribute('title',link.readAttribute('title')+' (opens in new window)');
  }
 }
 link.observe('click', function(e){
  if (/MSIE/i.test(navigator.userAgent)) {
   this.writeAttribute('target','_blank');
  } else {
   window.open(this.readAttribute('href'), 'ge_external_link');
   e.stop();
  }
 });
}
//open external links in new window 90% of the size of current window
GE_Main.mapCSSToFn('external_link', GE_makeExternalLink);

// (ryan.rowe@frogdesign.com) class the appropriate external links with the bhv_external class for the function above
GE_Main.addInitFn( function() {

	//if (document.location.href.match("https://")) return;

	var exclude_list = new Array();
	//add to the exclude list below by pushing new strings onto the array
	//exclude_list.push("://www.genewscenter.com/");
	exclude_list.push("://ir.10kwizard.com");
	exclude_list.push("://genewscenter.com/");
	exclude_list.push("://www.ge.com/");
	exclude_list.push("://files.gecompany.com/");

	//also part of the exclude list: download links for videos, audio and pdfs
	//exclude_list.push(".pdf");
	exclude_list.push(".m4v");
	exclude_list.push(".mp3");
	var elen = exclude_list.length;

	var links = document.links;
	var i = links.length;
	while(i--) {
		var link = $(links[i]);

		var url = link.readAttribute("href");
		if( url.match("://") ){ //only if we match the http(s):// absolute link indicator
			var externalFlag = true; //guilty until proven innocent

			var j = elen;
			while(j--) {
				if(url.match(exclude_list[j])) {
					if(!(url.match(".pdf"))){
						var externalFlag = false; //innocent!
						break;
					}
				}
			}

			if(externalFlag) {
				GE_makeExternalLink(link);
			}
		}
		else
			{
				if(url.match(".pdf"))
					{
					GE_makeExternalLink(link);
					}
			}
	}
});

