// JavaScript Document

//----[ Variables ]----
var	browserType1	= false;		// Netscape, Mozilla, Firefox, IE7
var	browserType2	= false;		// IE5
var	browserType3	= false;		// Opera, Safari, Camio, Konquer
var operaDetected	= false;		// Old Opera keeps being special, has no onresize event.

var fadetimer		=  10;
var lastSlot		=  -1;
var maxslots		=  14;
var nrofnewsItems	=   7;
var piv				= maxslots - nrofSlots;
var slotXoff		=  14;
var slotYoff		=  14;
var slotLstart		= 186;
var slotWidth		= 294;
var slotHeight		= "auto";
var zindStart		= 75;

var showx			= 998;			// Actual width of show canvas
var showy			= 560;			// Actual height of show canvas (not used = auto)
var fullx			= 998;   		// Width of browserwindow
var fully			= 768;			// Height of browserwindow

var xmlreqs = new Array();
var Current_Slot = '';

var film_piv = 8;
var view_piv = 9;
var viewtitles = new Array();
viewtitles[  1 ] = "AMB BEELDEN 2005";
viewtitles[  2 ] = "ARTEZ BEELDEN 2005";
viewtitles[  3 ] = "AMB BEELDEN 2007";
viewtitles[  4 ] = "ARTEZ BEELDEN 2008";
viewtitles[  5 ] = "ARTEZ SHOW 2008";
viewtitles[  6 ] = "AMB BEELDEN 2009";
viewtitles[  7 ] = "ARTEZ SHOW 2009";
viewtitles[  8 ] = "SHAPE SHOW 2009";
viewtitles[  9 ] = "YOUNG SHAPE Shows 2009";

viewtitles[ 10 ] = "AMB IMAGES 2005";
viewtitles[ 11 ] = "ARTEZ IMAGES 2005";
viewtitles[ 12 ] = "AMB IMAGES 2007";
viewtitles[ 13 ] = "ARTEZ IMAGES 2008";
viewtitles[ 14 ] = "ARTEZ SHOW 2008";
viewtitles[ 15 ] = "AMB IMAGES 2009";
viewtitles[ 16 ] = "ARTEZ SHOW 2009";
viewtitles[ 17 ] = "SHAPE SHOW 2009";
viewtitles[ 18 ] = "YOUNG SHAPE Shows 2009";

onload   		= initialize;		// call initialize() when site loads
onresize		= initialize;		// call rePosition() whenever browser resizes

function initialize()
{
	getBrowserType();
	getBrowserSize();
	positionDivs();
	self.scroll( 0, 0 );
	BuildMenu();
 	Buildnews();
	Buildslots();
	Buildview();
	reset_zindex();
}

//function initialize_rest()
//{
//	setupDivs();
//	positionDivs();
//	fillDivs();
//	BuildMainMenu( 0, -1 );
//	nextTriggerAction = 1;
//	startshow();
//	showDivs();
//}


//----[ Browser investigation & dimensions ]----
//
function getBrowserType()
{
	switch( BrowserDetect.browser )
	{
		case "Firefox":
		case "Mozilla":
		case "Netscape":	browserType1 = true;
							break;
		case "Explorer":	if (  BrowserDetect.version  < 7 )
								window.location = "http://www.arnhemmodebiennale.com/index2.php";
//								browserType2= true;
							else
								browserType1 = true;
							break;
		case "Opera":		operaDetected = true;
		case "Safari":
		case "Camio":
		case "konqueror":	browserType3;
							break;
		default :			browserType3;
	}
}


function getBrowserSize()
{
		var currwidth = 0;
		var currheight = 0;

	if ( browserType1 )	{
		currwidth = document.documentElement.clientWidth;
		currheight = document.documentElement.clientHeight;
	}
	else
		if ( browserType2 ) {
			currwidth = document.body.clientWidth;
			currheight = document.body.clientHeight;
		}
		else {	// BrowserType3 & Default
				currwidth = window.innerWidth;
				currheight = window.innerHeight;
		}

	if ( currwidth < showx ) {
		fullx = showx;
	}
	else {
		fullx = currwidth - 16;
	}
	
	if ( currheight < showy ) {
		fully = showy;
	}
	else {
		fully = currheight;
	}

	document.getElementById( 'Back_in' ).style.textAlign = "left";
	if ( fullx > showx ) {
		document.getElementById( 'Logomenu' ).style.left = ((( fullx - showx ) / 2 ) - 28 ) + 'px';
		document.getElementById( 'Back_in' ).style.textAlign = "center";
	}
}

