/*
	javascript to support actions for Services.swf
*/

function thisMovie(movieName) {
	if (navigator.appName.indexOf("Microsoft") != -1) {
	  return window[movieName];
	} else {
	  return document[movieName];
	}
}

function popIn() {
	//alert("-> " + thisMovie("flsvc"));
	thisMovie("flsvc").popIn();
}

function popOut() {
	thisMovie("flsvc").popOut();
}

/* thanks for playing */

/*
	ah yes, internet explorer.

	this little bit 'o honey installs an unload function
	on the window so as to route IE into actually unloading
	the movie like it should.  instead, IE naturally feels
	it's necessary to recursively call it's own unload function
	until it runs out of memory.

	nice work guys!
*/

function __flash_unloadHandler() {
	/* Microsoft employees, please form a line here... */
	var _2d=document.getElementsByTagName("OBJECT");
	for(var i=0;i<_2d.length;i++){
		_2d[i].style.display="none";
		for(var x in _2d[i]){
			if(typeof _2d[i][x]=="function"){
				_2d[i][x]=function(){};
			}
		}
	}
}

window.onbeforeunload = __flash_unloadHandler;

function addWindowEvent(func) {

        //setup onload function
        if(typeof window.addEventListener != 'undefined')
        {
                //.. gecko, safari, konqueror and standard
                window.addEventListener('load',func, false);
        }
        else if(typeof document.addEventListener != 'undefined')
        {
                //.. opera 7
                document.addEventListener('load',func, false);
        }
        else if(typeof window.attachEvent != 'undefined')
        {
                //.. win/ie
                window.attachEvent('onload',func);
        } else {
                return;
        }
}

function flashloader(w, h, fn, n) {
	if (!n) n = "";
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + w + '" height="' + h + '" id="' + n + '" allowScriptAccess="always"><param name="movie" value="' + fn + '" /><param name="quality" value="high" /><embed src="' + fn + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + w + '" height="' + h + '" name="' + n + '" allowScriptAccess="always"></embed></object>');
}


