theCat = new Array ("", "style", "power", "society", "thought", "place", "technique", "time", "money", "design", "process", "people");
theClr = new Array ("", "2E800D", "80710D", "80120D", "DF1F16", "B718BA", "EC6132", "DFC516", "A5DF16", "51DF16", "16DFD4", "3119B9");


function showObject(id) {
	if (document.getElementById("preface" + id).style.display == "" || document.getElementById("preface" + id).style.display == "none") { 
		document.getElementById("preface" + id).style.display = "block"
		document.getElementById("title" + id).style.backgroundImage = "url(img/icons/arrow_down.gif)";
	}
	else {  
		document.getElementById("preface" + id).style.display = "none"
		document.getElementById("title" + id).style.backgroundImage = "url(img/icons/arrow_up.gif)";
	}
} 
function showCluster(id) {
	if (document.getElementById("preface" + id).style.display == "" || document.getElementById("preface" + id).style.display == "none") { 
		document.getElementById("preface" + id).style.display = "block"
		document.getElementById("title" + id).style.backgroundImage = "url(img/icons/arrow_down_333.gif)";
	}
	else {  
		document.getElementById("preface" + id).style.display = "none"
		document.getElementById("title" + id).style.backgroundImage = "url(img/icons/arrow_up_333.gif)";
	}
} 
oldId = 0;

function writeCategories() {
	for (i = 1; i < theCat.length; i++) {
		///document.getElementById("categoryBox").innerHTML += "<ul><li><a href='category.php?id=" + i + "' target='_self'>" + theCat[i] + "</a><span id='block" + i +"' style='top:" + i + "px;'><img style='margin-left:6px; background-color:#" + theClr[i] + ";' src='img/fake.gif' width='8' height='8' alt='' /></span></li></ul>";
	}
	
	
	document.getElementById("categoryBox").innerHTML = "<table class='tableNav' cellpadding='0' cellspacing='0' border='0'><tr><td><img src='img/fake.gif' width='8' height='1' alt='' /></td><td><img src='img/fake.gif' width='8' height='1' alt='' /></td></tr>"
	
	for (i = 1; i < theCat.length; i++) {
		document.getElementById("categoryBox").innerHTML += "<tr><td class='txt'><a href='category.php?id=1' target='_self'>style</a></td><td bgcolor='#2E800D'></td></tr>"
	}
	
	document.getElementById("categoryBox").innerHTML += "</table>";
						
	
}
function goLink(action, id)  {
  document.forms.linkwrapper.action = action;
  document.forms.linkwrapper.id.value = id;
  document.forms.linkwrapper.submit();
}

function init(catId) {
	//alert(catId)
	//writeCategories();
	
	
}

function getEdition(o){			
	var i=o.selectedIndex;
	//als i == 0 dan is de optie "maak een keuze" gekozen, negeren dus.
	if(i)
	{
		var year=o.value,box2=document.getElementById("num"),opt=box2.options;
		//lengte van box2 instellen, i = aantal items.
		box2.length=edition[year].length;			
		for(var a=0,l=box2.length;a<l;a++){
			opt[a].text=edition[year][a];
			opt[a].value=edition[year][a];
		}
	}		
}

function goStatic(ref) {
	if (location.search) {
		passed_vars = location.search.split("&")
		number_vars = passed_vars.length
		new_ref = location.search + "&static="+ref
	}
	else {
		new_ref = "?static="+ref
	}
	location.href = "static.php" + new_ref
}
function openForum()	{
	w = window.open('http://www.archis.org/forum/', 'forumwin');
	}
function opensubscribe()	{
	w = window.open('static/subscribe.html', 'subscribewin', 'width=584,height=620, scrollbars=yes,left=450,top=50,status=no,toolbar=no');
	}
function openbackissues()	{
	w = window.open('static/backissues_new.html', 'backissueswin', 'width=602,height=1000, scrollbars=yes,left=450,top=50,status=no,toolbar=no');
	}
function openadvertising()	{
	w = window.open('static/advertising_new.html', 'advertisingwin', 'width=602,height=1000, scrollbars=yes,left=450,top=50,status=no,toolbar=no');
	}
function opennewsletter()	{
	w = window.open('static/newsletter.html', 'newsletterwin', 'width=584,height=620,scrollbars=yes,left=350,top=50,status=no,toolbar=no');
	}
function openRSVP()	{
	w = window.open('http://www.archis.org/rsvp/eventspace.html', 'rsvpwin', 'width=550,height=697,scrollbars=no,status=no,toolbar=no');
	}
function doOpenWindow(reference,width,height) {
	w = window.open(reference, 'rsvpwin', 'width='+width+',height='+height+',scrollbars=no,status=no,toolbar=no');
}