var cg = {
  src: 'flash/cg.swf'
};

var loosie = {
  src: 'flash/Loosie.swf'
};


function loadjscssfile(filename, filetype){
 if (filetype=="js")
 { //if filename is a external JavaScript file
  var fileref=document.createElement('script');
  fileref.setAttribute("type","text/javascript");
  fileref.setAttribute("src", filename);
 }
 else if (filetype=="css"){ //if filename is an external CSS file
  var fileref=document.createElement("link");
  fileref.setAttribute("rel", "stylesheet");
  fileref.setAttribute("type", "text/css");
  fileref.setAttribute("href", filename);
 }
 if (typeof fileref!="undefined")
 {
	 console.log(document.getElementsByTagName("head")[0]);
	  document.getElementsByTagName("head")[0].appendChild(fileref);
 }
}

sIFR.activate(cg); // From revision 209 and onwards
sIFR.activate(loosie);
if (FlashDetect.installed) 
{
	loadjscssfile("css/sIFR-screen.css", "css") ////dynamically load and add this .css file
	
	sIFR.replace(cg, {
	  selector: 'h1'
	    ,css: [
	      '.sIFR-root { text-align: left; font-weight: normal; font-size: 21px; color: #ff43ff; margin: 0; padding: 0;}'
	    ], wmode: 'transparent'
	  }); 
	  
	sIFR.replace(cg, {
	  selector: 'h2'
	    ,css: [
	      '.sIFR-root { text-align: left; font-weight: normal; font-size: 16px; color: #ff43ff; margin: 0; padding: 0;}'
	    ], wmode: 'transparent'
	  });   
	
	sIFR.replace(cg, {
	  selector: '#nav h3'
	    ,css: [
	      '.sIFR-root { text-align: left; font-weight: normal; font-size: 21px; color: #0096cb; margin: 0; padding: 0;}'
	    ], wmode: 'transparent'
	  });
	  
	sIFR.replace(cg, {
	  selector: '#sidebar h3'
	    ,css: [
	      '.sIFR-root { text-align: left; font-weight: normal; font-size: 21px; color: #000000; margin: 0; padding: 0;}'
	    ], wmode: 'transparent'
	  }); 
	  
	sIFR.replace(cg, {
	  selector: 'h3'
	    ,css: [
	      '.sIFR-root { text-align: left; font-weight: normal; font-size: 16px; color: #3c0436; margin: 0; padding: 0;}'
	    ], wmode: 'transparent'
	  });    
	  
	sIFR.replace(cg, {
	  selector: 'h4'
	    ,css: [
	      '.sIFR-root { text-align: left; font-weight: bold; font-size: 13px; color: #3c0436; margin: 0; padding: 0;}'
	    ], wmode: 'transparent'
	  }); 
	  
	  sIFR.replace(loosie, {
	  selector: 'p.TOTD'
	    ,css: [
	      '.sIFR-root { text-align: left; font-weight: normal; font-size: 32px; color: #fff; margin: 0; padding: 0;}'
	    ], wmode: 'transparent'
	  });   
}
