
//++ 
// sIFR
//++

var GE_Inspira_Medium_refactor = { src: '/flash/GE_Inspira_Medium.swf' };
var GE_Inspira_refactor = { src: '/flash/GE_Inspira.swf' };
var Helv_refactor = { src: '/flash/helv_regular.swf' };
var Helv_Medium_refactor = { src: '/flash/helv_medium.swf' };
sIFR.setPrefetchCookie = false;
sIFR.useStyleCheck = true;
sIFR.activate(Helv_refactor,Helv_Medium_refactor);
sIFR.replace(Helv_refactor, { selector: '.quicklink', wmode: 'transparent', css: ['.sIFR-root { color: #969696;text-align: left;font-size:10px;leading:5;}','a { text-decoration: none; }','a:link { color: #969696; }','a:hover { color: #787878; }','strong { font-weight:bold;leading:0; }','b { font-weight:bold;leading:-1; }']});
sIFR.replace(Helv_refactor, { selector: '.copyright', wmode: 'transparent', css: ['.sIFR-root { color: #ffffff;text-align: left;font-size:11px;leading:-1;font-weight:bold;}','a { text-decoration: none; }','a:link { color: #ffffff; }','a:hover { color: #787878; }']});
sIFR.replace(Helv_refactor, { selector: '.sidebarlink', wmode: 'transparent', css: ['.sIFR-root { color: #000000;text-align: left;font-size:11px;leading:-1;font-weight:bold;}','a { text-decoration: none; }','a:link { color: #969696; }','a:hover { color: #787878; }']});
sIFR.replace(Helv_refactor, { selector: '.menulink', wmode: 'transparent', css: ['.sIFR-root { color: #FFFFFF;text-align: left;font-size:11px;leading:12;font-weight:bold;}','a { text-decoration: none;font-weight:normal; }','a:link { color: #FFFFFF; font-weight:normal;}','a:hover { color: #FFFFFF;font-weight:bold; }']});
sIFR.replace(Helv_Medium_refactor, { selector: '.showstaff_section', wmode: 'transparent', css: ['.sIFR-root { color: #e11a27;text-align: left;font-size:30px;leading:-1;}']});
sIFR.replace(Helv_refactor, { selector: '.showstaff_section', wmode: 'transparent', css: ['.sIFR-root { color: #e11a27;text-align: left;font-size:30px;leading:-1;}']});
sIFR.replace(Helv_refactor, { selector: '.showstaff_name', wmode: 'transparent', css: ['.sIFR-root { color: #505050;text-align: left;font-size:22px;leading:-1;}']});
sIFR.replace(Helv_refactor, { selector: '.showstaff_title', wmode: 'transparent', css: ['.sIFR-root { color: #505050;text-align: left;font-size:20px;leading:-1;}']});
sIFR.replace(Helv_refactor, { selector: '.showfaculty_section', wmode: 'transparent', css: ['.sIFR-root { color: #27BAFF;text-align: left;font-size:30px;leading:-1;}']});
sIFR.replace(Helv_refactor, { selector: '.academic_u_title', wmode: 'transparent', css: ['.sIFR-root { color: #1191CB;text-align: left;font-size:14px;leading:-1;}']});
sIFR.replace(Helv_refactor, { selector: '.studentlife_u_title', wmode: 'transparent', css: ['.sIFR-root { color: #B41A27;text-align: left;font-size:14px;leading:-1;}']});
sIFR.replace(Helv_refactor, { selector: '.tuition_u_title', wmode: 'transparent', css: ['.sIFR-root { color: #505050;text-align: left;font-size:16px;leading:-1;}','strong { color:#97C33A; }']});
sIFR.replace(Helv_refactor, { selector: '.tuition_not_u_title', wmode: 'transparent', css: ['.sIFR-root { color: #505050;text-align: left;font-size:16px;leading:-1;}','strong { color:#FF8418; }']});
sIFR.replace(Helv_refactor, { selector: '.calendar_content', wmode: 'transparent', css: ['.sIFR-root { color: #505050;text-align: left;font-size:16px;leading:20;}']});
sIFR.replace(Helv_refactor, { selector: '.calendar_title', wmode: 'transparent', css: ['.sIFR-root { color: #000000;text-align: left;font-size:24px;leading:18;font-weight:bold;}']});
sIFR.replace(Helv_refactor, { selector: '.chinacontact_title', wmode: 'transparent', css: ['.sIFR-root { color: #000000;text-align: left;font-size:16px;leading:2;}']});
sIFR.replace(Helv_refactor, { selector: '.academic_cv_title', wmode: 'transparent', css: ['.sIFR-root { color: #E11A27;text-align: left;font-size:14px;leading:-1;}']});
//sIFR.replace(Helv_refactor, { selector: '.showstaff_intro', wmode: 'transparent', css: ['.sIFR-root { color: #505050;text-align: left;font-size:13px;leading:-1;line-height:19px;}']});
//++ 
// print links
//++
GE_Main.mapCSSToFn('print_link',
	function(el) {
      $(el).observe("click", function(e) {
         window.print();
		 e.stop();
     })
	}
);


//++ 
// 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("://video.google.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(".flv");
	exclude_list.push(".mp3");
	exclude_list.push(".mp4");
	var elen = exclude_list.length;
	
	var exception_list = new Array();
	//List to add those cases that we want external inside of the exclude list elements
	exception_list.push(".pdf");
	exception_list.push("ar2007/");
	exception_list.push("ecoreport/");
	exception_list.push("fusion.google.com");
	exception_list.push("add.my.yahoo.com");
	exception_list.push("bloglines.com");
	exception_list.push("citizenship/");
	var exlen = exception_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;
			var k = exlen;
			while(j--) {// Loop looking for excluded links
				if(url.match(exclude_list[j])) {
					var externalFlag = false; //innocent!
					break;
				}

			}

			while(k--) {// Loop looking for exceptions
				if(url.match(exception_list[k])) {
					if (exception_list[k]=="citizenship/" || exception_list[k]=="foundation/") {
							if (url.match(".jsp")){
								var externalFlag = true; //guilty!
								break;
							}
						}
					else {
					var externalFlag = true; //guilty!
					break;
					}
				}
			}
			
			if(externalFlag) {
				GE_makeExternalLink(link);
			}
		}
		else
			{
				if(url.match(".pdf") || url.match("ar2007/") || url.match("/research/"))
					{
					GE_makeExternalLink(link);
					}
				if (url.match("citizenship/") || url.match("foundation/")) {
						if (url.match(".jsp")){
							GE_makeExternalLink(link);
						}
					}				
			}
	}
});