function setWidthHeight( layer, xval, yval, tval, lval )
{
	if ( xval == "auto")
		document.getElementById( layer ).style.width  = xval;
	else
		document.getElementById( layer ).style.width  = xval + "px";

	if ( yval == "auto")
		document.getElementById( layer ).style.height  = yval;
	else
		document.getElementById( layer ).style.height  = yval + "px";

	if ( tval == "auto")
		document.getElementById( layer ).style.top  = tval;
	else
		document.getElementById( layer ).style.top  = tval + "px";

	if ( lval == "auto")
		document.getElementById( layer ).style.left  = lval;
	else
		document.getElementById( layer ).style.left  = lval + "px";
}

function positionDivs()
{
//	setWidthHeight( "Back_out", fullx , fully , 0, 0 );
//	setWidthHeight( "Back_in", fullx , fully , 0, 0 );
	setWidthHeight( "Full", fullx , fully , 0, 0 );
	setWidthHeight( "Show", showx , showy , 0, ( fullx - showx ) / 2 );
}

function opacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round( millisec / 100 );
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
    if( opacStart > opacEnd ) {
        for( i = opacStart; i >= opacEnd; i-- ) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
}

//change the opacity for different browsers
function changeOpac( opacity, id )
{
		var object = document.getElementById(id).style;

	object.opacity = ( opacity / 100 );
	object.MozOpacity = ( opacity / 100 );
	object.KhtmlOpacity = ( opacity / 100 );
	object.filter = "alpha( opacity=" + opacity + ")";
} 

function set_news_color()
{
		var doline = "Slot0x";
		
	document.getElementById( doline ).style.color = "#6ABBFF";
}

function reset_news_color()
{
		var doline = "Slot0x";
		
	document.getElementById( doline ).style.color = "#000000";
}

function set_menu_color( Menuline )
{
		var doline = "menuline" + Menuline;
		
	document.getElementById( doline ).style.color = "#6ABBFF";
}

function reset_menu_color( Menuline )
{
		var doline = "menuline" + Menuline;
		
	document.getElementById( doline ).style.color = "#000000";
}

function set_slot_color( Slotnr )
{
		var doline = "Slotx" + Slotnr;
		
	document.getElementById( doline ).style.color = "#6ABBFF";
}

function reset_slot_color( Slotnr )
{
		var doline = "Slotx" + Slotnr;

	if ( Colors[ Slotnr ] == "#03030B" )
		document.getElementById( doline ).style.color = "#FFFFFF";	
	else
		document.getElementById( doline ).style.color = "#000000";
}


function hide_view()
{
	document.getElementById( "Logo" ).focus();

	if( document.getElementById( "View" ).style.opacity != 0 ) {
		opacity( "View" , 100, 0, fadetimer );
	}
	document.getElementById( "View" ).style.visibility = "hidden";
}


function hide_news()
{
	Visual[ 0 ] = "N";
	document.getElementById( "Logo" ).focus();

	if( document.getElementById( "Slot0" ).style.opacity != 0 ) {
		opacity( "Slot0" , 100, 0, fadetimer );
	}
	document.getElementById( "Slot0" ).style.visibility = "hidden";

	if ( Visual[ 1 ] == "Y" )
	  hide_slot( 1 );

	resetMenu();	
}


function hide_slot( Slotnr )
{
		var doslot = "Slot" + Slotnr;
		var domenu = "menuline" + ( Slotnr + 1 );

	document.getElementById( "Logo" ).focus();

	if( document.getElementById( doslot ).style.opacity != 0 ) {
		opacity( doslot , 100, 0, fadetimer );
	}

	Visual[ Slotnr ] = "N";
	document.getElementById( doslot ).style.visibility = "hidden";

	resetMenu();	
}

