$(function() {
 	$("body").addClass("js")
	
	if($.browser.msie && $.browser.version<7){
		var $pngs = $("img[src$='.png']");
		if($pngs.length>0){ $pngs.ifixpng(); }
	}
	
 	if($("#container").hasClass('media')){
 		var vid1='<object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/vASw3wBY_V4&amp;hl=en_GB&amp;fs=1?rel=0&amp;color1=0x2b405b&amp;color2=0x6b8ab6"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/vASw3wBY_V4&amp;hl=en_GB&amp;fs=1?rel=0&amp;color1=0x2b405b&amp;color2=0x6b8ab6" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>';
 		$(vid1).insertAfter("#content h2:eq(0)");
 		}
 	
	$("h1").each(function(){
			$t = $(this);
			/*var swfdir = "";
			var t_as = true;
			var t_w = "320";
			var t_a = "left";
			var t_t = encodeURIComponent(String($t.text()));
			var t_c = "0x000000";
			var t_h = "86";
			var t_s = 64;
			var swffont = "headings.swf";
			var newid = "swftext"+Math.floor(Math.random()*100000);
			$t.css('textIndent',"-999em");
			var swfvars = "as="+t_as+"&amp;w="+t_w+"&amp;a="+t_a+"&amp;t="+t_t+"&amp;c="+t_c+"&amp;h="+t_h+"&amp;s="+t_s;
			if($.browser.msie){
				var obj = "<object data=\""+swfdir+swffont+"\" id=\""+newid+"\" width=\""+t_w+"px"+"\" height=\""+t_h+"px"+"\" type=\"application/x-shockwave-flash\"><param name=\"type\" value=\"application/x-shockwave-flash\" /><param name=\"src\" value=\""+swfdir+swffont+"\" /><param name=\"data\" value=\""+swfdir+swffont+"\" /><param name=\"codebase\" value=\""+swfdir+swffont+"\" /><param name=\"movie\" value=\""+swfdir+swffont+"\" /><param name=\"quality\" value=\"high\" /><param name=\"wmode\" value=\"transparent\"><param name=\"pluginurl\" value=\"http://www.macromedia.com/go/getflashplayer\" /><param name=\"flashvars\" value=\""+swfvars+"\" /></object>";
			}else{
				var obj = "<object data=\""+swfdir+swffont+"\" id=\""+newid+"\" width=\""+t_w+"px"+"\" height=\""+t_h+"px"+"\" type=\"application/x-shockwave-flash\"><param name=\"type\" value=\"application/x-shockwave-flash\" /><param name=\"src\" value=\""+swfdir+swffont+"\" /><param name=\"data\" value=\""+swfdir+swffont+"\" /><param name=\"codebase\" value=\""+swfdir+swffont+"\" /><param name=\"movie\" value=\""+swfdir+swffont+"\" /><param name=\"quality\" value=\"high\" /><param name=\"wmode\" value=\"transparent\"><param name=\"pluginurl\" value=\"http://www.macromedia.com/go/getflashplayer\" /><param name=\"flashvars\" value=\""+swfvars+"\" /></object>";
			}
			$(obj).appendTo($t);*/
			var newid = "swftext"+$t.index()+Math.floor(Math.random()*100000);
			//$t.attr({id:newid});
			$t.append("<div id=\""+newid+"\"></div>");
			var w = 320; var h = 86;
			//$t.css('textIndent',"-999em");
			var swfvars = { as:false, a:"left", w:w, h:h, c:"0x000000", s:64, t:encodeURIComponent(String($t.text())) }
			swfobject.embedSWF("headings.swf", newid, w, h, "9.0.0", null, swfvars,{wmode:"transparent"}, null, function(e){ if(e.success==true){ $("#"+e.id).parent("h1").css('textIndent',"-999em"); } } );
			
	});

if($("#container").hasClass('media')){
 		var vid1='<object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/ptQkEGZPxZ4?fs=1&amp;hl=en_GB"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/ptQkEGZPxZ4?fs=1&amp;hl=en_GB" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>';
 		$(vid1).insertAfter("#content h2:eq(0)");
 		}
	
	$("h1").each(function(){
			$t = $(this);
			/*var swfdir = "";
			var t_as = true;
			var t_w = "320";
			var t_a = "left";
			var t_t = encodeURIComponent(String($t.text()));
			var t_c = "0x000000";
			var t_h = "86";
			var t_s = 64;
			var swffont = "headings.swf";
			var newid = "swftext"+Math.floor(Math.random()*100000);
			$t.css('textIndent',"-999em");
			var swfvars = "as="+t_as+"&amp;w="+t_w+"&amp;a="+t_a+"&amp;t="+t_t+"&amp;c="+t_c+"&amp;h="+t_h+"&amp;s="+t_s;
			if($.browser.msie){
				var obj = "<object data=\""+swfdir+swffont+"\" id=\""+newid+"\" width=\""+t_w+"px"+"\" height=\""+t_h+"px"+"\" type=\"application/x-shockwave-flash\"><param name=\"type\" value=\"application/x-shockwave-flash\" /><param name=\"src\" value=\""+swfdir+swffont+"\" /><param name=\"data\" value=\""+swfdir+swffont+"\" /><param name=\"codebase\" value=\""+swfdir+swffont+"\" /><param name=\"movie\" value=\""+swfdir+swffont+"\" /><param name=\"quality\" value=\"high\" /><param name=\"wmode\" value=\"transparent\"><param name=\"pluginurl\" value=\"http://www.macromedia.com/go/getflashplayer\" /><param name=\"flashvars\" value=\""+swfvars+"\" /></object>";
			}else{
				var obj = "<object data=\""+swfdir+swffont+"\" id=\""+newid+"\" width=\""+t_w+"px"+"\" height=\""+t_h+"px"+"\" type=\"application/x-shockwave-flash\"><param name=\"type\" value=\"application/x-shockwave-flash\" /><param name=\"src\" value=\""+swfdir+swffont+"\" /><param name=\"data\" value=\""+swfdir+swffont+"\" /><param name=\"codebase\" value=\""+swfdir+swffont+"\" /><param name=\"movie\" value=\""+swfdir+swffont+"\" /><param name=\"quality\" value=\"high\" /><param name=\"wmode\" value=\"transparent\"><param name=\"pluginurl\" value=\"http://www.macromedia.com/go/getflashplayer\" /><param name=\"flashvars\" value=\""+swfvars+"\" /></object>";
			}
			$(obj).appendTo($t);*/
			var newid = "swftext"+$t.index()+Math.floor(Math.random()*100000);
			//$t.attr({id:newid});
			$t.append("<div id=\""+newid+"\"></div>");
			var w = 320; var h = 86;
			//$t.css('textIndent',"-999em");
			var swfvars = { as:false, a:"left", w:w, h:h, c:"0x000000", s:64, t:encodeURIComponent(String($t.text())) }
			swfobject.embedSWF("headings.swf", newid, w, h, "9.0.0", null, swfvars,{wmode:"transparent"}, null, function(e){ if(e.success==true){ $("#"+e.id).parent("h1").css('textIndent',"-999em"); } } );
			
	});
	
	//swfobject.embedSWF("http://hermes/websites/_SOURCE/code/swfmplayer/swfmplayer.swf", "swfmplayer_obj", 280, 80, "9.0.0", "js/expressInstall.swf", null,{wmode:"transparent"});
	swfobject.embedSWF("swfmplayer.swf", "swfmplayer_obj", 280, 80, "10.0.0", null, null,{wmode:"transparent"}, null, function(e){ if(e.success==true){ $("#swfmplayer_obj").css('textIndent',"-999em"); } });
	
	$("#navigation > ul").supersubs({ minWidth: 9, maxWidth: 33, extraWidth: 1 }).superfish({delay: 500, speed: 'fast', dropShadows: false });
	
	$("a[title^='New Window: ']").each(function(){
		var newtitle = String($(this).attr('title')).substring(String("New Window: ").length);
		$(this).attr('title',newtitle);
		$(this).click(function(){ var newwin = window.open($(this).attr('href'),'newwin'); newwin.focus(); return false; });
	});
	
 })
