
var oldStyle;
var poly001 = new FlashSound( );
var poly002 = new FlashSound( );
var poly003 = new FlashSound( );
var poly004 = new FlashSound( );
var poly005 = new FlashSound( );
var poly006 = new FlashSound( );
var poly007 = new FlashSound( );
var poly008 = new FlashSound( );
var poly009 = new FlashSound( );

poly001.embedSWF("/flash/poly001.swf");
poly002.embedSWF("/flash/poly002.swf");
poly003.embedSWF("/flash/poly003.swf");
poly004.embedSWF("/flash/poly004.swf");
poly005.embedSWF("/flash/poly005.swf");
poly006.embedSWF("/flash/poly006.swf");
poly007.embedSWF("/flash/poly007.swf");
poly008.embedSWF("/flash/poly008.swf");
poly009.embedSWF("/flash/poly009.swf");

var sounds = new Array();
sounds.home= 'poly009';
sounds.news = 'poly001';
sounds.artists = 'poly002';
sounds.releases = 'poly003';
sounds.netfilter = 'poly004';
sounds.interviews = 'poly005';
sounds.links = 'poly006';
sounds.about = 'poly007';
sounds.mixes = 'poly008';
sounds.contact = 'poly009';
sounds.defaultOver = 'poly006';

function hoverRow(element)
{
	if (element)
	{
		oldStyle = element.className;
		element.className='hover';
	}

}

function hoverRowOut(element)
{
	if (element)
	{
		element.className=oldStyle;
	}
}

function changePage(page)
{
	if (page)
		parent.location.href = page; 
} 

function playSound(id)
{
	//alert('playSound()');
	if (id)
	{
		//alert('got arg ['+id+']');
		if (sounds[id])
			{
			//alert('trigger');
			eval(sounds[id]+".TGotoAndPlay('/sample','start');");
			}
		else
			window.status = 'Sound not found for ['+id+']';
	}

}

function test()
{
alert('test ['+sounds.label+']');
}

function jukebox(url)
{
	if (url)
	{
		win = window.open(url,'musicPlayer','resizable=no,width=450,height=180');
		if (window.focus) 
			win.focus();
	}
}

// my standard CSS classnames for block level display.
var HIDDEN = 'hiddenItem';
var DISPLAY = 'displayItem';

/* Toggle display if a block level item */
function toggleDisplay(objId)
{

	Effect.toggle(objId,'blind', {queue: {position:'end', scope: 'nodescope', limit: 2} });
/*
	var debug = false;
	if (debug)
		alert(objId);
	var obj = document.getElementById(objId);
	var orig;
	if (obj)
	{
		if (debug)
		  alert('class entry '+obj.className)
		if(obj.className.indexOf(HIDDEN) != -1)
		{
			//orig = obj.className.replace(HIDDEN,'');
			//obj.className = orig+' '+DISPLAY;
			setDisplayed(obj);
			if (debug)
				alert('set class '+obj.className);			
		}
		else
		{
			//orig = obj.className.replace(DISPLAY,'');
			//obj.className = orig+' '+HIDDEN;
			setHidden(obj);
			if (debug)
				alert('set class '+obj.className);			
		}
	}
*/
}

function setHidden(objRef)
{
	if (objRef)
	{
		Effect.BlindUp(objRef, {queue: {position:'end', scope: 'nodescope'} });
		//orig = objRef.className.replace(DISPLAY,'').replace(HIDDEN,'');
		//objRef.className = orig+' '+HIDDEN;
	}
}

function setDisplayed(objRef)
{
	if (objRef)
	{
		Effect.BlindDown(objRef, {queue: {position:'end', scope: 'nodescope'} });
		//orig = objRef.className.replace(HIDDEN,'').replace(DISPLAY,'');
		//objRef.className = orig+' '+DISPLAY;
	}
}

/* *****************************************************
 * JSDiv
 * *****************************************************/
// constructor
function JSDiv()
{
	this.id;
	this.state = 0;
}
/* *****************************************************
 * END JSDiv
 * *****************************************************/

/* ***************************************************** 
 * NodeList 
 * *****************************************************/