function show_view( whichone )
{
		var view_text = parseInt( whichone );

	if ( Language == "UK" )
		view_text = view_text + view_piv;
		
	urlfile = whichone + "_" + Language;

	document.getElementById( "View" ).style.visibility = "visible";
	if( document.getElementById( "View" ).style.opacity == 0 )
	{
		opacity( "View", 0, 100, fadetimer );
    }
	document.getElementById( "View" ).style.cursor = "default";
	document.getElementById( "view_title" ).innerHTML = viewtitles[ view_text ];
	document.getElementById( "View_txt" ).innerHTML = '<iframe marginwidth="0" marginheight="0" id="Viewframe" src="Gallerie/' + urlfile +'.html" scrolling="no" frameborder="0"></iframe>';

//	if( whichone < film_piv ) {
//	}
//	else {
//		document.getElementById( "View_txt" ).innerHTML = '<iframe marginwidth="0" marginheight="0" id="Viewframe" src="../Movies/' + urlfile +'.html" scrolling="no" frameborder="0"></iframe>';
//	}
}

function show_news()
{

	Visual[ 0 ] = "Y"

	document.getElementById( "Slot0" ).style.visibility = "visible";
	if( document.getElementById( "Slot0" ).style.opacity == 0 )
	{
		opacity( "Slot0", 0, 100, fadetimer );
    }
	document.getElementById( "Slot0" ).style.cursor = "default";
	
//	if (( Visual[ 1 ] == "N" ) && ( showNews == true ))
	  show_slot( 1 );

	resetMenu();
}


function show_slot( Slotnr )
{
		var doslot = "Slot" + Slotnr;
		var domenu = "menuline" + ( Slotnr + 1);

	document.getElementById( doslot ).style.visibility = "visible";

	if( document.getElementById( doslot ).style.opacity == 0 )
	{
		opacity( doslot, 0, 100, fadetimer );
    }

	document.getElementById( doslot ).style.cursor = "default";
	document.getElementById( domenu ).style.textDecoration = "none";

	Visual[ Slotnr ] = "Y";

	move_zindex( Slotnr );
}


function show_all_slots()
{

		var slotid = 2;
		var hideall = true;

	self.scroll( 0, 0 );

	if ( Visual[ 0 ] == "N" ) {
		hideall = false;
	}
	else {
		if ( showNews == true )
			slotid = 1;

		while((slotid <= nrofSlots ) && ( hideall == true ))
		{
			if ( Visual[ slotid++ ] == "N" ) {
				hideall = false;
			}
		}
	}

	show_news();
	hide_view();

	for( slotid = 2 ; slotid <= nrofSlots; slotid ++ )
	{
		if( hideall == true )
			hide_slot( slotid );
		else
			show_slot( slotid );
	}

	if( hideall == true ) {
		hide_news();
		hide_slot( 1 );
	}
	else {
		if (( Visual[ 1 ] == "Y" ) && ( showNews == false ))
		{
			hide_slot( 1 );
		}
		if (( Visual[ 1 ] == "N" ) && ( showNews == true )) {
			show_slot( 1 );
		}
		reset_zindex();
	}
}


function move_zindex( Slotnr )
{
		var doslot = '';
		var zind = 1;
		var zend = 1;
		var domenu = "menuline" + ( Zindex[ 1 ] + 1 );

	self.scroll(0,0);

	if( Visual[ Slotnr ] == "Y" ) {
		document.getElementById( domenu ).style.textDecoration = "none";
	}

	while((Zindex[ zend ] != Slotnr ) && ( zend <= nrofSlots ))
	{
		zend++;
	}

	for( zind = zend ; zind > 1; zind-- )
	{
			var doslot = '';

		Zindex[ zind ] = Zindex[ zind - 1 ];
		doslot = 'Slot' + Zindex[ zind ] ;
		document.getElementById( doslot ).style.zIndex = zindStart - zind;
	}

	Zindex[ 1 ] = Slotnr;
	doslot = 'Slot' + Slotnr;

	domenu = "menuline" + ( Slotnr + 1);
	document.getElementById( doslot ).style.zIndex = zindStart - 1;

	resetMenu();
}


