$(document).ready(function(){
	
	// external urls
	$('a').click(function(){
	    if(this.href.match(/^http/i) && !this.href.match(location.host)){
		    window.open(this.href,'_');
		    return false;
	    }
	});

	$('#home #flash').flash({
		src: '/interface/flash/home.swf',
		width: 960,
		height: 320,
		wmode : 'opaque',
		version: '8',
		flashvars: { wmode: 'opaque'}
	});

	$('#nav_global li').hover(function(){
		$(this).find('a:first').addClass('on');
	},
	function(){
		$(this).find('a:first').removeClass('on');
	});

	$("#nav_global").superfish({
		delay:0,
		speed:'fast',
		autoArrows:false,
		dropShadows:false
	});

	$('#callout_news').cycle({
		fx: 'scrollHorz',
		speed: 'fast',
		next: '#news_next',
		prev: '#news_prev',
		timeout: 6000
	});

	$("select.trigger").change(function(){
		window.location = $(this).val();
	});

	$("input").clearField();
});

// open pdf files in new window
$("a[@href$=pdf]").each(function() {
	$(this).attr('target', '_blank');
});
// open doc files in new window
$("a[@href$=doc]").each(function() {
	$(this).attr('target', '_blank');
});
// open xls files in new window
$("a[@href$=xls]").each(function() {
	$(this).attr('target', '_blank');
});
// open ppt files in new window
$("a[@href$=ppt]").each(function() {
	$(this).attr('target', '_blank');
});


$.fn.clearField = function(){
	return this.focus(function() {
		if( this.value == this.defaultValue){
			this.value = "";
		}
	}).blur(function(){
		if( !this.value.length){
			this.value = this.defaultValue;
		}
	});
};

try {
	document.execCommand('BackgroundImageCache', false, true);
} catch(e) {}

// frameJammer_hp V2.0
if (self != top)     // frame buster
      top.location.replace(self.location);
 
function frameJammer_hp(){
      var framedPage = location.search;
      if (framedPage.length > 1){
            framedPage = framedPage.substring(1);
            var theSplit = framedPage.indexOf('~');
            var thePage = framedPage.substring(0,theSplit);
            var theFrame = framedPage.substring(theSplit+1);
            eval("top."+theFrame+".location.replace('"+ thePage+"')");}
      }
 
var agt = navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_iemacdud = (agt.indexOf('msie')!=-1) && (agt.indexOf('mac')!=-1) && (is_major < 4);
if (is_iemacdud){setTimeout('frameJammer_hp()',1500);}   
// frameJammer_hp End