<!--//
	var zIndex = new Array();
	var k,ww,wh;
	
	function initBox (id,no){

	$(id).draggable({ zIndex: "5000" });
	$(id).fadeTo("easein", 1);

	$(id).bind('dragstart', function(event, ui) {
		$( this ).fadeTo("normal", 0.66);
	 });
	 $(id).bind('dragstop', function(event, ui) {
		$( this ).fadeTo("normal", 1.0);
		$(".work").css({
			"zIndex": "300"
		});
		$(this).css({
			"zIndex": "400"
		});
		$(".dialog").css({
			"zIndex": "5000"
		});
	 });
	 
	}

	function r(){ww=$(window).width();wh=$(window).height();}
	
	// in case it's useful, my random function is just:
	function randomXToY(minVal,maxVal,floatVal){
  		var randVal = minVal+(Math.random()*(maxVal-minVal));
  		return typeof floatVal=='undefined'?Math.round(randVal):randVal.toFixed(floatVal);
	}
	
	function animateLightTable(elem,no,anzElem) {
		//alert(elem+"/"+no+"/"+anzElem);
		var e = elem+no;
		$(e).fadeIn(150+Math.random()*950, function() {
             //alert(this);
        	//$(this).remove();
			if (no < anzElem) {
				no += 1;
				animateLightTable(elem,no,anzElem);
			}
		});
	}
	
	
	/**
	 * render the flash embed for those crazy mp3 sounds ... yeah rockn roll
	 *
	 */
	function insertPlayer(template_directory){

		var sound = ['sound6.mp3','sound39.mp3','sound40.mp3','AOS02054.mp3','AOS02086.mp3','AOS02157.mp3','AOS02138.mp3','AOS02156.mp3','AOS02152.mp3','AOS02081.mp3','19749.mp3','08920.mp3'];

	    var playerpath	= template_directory + '/flash/singlemp3player.swf';
		var path		= template_directory + '/sound/';
		var filename	= path + sound.random();

		var mp3html = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
		mp3html += 'width="1" height="1" ';
		mp3html += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">';
		mp3html += '<param name="movie" value="'+playerpath+'?';
		mp3html += 'showDownload=false&file=' + filename + '&autoStart=true';
		mp3html += '&backColor=ffffff&frontColor=ffffff';
		mp3html += '&repeatPlay=false&songVolume=50" />';
		mp3html += '<param name="wmode" value="transparent" />';
		mp3html += '<embed wmode="transparent" width="1" height="1" ';
		mp3html += 'src="' + playerpath + '?'
		mp3html += 'showDownload=false&file=' + filename + '&autoStart=true';
		mp3html += '&backColor=ffffff&frontColor=ffffff';
		mp3html += '&repeatPlay=false&songVolume=50" ';
		mp3html += 'type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
		mp3html += '</object>';
		return mp3html;

	}
/* takes an array and returns a random element*/
Array.prototype.random = function( r )
{
	var i = 0, l = this.length;
	if( !r ) { r = this.length; }
	else if( r > 0 ) { r = r % l; }
	else { i = r; r = l + r % l; }
	return this[ Math.floor( r * Math.random() - i ) ];
};

//-->