function reset_zindex( )
{
	for ( zind = 1 ; zind <= nrofSlots ; zind++ )
	{
			var doslot = 'Slot' + zind;
			var	domenu = "menuline" + ( zind + 1 );

		Zindex[ zind ] = zind;
		document.getElementById( doslot ).style.zIndex = zindStart - zind;
		document.getElementById( domenu ).style.textDecoration = "none";
	}

	resetMenu();
}


function resetMenu( )
{
	if ( Visual[ 0 ] == "N" )
		document.getElementById( "menuline2" ).style.textDecoration = "line-through";
	else
		document.getElementById( "menuline2" ).style.textDecoration = "none";

	for ( imenu = 2; imenu <= nrofSlots; imenu++ )
	{
		domenu = "menuline" + ( imenu + 1 );

		if( Visual[ imenu ] == "N" )
			document.getElementById( domenu ).style.textDecoration = "line-through";
		else 
			document.getElementById( domenu ).style.textDecoration = "none";
	}
	
	for  ( imenu = 1; imenu <= nrofSlots; imenu++ )
	{
		if ( Visual[ Zindex[ imenu ] ] == "Y" ) {
			domenu = "menuline" + ( Zindex[ imenu ] + 1 );
			document.getElementById( domenu ).style.textDecoration = "underline";
			break;
		}
	}
}

function BuildMenu( )
{
		var htmlMenu = '';
		var menu_div = document.getElementById( 'Menu' );

	htmlMenu = '<table class="menu_side">';
	for ( imenu = 0; imenu < Titles.length; imenu++ )
	{
		if ( Titles[ imenu ] == "" ) {
			Titles[ imenu ] = "&nbsp;";
		}

		htmlMenu = htmlMenu + '<tr><td id="menuline' + ( imenu + 1 ) +'"';
		if ( imenu == 0 ) {
			htmlMenu = htmlMenu + 'onmouseover="set_menu_color( ' + ( imenu + 1 ) +' );" \
									onmouseout="reset_menu_color( ' + ( imenu + 1 ) +' );" \
									onclick="show_all_slots();"';
		} else
		if ( imenu == 1 ) {
			htmlMenu = htmlMenu + 'onmouseover="set_menu_color( ' + ( imenu + 1 )  +' );" \
									onmouseout="reset_menu_color( ' + ( imenu + 1 ) +' );" \
									onclick="show_news();"';
		} else
		if ( imenu == ( Titles.length - 2 )) {
			htmlMenu = htmlMenu + 'onmouseover="set_menu_color( ' + ( imenu + 1 )  +' );" \
									onmouseout="reset_menu_color( ' + ( imenu + 1 ) +' );" \
									onclick="window.location=\'index.php?Lang=' + newLang + '\';"';
		} else
		if ( imenu == ( Titles.length - 1 )) {
			htmlMenu = htmlMenu + 'onmouseover="set_menu_color( ' + ( imenu + 1 )  +' );" \
									onmouseout="reset_menu_color( ' + ( imenu + 1 ) +' );" \
									onclick="show_item( \'Item_0\' );"';

		} else
		if ( Titles[ imenu ] != '&nbsp;' ) {
			htmlMenu = htmlMenu + 'onmouseover="set_menu_color(' + ( imenu + 1 )  +' );" \
									onmouseout="reset_menu_color( ' + ( imenu + 1 ) +' )" \
									onclick="show_slot( ' + imenu +' );"';
		}
		htmlMenu = htmlMenu + '>' + Titles[ imenu ] + '</td></tr>';
	}
	
	htmlMenu = htmlMenu + '</table>';
	menu_div.innerHTML = htmlMenu;

	for ( imenu=0; imenu < Titles.length; imenu++ )
	{
		var linetodo = 'menuline'  + ( imenu + 1 );
		if ( Titles[ imenu ] != '&nbsp;' ) {
			document.getElementById( linetodo ).style.cursor = "pointer";
		}
	}
}	

