$(document).ready(function() {
	flash();
	titles();	
	$("#topimg").hide();
	$("#topimg").fadeIn(1000);
})

flashinstalled = false;
if (navigator.plugins && navigator.plugins.length) {
	for (x=0; x < navigator.plugins.length; x++) {
		if (navigator.plugins[x].name.indexOf('Shockwave Flash') != -1) {
			flashinstalled = true;
		}
	}
}
else if (window.ActiveXObject) {
	for (x = 2; x <= 20; x++) {
		try {
			oFlash = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + x + "');");
			if(oFlash) {
				flashinstalled = true;
			}
		}
		catch(e) {}
	}
}

function flash() {
	if(flashinstalled) {				
		var swf = '<embed src="inc/pit3.swf" width="950" height="300"  type="application/x-shockwave-flash" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" />';		
		$("#hero").html(swf);		
	} else {
		$("#hero").html('<img src="inc/hero_4.jpg" alt=""/>');	
	}
}

function titles() {
	if(flash) {	
		$("h1.replace").each(function() {                   
	     	$(this).html('<b class="hide">'+$(this).text()+'</b><embed src="inc/title.swf?txt='+$(this).text()+'" width="540" height="35"  type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />')
	    })	
	}	
}