$(document).ready(function(){
	$('ul#nav_primary li').hover(function(){
		$(this).find('a:first').addClass('active');
	},
	function(){
		$(this).find('a:first').removeClass('active');
	});
	$('ul#nav_primary2 li').hover(function(){
		$(this).find('a:first').addClass('active');
	},
	function(){
		$(this).find('a:first').removeClass('active');
	});

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

	$("#keywords input").clearField();

	$("#filter select#cat").change(function(){
		window.location = $("select#cat").val(); 
	});
	$("#filter select#date").change(function(){
		window.location = $("select#date").val(); 
	});
	
	$('#employee_flash').flash(
		{ 
			src: '/interface/flash/careers.swf',
			width: 730,
			height: 233,
			wmode: "transparent"
		},
		{
			version: '9'
		}
	);

	$('#structure_flash').flash(
		{ 
			src: '/interface/flash/structure.swf',
			width: 725,
			height: 450,
			wmode: "transparent"
		},
		{
			version: '9'
		}
	);

	//$("a[@href^='http']").not("[@href*=http://www.pepperdigital.com]").not("[@href*=http://pepperdigital.com]").not("[href^=#]").addClass("external").attr('target','_blank');
	$("a[rel='external']").addClass("external").attr('target','_blank');
	
	$('input[type="text"]').clearField();
});

var thesans6 = {
	src: '/interface/flash/thesans6.swf'
	,ratios: [7, 1.32, 11, 1.31, 13, 1.24, 14, 1.25, 19, 1.23, 27, 1.2, 34, 1.19, 42, 1.18, 47, 1.17, 48, 1.18, 69, 1.17, 74, 1.16, 75, 1.17, 1.16]
};
var thesans7 = {
	src: '/interface/flash/thesans7.swf'
	,ratios: [7, 1.32, 11, 1.31, 13, 1.24, 14, 1.25, 19, 1.23, 27, 1.2, 34, 1.19, 42, 1.18, 47, 1.17, 48, 1.18, 69, 1.17, 74, 1.16, 75, 1.17, 1.16]
};

sIFR.activate(thesans6,thesans7);

sIFR.replace(thesans6,{
	selector: '#home h1'
	,wmode: 'transparent'
	,css: [
	'.sIFR-root {color:#0F9FD9;letter-spacing:-1;}'
	]
});
sIFR.replace(thesans7,{
	selector: '#webcast #webcast_inner #webcast_detail h3'
	,wmode: 'transparent'
	,css: [
	'.sIFR-root {color:#17A4E0;letter-spacing:-1;},a{color:#17A4E0;text-decoration:none;},a:hover{color:#182363;}'
	]
});
sIFR.replace(thesans6,{
	selector: 'h1'
	,wmode: 'transparent'
	,css: [
	'.sIFR-root {color:#182363;letter-spacing:-1;}'
	]
});
sIFR.replace(thesans7,{
	selector: '#footer #footer_main .footer_feature_pic h2'
	,wmode: 'transparent'
	,css: [
	'.sIFR-root {color:#ffffff;letter-spacing:-1;}'
	]
});
sIFR.replace(thesans7,{
	selector: '#investor #main #inner h2'
	,wmode: 'transparent'
	,css: [
	'.sIFR-root {color:#0FA4DE;letter-spacing:-1;}'
	]
});
sIFR.replace(thesans7,{
	selector: 'h2'
	,wmode: 'transparent'
	,css: [
	'.sIFR-root {color:#182363;letter-spacing:-1;}'
	]
});

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

function privacyWin(){
	OpenWin = this.open("http://online.hemscottir.com/legal/privacy_policy.htm", "CtrlWindow", "toolbar=no,menubar=no,height=500,width=640,location=no,scrollbars=yes,resizable=no,status=no,left=100,top=100");
}