
function theflash(movie,width,height) 
{
	
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="'+width+'" height="'+height+'">\n');
    document.write('<param name="movie" value="'+movie+'">\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<param name="menu" value="false">\n');
	document.write('<param name="wmode" value="transparent">\n');
	document.write('<embed src="'+movie+'" width="'+width+'" height="'+height+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="false" wmode="transparent"></embed>\n');
    document.write('</object>\n');
	
}

function colourBars()
{
	var even = false;
    var evenColor =  "#E5E5E5";
    var oddColor =  "#fff";
	
	 
  	var thearea = document.getElementById('spectable');
      var trs = thearea.getElementsByTagName('tr');

      for (var i = 0; i < trs.length; i++) {
        
          trs[i].style.backgroundColor = even ? evenColor : oddColor;
		     
			 even =  ! even;
}
}

function hideDrop() { 
 document.getElementById('drop').style.display = 'none';
} 


function showDrop() {
	
	thediv = document.getElementById('drop');
	
	if (thediv.style.display =='none'){
			thediv.style.display = 'block';
			setTimeout("hideDrop()",10000); 
	}else{
			setTimeout("hideDrop()",1);
	}
}

function setForm(formid) {

    document.getElementById(''+formid+'').submit();

}

function swapimage(what, init) { 

	what.style.backgroundPosition = '0 ' + init + 'px'
}


function changeImg(theme, theimg) {
	document.getElementById('mainimage').src = 'templates/' + theme + '/images/'+theimg+'';
}

startTable = function() {
	
	
	if(document.getElementById("spectable")){

		tableRoot = document.getElementById("spectable");
		
		var r = tableRoot.rows;
		var rlen = r.length;
		
		for (var h = 0; h < rlen; h++) {
		 
		 var node = r[h];
				
					node.onmouseover=function() {
							this.className+="over";
					}
							
					node.onmouseout=function() {
							this.className=this.className.replace("over", "");
					}
			
		}
	}
	
	
}

var timex = 4
var timey = 1
var a = 1
	
	function showBoxes(n){
	timex = timex-timey
	setTimeout("showBoxes("+n+")", 1000)
	if(timex==0){
		
		for (var i=1; i<=n; i++){
			document.getElementById('f'+[i]).style.display ='none'
		}
			document.getElementById('f'+[a]).style.display =''	

   a = a + 1;
   timex=4;
   if (a==n+1){a=1;}
	   }
}


/****** custom functions *********/

function runPreview() {

	var formid = opener.window.document.forms[0].id;
	var area = opener.window.document.forms[0].area.value;
    
	var theAction = opener.window.document.getElementById(formid).action;

	opener.window.document.getElementById(formid).action = 'preview.php?area='+area;
	opener.window.document.getElementById(formid).target = this.window.name;
	opener.window.document.getElementById(formid).submit();
	opener.window.document.getElementById(formid).action = theAction;
	opener.window.document.getElementById(formid).target = '_top';

}