
var DHTML = (document.getElementById || document.all || document.layers);

//Array List Press
var press = new Array("dazedseptember2004", "idoctober2006", "musenumber5", "graziajanuary2007", "plastiquespring2007", "metalmarch2007", "tankissue8", "vogueapril2007", "voguejune2007", "purplesummer2007", "press_october_2007_stimulus_response", "press_october_2007_sam5", "press_october_2007_purple_fahion_mag", "press_october_2007_plastique", "press_october_2007_nylon", "press_october_2007_muse", "press_october_2007_id_oct_2007", "press_october_2007_grazia", "press_october_2007_elle", "press_october_2007_style", "press_november_2007_grazia", "press_november_2007_ft", "press_december_2007_metal", "press_december_2007_dansk", "press_may_2008_amelia", "press_may_2008_neo2", "press_may_2008_guardian", "press_may_2008_vogue_italina", "press_may_2008_id", "press_may_2008_yodona", "press_may_2008_wwd", "press_may_2008_daily", "press_may_2008_yodona_1may", "press_may_2008_guardian_2", "press_may_2008_let_them_eat_cake", "press_may_2008_man_about_town", "press_may_2008_numero", "press_may_2008_purple", "press_may_2008_bon", "press_may_2008_b_guided", "press_may_2008_032c", "press_may_2008_elle", "press_may_2008_vogue", "press_june_2008_amelias", "press_june_2008_dansk", "press_june_2008_elle", "press_june_2008_ponytail", "press_june_2008_stimul", "press_june_2008_telegraph_magazine", "press_july_2008_guardian", "press_july_2008_teen_vogue", "press_september_2008_i-d", "press_september_2008_odds_and_ends");
var totalPicsPress = new Array(6, 5, 4, 2, 4, 7, 4, 2, 5, 4, 8, 2, 2, 2, 2, 3, 2, 3, 2, 3, 2, 2, 2, 2, 6, 2, 3, 3, 2, 3, 2, 2, 2, 2, 2, 2, 5, 2, 2, 3, 3, 3, 2, 2, 2, 2, 5, 2, 2, 3, 2, 2, 2);

//Array List Collection
var collections = new Array("ss09","aw0910","ss10","aw1011");
var totalPicsCollection = new Array(22,20,23,22);


function pressPic()
{
    var html = "";
	if(document.getElementById('pressimages').innerHTML.length == 0)
	{
		for(var i = (press.length - 1); i >= 0; i--)
		{
		    
			html += "<img src='images/um.gif' alt='empty' width='10' height='10' border='0' /><br /><img src='images/um.gif' alt='empty' width='9' height='9' border='0' />";
			for(var cont=1; cont<=totalPicsPress[i];cont++)
			{
				html += "<img src='images/um.gif' alt='empty' width='1' height='1' border='0' /><a href='collections/press/big/" + press[i] + "/" + cont + ".jpg' rel='lightbox['press']'><img src='collections/press/thumb/" +  press[i] + "/" + cont + ".jpg' height='140' border='0' /></a>";
			}
			html += "<img src='images/um.gif' alt='empty' width='14' height='14' border='0' /><br />";
		}
		html += "<img src='images/um.gif' alt='empty' width='16' height='16' border='0' /><br />";


		document.getElementById('pressimages').innerHTML = html;
	}
	
	initLightbox();
}



function collectionPic(area)
{
	if(area.length == 0)
		area = collections[collections.length-1];

	var aux = 0;
	for(var collection in collections)
	{
		if(collections[aux] == area)
			break;
		else
			aux++;
	}

	if(document.getElementById(area +'images').innerHTML.length == 0)
{	
		var html = "<img src='images/um.gif' alt='empty' width='10' height='10' border='0' /><br />";
		for(var i=1; i<=totalPicsCollection[aux];i++)
		{
			html += "<img src='images/um.gif' alt='empty' width='10' height='10' border='0' /><a href='collections/" + area + "thumbs/" + i + ".jpg' rel='lightbox[" + area + "]'><img src='collections/" + area + "thumbs/" + i + "t.jpg' width='133' height='200' border='0' /></a>";
			if((i%5==0) && (i != totalPicsCollection[aux]))
				html += "<img src='images/um.gif' alt='empty' width='10' height='10' border='0' /><br /><img src='images/um.gif' alt='empty' width='10' height='10' border='0' /><br />";
		}
		html += "<img src='images/um.gif' alt='empty' width='15' height='15' border='0' /><br /><img src='images/um.gif' alt='empty' width='15' height='15' border='0' /><br />";

		document.getElementById(area +'images').innerHTML = html;
		

	}
	initLightbox();
}


function setCss()
{
	var	aux = 0;
	for(var i = (collections.length - 1); i >= 0; i--)
	{
		var x = document.getElementById(collections[i]);
		x.style.position = 'absolute';
		x.style.width = '728px';
		//x.style.height = 325*(totalPics[i]/5) + 'px';
		x.style['z-index'] = aux;
		x.style.left = (308-(aux*40)) + 'px';
		x.style.top = (173 + (aux*20)) + 'px';
		

		if(aux%2==0)
			x.style['backgroundColor'] = '#242424';
		else
			x.style['backgroundColor'] = '#1F1E1F';

		x.style.display = 'none';

		var y = document.getElementById(collections[i] + 'Aux');
		y.style.display = 'block';
		

		
		aux++;
	}
}

function getObj(name)
{
  if (document.getElementById)
  {
	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
	this.obj = document.layers[name];
	this.style = document.layers[name];
  }
}

function changeMenu(flag, area)
{
	if (!DHTML) return;
	var x = new getObj('press');
	x.style.display = (flag && area == 'press') ? 'block' : 'none'
	
	if (!DHTML) return;
	var x = new getObj('contact');
	x.style.visibility = (flag && area == 'contact') ? 'visible' : 'hidden'
    
	if (!DHTML) return;
	if(flag && area != 'collections')	
	{
		for(var i = (collections.length - 1); i >= 0; i--)
		{

			var x = document.getElementById(collections[i]);
			x.style.display = 'none'
		}
	}
	else if(flag && area == 'collections')
	{
		var x = document.getElementById(collections[(collections.length-1)]);
		x.style.display = 'block'
	}
}


function changeCollection(flag, collection)
{
	if (!DHTML) return;
	var x = document.getElementById(collection);
	x.style.display = (flag) ? 'block' : 'none'
}