function Buildslots()
{
		var htmlSlots = '';
		var slots_div = document.getElementById( 'Slots' );

	for ( islot = 1; islot <= nrofSlots ; islot++ )
	{
		var Slotid = "Slot" + islot;

		htmlSlots = htmlSlots + '<div id="Slot' + islot + '"> \
			<table class="slot_frame"> \
				<tr onclick="move_zindex( ' + islot +' );"> \
					<td class="_ul"></td> \
					<td colspan="4" class="_top"></td> \
					<td class="_ur"></td> \
				</tr> \
				<tr> \
					<td class="_left" onclick="move_zindex( ' + islot +' );"></td> \
					<td id="Slota' + islot + '" class="slot_titlell" onclick="move_zindex( ' + islot +' );">&nbsp;</td> \
					<td id="Slotx' + islot + '" class="slot_titlel" \
						onmouseover="set_slot_color( ' + islot +' );" \
						onmouseout="reset_slot_color( ' + islot +' )" \
						onclick="hide_slot( ' + islot +' );">X</td> \
					<td id="Slotb' + islot + '" class="slot_titlem" onclick="move_zindex( ' + islot +' );">' + Titles[ islot ] + '</td> \
					<td id="Slotc' + islot + '" class="slot_titler" onclick="move_zindex( ' + islot +' );">&nbsp;</td> \
					<td class="_right" onclick="move_zindex( ' + islot +' );"></td> \
				</tr> \
				<tr onclick="move_zindex( ' + islot +' );"> \
					<td class="_left"></td> \
					<td class="slot_text" colspan="4" id="Slot' + islot + '_txt">_</td> \
					<td class="_right"></td> \
				</tr> \
				<tr onclick="move_zindex( ' + islot +' );"> \
					<td class="_bl"></td> \
					<td colspan="4" class="_bot"></td> \
					<td class="_br"></td> \
				</tr> \
			</table> \
		</div>';
	}

//						<td id="Slotd' + islot + '" class="slot_titler">&nbsp;</td> \


	slots_div.innerHTML = htmlSlots;

	if ( Visual[ 1 ] == "N" ) {
		showNews = false;
	}

	xmlreqGET();

	for ( islot = 1; islot <= nrofSlots ; islot++ )
	{
			var Slotid = "Slot" + islot;

		setWidthHeight( Slotid, slotWidth, slotHeight,
			(( nrofSlots - islot ) * slotYoff ), 
			slotLstart - (( nrofSlots - islot + piv ) * slotXoff ));

		if ( Visual[ islot ] == "N" )
			changeOpac( 0, Slotid );
		else
			changeOpac( 100, Slotid );

		document.getElementById( Slotid ).style.cursor = "default";
		document.getElementById( Slotid ).style.visibility = "visible";

		if (( Colors[ islot ] != "#FFFFFF" ) && ( Colors[ islot ] != "#111111" )) {
			document.getElementById(( "Slot" + islot + "_txt" )).style.background = 'url(Images/' + Colors[ islot ].substr( 1, 6 ) + Sizess[ islot ] + '.gif)';
			document.getElementById(( "Slot" + islot + "_txt" )).style.backgroundRepeat="repeat-x";
		}
		else
			document.getElementById(( "Slot" + islot + "_txt" )).style.backgroundColor = Colors[ islot ];

		if ( Colors[ islot ] == "#111111" ) {
			kleur = "#C2BCBE";
			document.getElementById(( "Slot" + islot + "_txt" )).style.backgroundColor = "#FFFFFF";				
//			document.getElementById(( "Slotx" + islot )).style.color = "#FFFFFF";
//			document.getElementById(( "Slotx" + islot )).style.background = 'url(Images/dotw.gif)';
//			document.getElementById(( "Slotx" + islot )).style.backgroundPosition = "0px 15px";
//			document.getElementById(( "Slotx" + islot )).style.backgroundRepeat="repeat-x";
//			document.getElementById(( "Slotb" + islot )).style.color = "#FFFFFF";
//			document.getElementById(( "Slotb" + islot )).style.background = 'url(Images/dotw.gif)';
//			document.getElementById(( "Slotb" + islot )).style.backgroundPosition = "0px 15px";
//			document.getElementById(( "Slotb" + islot )).style.backgroundRepeat="repeat-x";
		}
		else
			kleur = Colors[ islot ];

		document.getElementById(( "Slota" + islot )).style.backgroundColor = kleur;
		document.getElementById(( "Slotb" + islot )).style.backgroundColor = kleur;
		document.getElementById(( "Slotc" + islot )).style.backgroundColor = kleur;

		document.getElementById(( "Slota" + islot )).style.cursor = "pointer";
		document.getElementById(( "Slotb" + islot )).style.cursor = "pointer";
		document.getElementById(( "Slotx" + islot )).style.cursor = "pointer";

		if ( browserType2 ) {
			document.getElementById(( "Slotd" + islot )).style.backgroundColor = kleur;
		}
		document.getElementById(( "Slotx" + islot )).style.backgroundColor = kleur;
	}

	


	if( window.innerHeight && window.scrollMaxY ) // Firefox
	{
		pageWidth = window.innerWidth + window.scrollMaxX;
		pageHeight = window.innerHeight + window.scrollMaxY;
	}
	else
		if( document.body.scrollHeight > document.body.offsetHeight ) // all but Explorer Mac
		{
			pageWidth = document.body.scrollWidth;
			pageHeight = document.body.scrollHeight;
		}
		else // works in Explorer 6 Strict, Mozilla (not FF) and Safari
		{
			pageWidth = document.body.offsetWidth + document.body.offsetLeft;
			pageHeight = document.body.offsetHeight + document.body.offsetTop;
		}

//	setWidthHeight( "Back_out", pageWidth - 18 , pageHeight , 0, 0 );
	setWidthHeight( "Full", pageWidth - 18 , pageHeight, 0, 0 );
//	setWidthHeight( "Slots", pageWidth , pageHeight , 0, 0 );

}


