// JavaScript Document
var isFlashInstalled=false;
noautoinstall = "";
if(navigator.appName == "Microsoft Internet Explorer" && 
                (navigator.appVersion.indexOf("Mac") != -1 || 
                 navigator.appVersion.indexOf("3.1") != -1)){
                        noautoinstall = "true";
        }

if (navigator.appName == "Microsoft Internet Explorer" && noautoinstall != "true"){isFlashInstalled=true;}
		
else if(navigator.plugins)
        {
                if(navigator.plugins["Shockwave Flash"] || navigator.plugins["Shockwave Flash 2.0"])
                {isFlashInstalled=true;}
          }
		  
//end flash detection		  

 function swapflash(movieName,container,width,height,flashid,staticimage){
		var newCode='';
        var flashCode='';
        var flashContainer='';
         //if(isFlashInstalled&&activestyle=="regular"){
         flashContainer=document.getElementById(container);
		 if(isFlashInstalled){
						movieName="/flash/"+movieName;
                       
                        //customisation
                        //flashContainer.style.position="relative";        
                        //flashContainer.style.backgroundImage="";
                        ///////////////
                        flashCode= "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" " ;
                        flashCode=flashCode + "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" ";
                        flashCode=flashCode + "width=\"" + width + "\" height=\""+height+"\" >\n ";
                        flashCode=flashCode + "  <param name=\"movie\" value=\" " + movieName + " \">\n";
                        flashCode=flashCode + "        <PARAM NAME=\"wmode\" VALUE=\"transparent\" >\n";
                        flashCode=flashCode + "  <embed src=\""+ movieName + "\" quality=\"high\" wmode=transparent pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\""+width+"\" height=\""+height+"\">\n ";
                        flashCode=flashCode + "  </embed>\n";
                        flashCode=flashCode + "</object>\n";
                        
						//alert(flashContainer.innerHTML);
                        }
			else{
						flashCode="<img src=\"/nav_images/keepinghouse/" + staticimage + "\" width=\"" + width + "\" height=\"" + height + "\" / >";
				}
						
		//newCode=flashCode+flashContainer.innerHTML;
		//alert(flashCode);
        flashContainer.innerHTML=flashCode;
}


function insertmailto(){
	swap=document.getElementById('emailus');
	//alert(swap.innerHTML);
	swap.innerHTML='<a href="mailto:david.peel@leeds.gov.uk" title="email us" >email us</a>';

	swap=document.getElementById('emailuslist');
	//alert(swap.innerHTML);
	swap.innerHTML='<a href="mailto:david.peel@leeds.gov.uk" title="email us" >Sign up for our newsletter</a>';
}


function makeheadergraphic(){
	grheader=document.getElementById('header');
	//alert(grheader.innerHTML);
	grheader.innerHTML='<div id="graphicalheader" ></div>' + grheader.innerHTML +'';
}

function loadfunctions(){
	
	//alert('running');
		
		if(!document.getElementById('bblitebar'))
        {//functions not run in edit mode
	//	insertmailto();	
       	makeheadergraphic();
       	swapflash('keepinghouse_banner01.swf','graphicalheader',441,116,'flashmovie','noflash_bg.jpg');
         
		}
}
window.onload=loadfunctions;
