
/* ///////////////////////////////////////////////////////////////////
Credits voor het gebruik van de geluiden 	(31 - 08 - 2006)

- Water Bubbles by Suonho
ELEMENTS_WATER_02_Phasin-bubbles.wav 
http://freesound.iua.upf.edu/samplesViewSingle.php?id=17783
gelicenseerd onder http://creativecommons.org/licenses/sampling+/1.0/

- Underwater Soundscape by Unknown
///////////////////////////////////////////////////////////////////*/



var SCScontainer;
var SCSanimate = true;
var SCSactive = true;
var SCScolor = "#AA00FF";

function startswitcher(id) {

	//Write Div
	document.write('<div id="SCSdiv" style="height:20px; width: 100%; margin: 0 auto 0 auto">');
	document.write('<a href="javascript:toggleSCS()">Submarinechannel.com</a>');
	document.write('</div>');

	//Flash Object
	var flashversion = 7;
	var flashname = "switcher";
	//var flashfile = "http://www.submarinechannel.com/flash/switcher.swf";
	var flashfile = "http://mmbase.submarinechannel.com/flash/switcher.swf";


	var fo = new FlashObject(flashfile, flashname , "100%", "100%", flashversion);

	fo.addParam("bgcolor", SCScolor);
	// fo.addParam("base", "Flash");
	fo.addParam("menu", "false");
	fo.addParam("scale", "noscale");
	fo.addParam("salign", "T");
	fo.addParam("AllowScriptAccess", "always");

	fo.addVariable("xmlFile", "http://mmbase.submarinechannel.com/switcher/related.jsp?projectid="+id);
	fo.addVariable("active", SCSactive);

	fo.write("SCSdiv");
	
	//Moo fx
	SCScontainer = new fx.Height('SCSdiv', {duration: 400});
}

//Toggle animation
	function toggleSCS(){
		//run animate function 
		if(SCSanimate){
			animateSCS();	
		//behalve als deze niet geanimeerd moet worden
		}else{
			openSCS();
		}
	}
	function animateSCS(){
		if($('SCSdiv').offsetHeight > 20){
			SCScontainer.custom(200, 20);
		}else{
			SCScontainer.custom(20, 200);
		}
		SCScontainer.toggle();
	}
	function openSCS(){
		if($('SCSdiv').offsetHeight > 20){
			document.getElementById('SCSdiv').style.height = '20';
		}else{
			document.getElementById('SCSdiv').style.height = '200';
		}
		
	}
	
//Minimize div
	function minimizeSCS(){
		document.getElementById('SCSdiv').style.height = '20';
	}

//GET SET Values
	function do_not_animateswitcher(){
		SCSanimate = false;
	}
	function set_disableswitcher(){
		SCSactive = false;
	}
	function set_styleswitcher(style){
		SCScolor = "#FF00FF";
	}