function Buildnews()
{
		var htmlNews = '';
		var news_div = document.getElementById( 'Slot0' );

	if ( browserType2 ) {
		htmlNews = htmlNews + '<table class="slot_frame"> \
									<tr> \
										<td colspan="2">&nbsp;</td> \
									</tr> \
									<tr> \
										<td class="news_text" id="Slot0_txt">&nbsp;</td> \
										<td class="slot_titler">&nbsp;</td> \
									</tr> \
								</table>';
	}
	else {
		htmlNews = htmlNews + '<table class="slot_frame"> \
									<tr> \
										<td class="_ul"></td> \
										<td colspan="4" class="_top"></td> \
										<td class="_ur"></td> \
									</tr> \
									<tr > \
										<td class="_left"></td> \
										<td class="slot_titlell"></td> \
										<td class="news_titlel" id="Slot0x"\
											onmouseover="set_news_color();" \
											onmouseout="reset_news_color()" \
											onclick="hide_news()">X</td> \
										<td class="news_titlem">' + Titles[ 1 ] + '</td> \
										<td class="news_titler"></td> \
										<td class="_right"></td> \
									</tr> \
									<tr> \
										<td class="_left"></td> \
										<td class="news_text" id="Slot0_txt" colspan="4">News travels fast!</td> \
										<td class="_right"></td> \
									</tr> \
									<tr> \
										<td class="_bl"></td> \
										<td colspan="4" class="_bot"></td> \
										<td class="_br"></td> \
										</tr> \
							</table>';
	}
	news_div.innerHTML = htmlNews;
	document.getElementById( 'Slot0' ).style.left  = ( 850 - ( piv * slotXoff )) + "px";
	document.getElementById( 'Slot0x' ).style.cursor = "pointer";
}


