// JavaScript Document
// Copyright Skooks Designs 2008
// All right reserved.
// v.1.0  Code & Load


  function flashPutHref(href) { location.href = href; }

    function sspToggleDisplayMode() {
        thisMovie("flashcontent").sspToggleDisplayMode();
    }
    function sspToggleGallery(){
      thisMovie("flashcontent").sspToggleGallery();
    }
    function sspToggleNavigation(){
      thisMovie("flashcontent").sspToggleNavigation();
    }
    function sspLoadAlbum(album) {
        thisMovie("flashcontent").sspLoadAlbum(album);
    }

    function thisMovie(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
      return window[movieName]
    } else {
      return document[movieName]
    }
  }
  
function loadSWF(url, targetID, wid, het, backColor,g,a,i,xml,wm){

	//Check for existing SWF
	if(isObject(targetID)){

		//replace object/element with a new div
		replaceSwfWithEmptyDiv(targetID);

	}
	//var urld = url+"?initialURL="+escape(document.location);
	var flashV = "initialURL="+escape(document.location);
	if(g){
	flashV += "&gallery="+g;
	}
	if(xml){
	flashV += "&xmlFile="+xml;
	}
	if(a){
	flashV += "&album="+a;
	}
	if(i){
	flashV += "&image="+i;
	}
	//Embed SWF
	if (swfobject.hasFlashPlayerVersion("9")) {
		
		var attributes = { data: url, width: wid, height: het};
		var params = { allowScriptAccess: "always", allowFullScreen: "true", bgcolor: backColor, flashvars: flashV };
		if(wm){
		//params.wmode = wm;
		}else{
			params.wmode = "transparent";
		}
		//var flashvars = {};
		//flashvars.name1 = "hello";
		//var obj = swfobject.createSWF(flashvars, attributes, params, targetID);
		var obj = swfobject.createSWF(attributes, params, targetID);
		swfobject.createCSS("#"+targetID,"outline:none"); 
		
	}
	//document.writeln(urld);

}
/*  wmode: "transparent" = problem with highlight around object... */

function isObject(targetID){

	var isFound = false;
	var el = document.getElementById(targetID);
	
	if(el && (el.nodeName === "OBJECT" || el.nodeName === "EMBED")){
	
		isFound = true;
	
	}
	
	return isFound;

}


function replaceSwfWithEmptyDiv(targetID){

	var el = document.getElementById(targetID);
	
	if(el){
	
		var div = document.createElement("div");
	
		el.parentNode.insertBefore(div, el);
	
		//Remove the SWF
		swfobject.removeSWF(targetID);
	
		//Give the new DIV the old element's ID
		div.setAttribute("id", targetID);
		
	}
	

}