// constructor
function NodeList()
{
	this.reg = new Array();
	this.debug = false;
}

// bind in the member functions

// just for info
NodeList.prototype.dumpObjectNames = function()
{
	var method = 'dumpObjectNames ';
	if (this.debug)
		alert(method+'Entry array length '+this.reg.length);
		
	for (var i = 0;i<this.reg.length;i++)
	{
	  alert('reg['+i+'] ['+this.reg[i]+']');
	}
	alert('reg.toString() ['+this.reg.toString()+']');
	
	if (this.debug)
		alert(method+'Exit');	
}

// bind in a reference
NodeList.prototype.addObjectRef = function(id)
{
	var method = 'addObjectRef ';
	var jsDiv = new JSDiv();
	jsDiv.id = id;
	if (this.debug)
		alert(method+'Entry with ['+id+']');

/*		
	var ref = document.getElementById(id)
	if (this.debug)
		alert(method+'got obj ref ['+ref+']');
*/
	if (id)
		this.reg.push(jsDiv);
	
	if (this.debug)
		alert(method+'Exit with reg size '+this.reg.length);	
}

// bind in a reference
NodeList.prototype.hideNodes = function()
{
	var method = 'hideNodes ';
	if (this.debug)
		alert(method+'Entry with '+this.reg.length+' nodes');

	// make each div visible
	var ref;
	for (var i = 0;i<this.reg.length;i++)
	{
	  ref = document.getElementById(this.reg[i].id);
	  // nasty global hack - really need to read up on closures
	  div = this.reg[i];
	  if (ref)
//		 changeHeight();
		 setHidden(ref);
	}		
	
	if (this.debug)
		alert(method+'Exit');	
}

NodeList.prototype.displayNodes = function()
{
	var method = 'displayNodes ';
	if (this.debug)
		alert(method+'Entry with '+this.reg.length+' nodes');

	// make each div visible
	var ref;
	for (var i = 0;i<this.reg.length;i++)
	{
	  ref = document.getElementById(this.reg[i].id);
	  // nasty global hack - really need to read up on closures
	  div = this.reg[i];
	  if (ref)
	    //changeHeight();
		 setDisplayed(ref);
	}		
	
	if (this.debug)
		alert(method+'Exit');	
}
/* ***************************************************** 
 * End NodeList  
 * *****************************************************/

var div;
var _test1 = new JSDiv();
_test1.id = 'MIX11';
_test1.state = 0;
var _test2 = new JSDiv();
_test2.id = 'MIX12';
_test2.state = 0;

function changeHeightTest1()
{
	div = _test1;
	changeHeight();
}

function changeHeightTest2()
{
	div = _test2;
	changeHeight();
}



 /* ***************************************************** 
 * Function changeHeight()  
 * Not as eloquent as I'd have liked but JS does
 * crazy when you pass an oid into a timeOut ?
 * *****************************************************/
function changeHeight()
{
	var debug = false;
	var method = 'changeHeight() ';
	if (debug)	
		alert(method+'Entry');
	
	/* how smoothly the div will open */
	var offset = 10;
	var divObj = document.getElementById(div.id);

	if (divObj)
	{
		if (debug)
			alert('found div'+divObj.id);
			
		/* remove the px or % suffix */
		var regex=/px|%/gi;
		// need to make it a number
		var height = divObj.style.height;
		height = parseInt(height.replace(regex,""));

		if(height>=400&&div.state==0){div.state=1;return;}
		if(height<=0&&div.state==1){div.state=0;return;}

		var q;
		if(div.state)
			q=offset * -1;

		if(!div.state)
			q=offset;

		height=height+q;
		
		/* cater for IE which will display a divs contents even if height == 0*/
		if (debug)
			alert(method+'changing CSS display');
		
		if (height==0)
			divObj.style.display = 'none';
		else
			divObj.style.display = 'block';
		
		if (debug)
			alert(method+'setting height ['+height+']');
		divObj.style.height = height + 'px';

		if (debug)
			alert(method+'set height on div '+divObj.id+' to ['+divObj.style.height+']');
		t=setTimeout("changeHeight();",0);
	}
}
 

 
 