function Buildview()
{
		var htmlView = '';
		var news_div = document.getElementById( 'View' );

	if ( browserType2 ) {
		htmlView = htmlView + '<table class="slot_frame"> \
									<tr> \
										<td colspan="2">&nbsp;</td> \
									</tr> \
									<tr> \
										<td class="news_text" id="Slot0_txt">&nbsp;</td> \
										<td class="slot_titler">&nbsp;</td> \
									</tr> \
								</table>';
	}
	else {
		htmlView = htmlView + '<table class="slot_frame"> \
									<tr> \
										<td class="_ul"></td> \
										<td colspan="4" class="_top"></td> \
										<td class="_ur"></td> \
									</tr> \
									<tr > \
										<td class="_left"></td> \
										<td bgcolor="#FFFFFF" class="slot_titlell"></td> \
										<td bgcolor="#FFFFFF" class="view_titlel" id="Viewx"\
											onmouseover="set_news_color();" \
											onmouseout="reset_news_color()" \
											onclick="hide_view()">X</td> \
										<td bgcolor="#FFFFFF" id="view_title" class="view_titlem"></td> \
										<td bgcolor="#FFFFFF" class="slot_titler"></td> \
										<td class="_right"></td> \
									</tr> \
									<tr> \
										<td class="_left"></td> \
										<td bgcolor="#FFFFFF" class="view_text" id="View_txt" colspan="4"> \
											<iframe marginwidth="0" marginheight="0" id="Viewframe" src="http://www.arnhemmodebiennale.com/stichting/Gallerie/1_NL.html" scrolling="no" frameborder="0"></iframe> \
										</td> \
										<td class="_right"></td> \
									</tr> \
									<tr> \
										<td class="_bl"></td> \
										<td colspan="4" class="_bot"></td> \
										<td class="_br"></td> \
										</tr> \
							</table>';
	}
	news_div.innerHTML = htmlView;
//	document.getElementById( 'View' ).style.left  = "291px";
	document.getElementById( 'View' ).style.left  = ( 291 - ( 12 * slotXoff )) + "px";
	if ( nrofSlots > 12 )
		document.getElementById( 'View' ).style.top  = ( 190 + (( nrofSlots - 12 ) * slotYoff )) + "px";
	document.getElementById( 'Viewx' ).style.cursor = "pointer";
}


function show_item( itemnr )
{
		var newsind = 0;
		var nItem = 'Item_' + newsind;
		
	show_slot( 1 );

	while ( document.getElementById( nItem ))
	{
		document.getElementById( nItem ).style.display = "none";
		newsind = newsind + 1;
		nItem = 'Item_' + newsind;
	}

//	for( newsind = 0; newsind  <= nrofnewsItems; newsind++ )
//	{
//		nItem = 'Item_' + newsind;
//		document.getElementById( nItem ).style.display = "none";
//	}	

	document.getElementById( itemnr ).style.display = "block";
}

function show_proj( itemnr )
{
	document.getElementById( 'Proj_1' ).style.display = "none";
	document.getElementById( 'Proj_2' ).style.display = "none";
	document.getElementById( 'Proj_3' ).style.display = "none";
	document.getElementById( itemnr ).style.display = "block";
	setTimeout('window.scroll(0, 750)', 200);
}

function show_story( jaar )
{
		stijl = jaar + 's';

	document.getElementById( 'J2005' ).style.display = "none";
	document.getElementById( 'J2005s' ).style.textDecoration  = "none";
	document.getElementById( 'J2007' ).style.display = "none";
	document.getElementById( 'J2007s' ).style.textDecoration  = "none";
	document.getElementById( 'J2009' ).style.display = "none";
	document.getElementById( 'J2009s' ).style.textDecoration  = "none";
	document.getElementById( jaar ).style.display = "block";
	document.getElementById( stijl ).style.textDecoration = "underline";
}

function get_content( contentfile, Slot2fill )
{
	Current_Slot = Slot2fill;
	getFile( contentfile );
	
	if (( typeof( xmlhttp )) != 'object' )
	{
		document.write('You need to upgrade your browser to use this page.\r\nAs of March 2006 more than 98% of the web browsers in use support the remote scripting object. Either your browser does not support remote scripting or the support has been disabled.');
	}
}


function textindivs()
{
	if ( xmlhttp.readyState == 4 )
	{
		if ( xmlhttp.status == 200 )
		{
			document.getElementById( Current_Slot ).innerHTML = xmlhttp.responseText;
		}
	}
}


function getFile( pURL )
{
	if ( window.XMLHttpRequest )
	{												// code for Mozilla, Safari, etc 
		xmlhttp = new XMLHttpRequest();
		xmlhttp.onreadystatechange = textindivs;
		xmlhttp.open( "GET", pURL );			// leave true for Gecko
		xmlhttp.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
		xmlhttp.send( null );
	}
	else if ( window.ActiveXObject )
		{											//IE 
			xmlhttp = new ActiveXObject( 'Microsoft.XMLHTTP' );
			if ( xmlhttp )
			{
				xmlhttp.onreadystatechange = textindivs;
				xmlhttp.open( 'GET', pURL );
				xmlhttp.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
				xmlhttp.send( null );
			}
		} else
			{
//				alert('Your browser does not appear to support remote scripting.');
				xmlhttp = false;
			}
}


function response_window ( url )
{
		var window_specs ="status=no, location=no, scrollbars=no, menubars=no, toolbars=no, resizable=no, left=300, top=200, width=400, height=200";
		var url = url;
	
	popup_window = open( url, 'Confirmation Window', window_specs );
	popup_window.focus();
}

function CXMLReq( type, xmlhttp )
{
	this.type = type;
	this.xmlhttp = xmlhttp;
}


function xmlreqGET( )
{
	var xmlhttp = false;
	
	for ( islot = 0; islot <= nrofSlots ; islot++ )
	{
			var Slotid = "Slot" + islot;
			var url = 'Vensters' + Pathes[ islot ] + '/content_' + Language + '.php';


		xmlreqs[ islot ] = false;

		if ( window.XMLHttpRequest ) { // Mozilla, etc.
			xmlhttp = new XMLHttpRequest();
			xmlreqs[ islot ] = new CXMLReq( '', xmlhttp );
			xmlreqs[ islot ].xmlhttp.onreadystatechange = function() {
				if ( typeof( xmlhttpChange ) != 'undefined') { 
					xmlhttpChange( islot );
				}
			}
			if ( browserType1 )	{
				xmlreqs[ islot ].xmlhttp.onload = function() {
					if ( typeof( xmlhttpChange ) != 'undefined') { 
						xmlhttpChange( islot );
					}
				}
			}
//			xmlhttpChange;
			xmlreqs[ islot ].xmlhttp.open( "GET", url, false );
			xmlreqs[ islot ].xmlhttp.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
			xmlreqs[ islot ].xmlhttp.send( null );
		}
		else
			if ( window.ActiveXObject ) { // IE
				xmlhttp = new ActiveXObject( "Microsoft.XMLHTTP" );
				xmlreqs[ islot ] = new CXMLReq('', xmlhttp );
				if ( xmlreqs[ islot ].xmlhttp ) {
					xmlreqs[ islot ].xmlhttp.onreadystatechange = function( ) {
						if ( typeof( xmlhttpChange ) != 'undefined') { 
							xmlhttpChange( islot );
						}
					}
//					xmlhttpChange;
					xmlreqs[ islot ].xmlhttp.open( "GET", url, true);
					xmlreqs[ islot ].xmlhttp.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
					xmlreqs[ islot ].xmlhttp.send();
				}
		}
	}
}


function xmlhttpChange( slot_nr )
{
		var Slot2fill = 'Slot' + slot_nr + '_txt';
//	var xmldoc = null;

//	if ( typeof( window['xmlreqs'] ) == "undefined" ) return;

	if ( xmlreqs[ slot_nr ].xmlhttp.readyState == 4 ) {
		if ( xmlreqs[ slot_nr ].xmlhttp.status == 200 || xmlreqs[ slot_nr ].xmlhttp.status == 304 ) {
//			if (document.implementation && document.implementation.createDocument) {
//				xmldoc = document.implementation.createDocument("", "", null);
//			} else if (window.ActiveXObject) {
//				xmldoc = new ActiveXObject("Microsoft.XMLDOM");
//			}
			document.getElementById( Slot2fill ).innerHTML = xmlreqs[ slot_nr ].xmlhttp.responseText;
		}
	}
}


function handle_response( Content )
{
//		var Slotid = 'Slot' + slotnr + '_txt';
	
	document.getElementById( 'Slot2_txt' ).innerHTML = Content;
}
