// JavaScript Document
//*****************************************GENERAL**********************************************
// m0rph3u@gmail.com

var imagesArray = new Array();
var imageNames = new Array("bypassLogo"/*,"relx"*/,"fcg",/*"artelx",*/"ica"/*,"plaxio"*/,"hongkongartfair");
var imageW = new Array("169"/*,"166"*/,"250",/*"125",*/"114","125","185");
var imageH = new Array("169"/*,"67"*/,"40",/*"125",*/"40","125","150");
function preloadImages()
{
	imagesArray[0] = new Image();
	imagesArray[0].src = "/supporting/images/logo_bypass_cores_RGB.jpg";
	imagesArray[1] = new Image();
	imagesArray[1].src = "/supporting/sponsor/fcg.jpg"
	//imagesArray[2] = new Image();
	//imagesArray[2].src = "/supporting/sponsor/alisboa.gif"
	//imagesArray[4] = new Image();
	//imagesArray[4].src = "/supporting/sponsor/BA_estrelas.gif";
	imagesArray[2] = new Image();
	imagesArray[2].src = "/supporting/sponsor/ica.gif"
	imagesArray[3] = new Image();
	imagesArray[3].src = "/supporting/sponsor/ARTHK_composite_logo.jpg"
	//imagesArray[4] = new Image();
	//imagesArray[4].src = "/supporting/sponsor/ARTHK_composite_logo.jpg"
	
	/*imagesArray[1] = new Image();
	imagesArray[1].src = "/pub/radio_europa.jpg"
	imagesArray[2] = new Image();
	imagesArray[2].src = "/supporting/sponsor/fcg.jpg"
	imagesArray[3] = new Image();
	imagesArray[3].src = "/supporting/sponsor/alisboa.gif"
	//imagesArray[4] = new Image();
	//imagesArray[4].src = "/supporting/sponsor/BA_estrelas.gif";
	imagesArray[4] = new Image();
	imagesArray[4].src = "/supporting/sponsor/ica.gif"
	imagesArray[5] = new Image();
	imagesArray[5].src = "/supporting/sponsor/plaxio.gif"
*/
	
}

function ami()
{
	var str = "http://www.bypass.pt/docs/01_2010_Campanha Haiti.pdf";
	window.open(str,"mywindow","location=0,status=0,toolbar=0,menubar=0,height=600,width=800");
}

function setImages()
{
	for(i=0;i<imageNames.length;i++)
	{
		if (document.getElementById)
		{
			var y = document.getElementById(imageNames[i]);
			y.src = imagesArray[i].src;
			y.width = imageW[i];
			y.height = imageH[i];
		}
	}
}

function cleanContent()
{
	var htmlText="";if (document.getElementById){x = document.getElementById('showArea');x.innerHTML = '';x.innerHTML = htmlText;}
}

function cleanLeftCell()
{
	var htmlText="";if (document.getElementById){x = document.getElementById('leftCell');x.innerHTML = '';x.innerHTML = htmlText;}
}


//***************************************END GENERAL***********************************************

var menu_array    = new Array("magazine","subscription","advertise","contact","about");
var menu_pt_array = new Array("Edi&ccedil;&otilde;es","Subscri&ccedil;&atilde;o","Anuncie","Contactos","Sou");
var menu_en_array = new Array("Editions","Subscription","Advertise","Contacts","I am");
var cur_op = "magazine";

function forceOp()
{
	switch(cur_op)
	{
		case "magazine":
			showMagazine();
			break;
		case "subscription":
			showSubscription();
			break;
		case "advertise":
			showAdvertise();
			break;
		case "contacts":
			showContact();
			break;
		case "about":
			showAbout();
			break;
		default:
			break;
	}
	showSupport();	
}

//*************************************************************************************************
var lang_array = new Array('PT','EN');

var cur_lang = lang_array[1];
var new_lang = lang_array[1];

function setLang(lang)
{
	new_lang = lang;
	if(cur_lang != new_lang)
	{
		forceLang(new_lang);
	}
}

function forceLang(lang)
{
	var array_lang;
	if(lang == 'PT'){array_lang = menu_pt_array;}else{array_lang=menu_en_array;}
	for(i=0;i<menu_array.length;i++)
	{
		if (document.getElementById){x = document.getElementById(menu_array[i]);x.innerHTML = '';x.innerHTML = array_lang[i];}
	}
	cur_lang = lang;
	
	forceOp();
	setImages();
}

//*************************************************************************************************
var about_pt = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"30px\" width=\"100%\"><tr><td class=\"textstyle\"><b>SOU</b></td></tr><tr><td valign=\"top\" align=\"center\"><div class=\"textstyle\">Sou h i p e r d i s c i p l i n a r<br>Sou &aacute;vida pela diversidade: do conhecimento humano e das identidades<br>Sou Arquitectura, no primeiro n&uacute;mero, em 2009<br>Sou anual, portanto<br>Sou desenhada por 37 autores das d&eacute;cadas de 60 a 80, nacionais e estrangeiros<br>Sou nutrida em l&iacute;ngua portuguesa e inglesa<br>Sou Artes Visuais, Joalharia, Cinema, Dan&ccedil;a, M&uacute;sica, Filosofia, Arquitectura, Ilustra&ccedil;&atilde;o,<br>Gastronomia, Poesia, Design, Fic&ccedil;&atilde;o, e muitas outras &aacute;reas<br>Sou cria&ccedil;&atilde;o<br>Sou divulga&ccedil;&atilde;o<br>Sou residual e ut&oacute;pica<br>Sou espa&ccedil;o de reflex&atilde;o e edi&ccedil;&atilde;o – voluntariamente afastada dos actuais paradigmas<br>Sou <font class=\"textstyle_blue\">desvio</font>, um conjunto de circuitos perif&eacute;ricos interpenetrados<br>Sou um embrião biotecnol&eacute;gico que fl&uacute;i por tubos interiores e exteriores ao corpo humano, ao<br>corpo art&iacute;stico – dilu&iacute;do em novos l&iacute;quidos e experi&ecirc;ncias<br>Sou publica&ccedil;&atilde;o, em formato A5, e tenho 300 p&aacute;ginas<br>Sou edi&ccedil;&atilde;o – publico Livros de Autor<br>Sou exposi&ccedil;&otilde;es, sou confer&ecirc;ncias, sou concertos, sou espect&aacute;culos e tudo o mais que quererei<br>ser<br>Sou assumida e despojada<br>Sou novo percurso – evito lugares recalcados<br>Sou desvinculada de qualquer linha pol&iacute;tica, est&eacute;tica e religiosa ortodoxas<br>Sou aut&oacute;noma<br>Sou livre<br>Sou BYPASS</div></td></tr></table>";

var about_en = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"30px\" width=\"100%\"><tr><td class=\"textstyle\"><b>I AM</b></td></tr><tr><td class=\"textstyle\" valign=\"top\" align=\"center\">I am h y p e r d i s c i p l i n a r y<br>I am avid by diversity: of the human knowledge and identities<br>I am Architecture, in the first number, 2009<br>I am annual, therefore<br>I am designed by 37 authors born between the 60’s and the 80’s, nationals and foreigners<br>I am nourished in English and Portuguese<br>I am Visual Arts, Jewellery, Cinema, Dance, Music, Philosophy, Architecture, Illustration,<br>Gastronomy, Poetry, Design, Fiction, and many other areas<br>I am creation<br>I am disclosure<br>I am residual and utopian<br>I am space of reflection and edition – voluntarily far from the current paradigms<br>I am <font class=\"textstyle_blue\">detour</font>, an assembly of interpenetrated peripheral circuits<br>I am a biotechnological embryo that flows through exterior and interior pipes to the human<br>body, to the artistic body - diluted in new liquids and experiences<br>I am publication, in A5 format, and I have 300 pages<br>I am edition – I publish Artist Books<br>I am exhibitions, I am conferences, I am concerts, I am spectacles and the more I will<br>I am assumed and despoiled<br>I am new journey – I avoid repressed places<br>I am freed of any political, aesthetics and religious orthodox line<br>I am autonomous<br>I am free<br>I am BYPASS</td></tr></table>";

function showAbout()
{
	cleanLeftCell();
	cur_op = "about";
	htmlText = (cur_lang == 'PT')?about_pt:about_en;
	
	if (document.getElementById)
		{
			x = document.getElementById('showArea');
			x.innerHTML = '';
			x.innerHTML = htmlText;
		}
}


function showSupport()
{
	var htmlText = (cur_lang == 'PT')?"Com o apoio de:":"Supported by:";
	
	if (document.getElementById)
		{
			x = document.getElementById('support');
			x.innerHTML = '';
			x.innerHTML = htmlText;
		}
}

var contact_pt = "<tr><td align=\"left\" valign=\"top\"><pre class=\"textstyle\"><b>Contactos:</b><br><br><b>Editores:</b> G&auml;elle Silva Marques &amp; &Aacute;lvaro Sei&ccedil;a Neves<br>[t](+351)914039671 | (+351)967877656<br>[e]<a href=\"mailto:info@bypass.pt\">info@bypass.pt</a><br><br><b>Produ&ccedil;&atilde;o:</b> <br>[e]<a href=\"mailto:producao@bypass.pt\">producao@bypass.pt</a><br>[t](+351) 910354460<br><br><b>Design Gr&aacute;fico:</b> Gon&ccedil;alo Viegas / Ricardo Miranda<br><br><b>Web Design:</b> Pedro dos Reis / Gonçalo Viegas<br><br>[p]<br>BYPASS - Associa&ccedil;&atilde;o Cultural<br>Uz. Horta dos Telhais - Rua Bispo de Dili, 1 - 2ºD<br>7000-649 &Eacute;vora<br>Portugal<br>[skype]bypass.magazine </pre></td></tr>";

var contact_en = "<tr><td align=\"left\" valign=\"top\"><pre class=\"textstyle\"><b>Contacts:</b><br><br><b>Publishers:</b> G&auml;elle Silva Marques &amp; &Aacute;lvaro Sei&ccedil;a Neves<br>[t](+351)914039671 | (+351)967877656<br>[e]<a href=\"mailto:info@bypass.pt\">info@bypass.pt</a><br><br><b>Production:</b><br>[e]<a href=\"mailto:production@bypass.pt\">production@bypass.pt</a><br>[t](+351) 910354460<br><br><b>Graphic Design:</b> Gon&ccedil;alo Viegas / Ricardo Miranda<br><br><b>Web Design:</b> Pedro dos Reis / Gonçalo Viegas<br><br>[p]<br>BYPASS - Associa&ccedil;&atilde;o Cultural<br>Uz. Horta dos Telhais - Rua Bispo de Dili, 1 - 2ºD<br>7000-649 &Eacute;vora<br>Portugal<br>[skype]bypass.magazine </pre></td></tr>";


function showContact()
{
	//cleanContent();
	cleanLeftCell();
	cur_op = "contacts";
	var htmlText = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" >";
	htmlText += (cur_lang == 'PT')?contact_pt:contact_en;
	htmlText +="</table>";
	
	if (document.getElementById)
		{
			x = document.getElementById('showArea');
			x.innerHTML = '';
			x.innerHTML = htmlText;
		}
	
	//var cur_str = (cur_lang == 'PT')?"Ver mapa aumentado":"View Larger Map";
	/*map = "";
	
	if (document.getElementById)
		{
			x = document.getElementById('showArea');
			x.innerHTML = '';
			x.innerHTML = map;
		}*/
}

//********************************************************************************************************

var mag_pt ="<table border=\"0\" cellpadding=\"0\" cellspacing=\"30px\"><tr><td class=\"textstyle\"><b>ARQUITECTURA</b></td><td><!-- a href=\"docs/pressrelease.pdf\" target=\"_blank\" class=\"textstylelink\">Press Release</a --></td></tr><tr><td class=\"textstyle\"><b>Autores:</b></td></tr><tr><td class=\"textstyle\" valign=\"top\">&Aacute;lvaro Sei&ccedil;a Neves [poesia] - PT<br>Amadeo Guadiana [fotografia] - ESP<br>Ana Tecedeiro [pintura] - PT<br>Carlos Bunga [instala&ccedil;&atilde;o/performance] - PT<br>Carlos M. Guimar&atilde;es [arquitectura] - PT<br>C&eacute;sar Parreira [fic&ccedil;&atilde;o] - PT<br>Claude Schmitz [joalharia] - LUX<br>Cristina Cavallotti [arquitectura/gastronomia] - ITA<br>Daniel Malh&atilde;o [fotografia] - PT<br>Duarte Kr&uuml;ger [arquitectura] - BR / PT<br>Duarte Lobo Antunes [arquitectura] - PT<br>e.e. [fic&ccedil;&atilde;o] - PT<br>Emanuel Nevado [m&uacute;sica] - PT<br>Gon&ccedil;alo Viegas [design] - PT<br>Gregorio Carboni Maestri [arquitectura] - BLG/ITA/BR<br>Hiroaki Umeda [dan&ccedil;a] - JAP<br>Julian Mayor [design] - RU<br>Julieta Cervantes [fotografia/dan&ccedil;a] - MEX</td><td class=\"textstyle\" valign=\"top\">Lucien Zell [poesia] - EUA<br>Lu&iacute;s Royal [design] - PT<br>Manfred Pernice [artes visuais] - ALE<br>Mikkel Hermann S&oslash;rensen [arquitectura] - DIN<br>Nils Wogram [m&uacute;sica] - ALE<br>Ozias Filho [poesia/fotografia] - BR<br>Pavel Braila [artes visuais] - MOL<br>Pedro Bismarck [arquitectura] - PT<br>Pedro Clarke [arquitectura] - RU / PT<br>Pedro dos Reis [artes visuais] - PT<br>Pedro Jord&atilde;o [arquitectura/cinema] - PT<br>Pedro Ribeiro Dias [fic&ccedil;&atilde;o] - PT<br>Pedro Sena-Lino [poesia] - PT<br>Ricardo Miranda [design] - PT<br>Ricardo T&eacute;rcio [ilustra&ccedil;&atilde;o] - PT<br>Rui Aristides [arquitectura] - PT<br>Simon Critchley [filosofia] - RU</td></tr></table>";

var mag_en ="<table border=\"0\" cellpadding=\"0\" cellspacing=\"30px\"><tr><td class=\"textstyle\"><b>ARCHITECTURE</b></td><td><!-- a href=\"docs/pressrelease.pdf\" target=\"_blank\" class=\"textstylelink\">Press Release</a --></td></tr><tr><td class=\"textstyle\"><b>Authors:</b></td></tr><tr><td class=\"textstyle\" valign=\"top\">&Aacute;lvaro Sei&ccedil;a Neves [poetry] - PT<br>Amadeo Guadiana [photography] - SPA<br>Ana Tecedeiro [painting] - PT<br>Carlos Bunga [installation/performance] - PT<br>Carlos M. Guimar&atilde;es [architecture] - PT<br>C&eacute;sar Parreira [fiction] - PT<br>Claude Schmitz [jewellery] - LUX<br>Cristina Cavallotti [architecture/gastronomy] - ITA<br>Daniel Malh&atilde;o [photography] - PT<br>Duarte Kr&uuml;ger [architecture] - BR / PT<br>Duarte Lobo Antunes [architecture] - PT<br>e.e. [fiction] - PT<br>Emanuel Nevado [music] - PT<br>Gon&ccedil;alo Viegas [design] - PT<br>Gregorio Carboni Maestri [architecture] - BLG/ITA/BR<br>Hiroaki Umeda [dance] - JAP<br>Julian Mayor [design] - UK<br>Julieta Cervantes [photography/dance] - MEX</td><td class=\"textstyle\" valign=\"top\">Lucien Zell [poetry] - USA<br>Lu&iacute;s Royal [design] - PT<br>Manfred Pernice [visual arts] - GER<br>Mikkel Hermann S&oslash;rensen [architecture] - DK<br>Nils Wogram [music] - GER<br>Ozias Filho [poetry/photography] - BR<br>Pavel Braila [visual arts] - MOL<br>Pedro Bismarck [architecture] - PT<br>Pedro Clarke [architecture] - UK / PT<br>Pedro dos Reis [visual arts] - PT<br>Pedro Jord&atilde;o [architecture/cinema] - PT<br>Pedro Ribeiro Dias [fiction] - PT<br>Pedro Sena-Lino [poetry] - PT<br>Ricardo Miranda [design] - PT<br>Ricardo T&eacute;rcio [illustration] - PT<br>Rui Aristides [architecture] - PT<br>Simon Critchley [philosophy] - UK</td></tr></table>";

function showMagazine()
{
	//cleanContent();
	//cleanLeftCell();
	cur_op="magazine";
	var lg = (cur_lang=='PT')?"pt":"en";
	var htmlText = "<table border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=\"90%\">";
	htmlText +="<tr><td align=\"left\" valign=\"top\">"+eval("mag_"+lg)+"</td></tr></table>";
	
	if (document.getElementById)
		{
			x = document.getElementById('showArea');
			x.innerHTML = '';
			x.innerHTML = htmlText;
		}
		
	showMagLeftCell();
}

function showMagLeftCell()
{

 var orderStr = (cur_lang=='PT')?"Encomende aqui":"Order here";
 var partnerStr = (cur_lang=='PT')?"Parceria:":"Partnership:";
 var subjectStr = (cur_lang=='PT')?"Compra da primeira edi&ccedil;&atilde;o":"Order first issue";
 var htmlText ="<object style=\"width:177;height:132\"><param name=\"movie\" value=\"http://static.issuu.com/webembed/viewers/style1/v1/IssuuViewer.swf?mode=preview&amp;documentId=091016224549-8fe2a3d46e564a9892cb54570378958d&amp;documentUsername=BYPASS&amp;documentName=bypass_maquete&amp;previewLayout=white&amp;autoFlip=true\" /><param name=\"allowFullScreen\" value=\"true\" /><embed src=\"http://static.issuu.com/webembed/viewers/style1/v1/IssuuViewer.swf\" type=\"application/x-shockwave-flash\" allowFullScreen=\"true\" style=\"width:177;height:132\" flashvars=\"mode=preview&amp;documentId=091016224549-8fe2a3d46e564a9892cb54570378958d&amp;documentUsername=BYPASS&amp;documentName=bypass_maquete&amp;previewLayout=white&amp;autoFlip=true\" /></object><br><center><a href=\"mailto:subscricoes@bypass.pt?Subject="+subjectStr+"\" class=\"textstylelink\">"+orderStr+"</a></center><br>";

htmlText += "<p class=\"textstyle\">"+partnerStr+"</p><a href=\"http://www.traficolx.net\" target=\"_blank\"><img src=\"/supporting/sponsor/traficologo.png\" title=\"Tr&aacute;fico\" border=\"0\" /></a>";
 
		if (document.getElementById)
		{
			x = document.getElementById('leftCell');
			x.innerHTML = '';
			x.innerHTML = htmlText;
		}
}

//********************************************************************************************************

var subs_pt = "<pre class=\"textstyle\"><p>Pre&ccedil;o de capa: 18&euro;, 16&pound;, $US23</p><p>Despesas de envio:<br>Portugal e resto da Europa: 18&euro; + despesas de envio<br>R.U.: 16&pound; + despesas de envio<br>EUA: $US23 + despesas de envio</p><p><b><a href=\"mailto:subscricoes@bypass.pt?Subject=Compra da primeira edi&ccedil;&atilde;o\" class=\"textstylelink\">Encomende aqui</a></p></b></pre>";

var subs_en = "<pre class=\"textstyle\"><p>Cover price: 18&euro;, 16&pound;, $US23</p><p>Shipping:<br>Portugal and rest of Europe: 18&euro; + shipping<br>UK: 16&pound; + shipping<br>USA: $US23 + shipping</p><p><b><a href=\"mailto:subscriptions@bypass.pt?Subject=Order first issue\"  class=\"textstylelink\">Order here</a></b></p></pre>";

function showSubscription()
{
	//cleanContent();
	//cleanLeftCell();
	//showMagLeftCell();
	cur_op="subscription";
	var lg = (cur_lang=='PT')?"pt":"en";
	var htmlText = "<table border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=\"90%\">";
	htmlText +="<tr><td align=\"left\" valign=\"top\">"+eval("subs_"+lg)+"</td></tr></table>";
	
	if (document.getElementById)
		{
			x = document.getElementById('showArea');
			x.innerHTML = '';
			x.innerHTML = htmlText;
		}
}

//********************************************************************************************************

function showAdvertise()
{
	cleanContent();
	cleanLeftCell();
	cur_op="advertise";
	var lg = (cur_lang=='PT')?"PT":"EN";
	//window.open("/docs/BYPASS_PUB_"+cur_lang+".pdf", "adWindow");
	
	var textPT = "<pre class=\"textstyle\">Para mais informa&ccedil;&otilde;es, por favor carregue neste <a href=\"mailto:producao@bypass.pt?Subject=Publicidade na Bypass\">link</a> ou envie um email para producao[at]bypass.pt</pre>";
	var textEN = "<pre class=\"textstyle\">For more information, please press the following <a href=\"mailto:production@bypass.pt?Subject=Advertising at Bypass\">link</a> or send an email to production[at]bypass.pt</pre>";
	
	var htmlText = eval("text"+lg);
	
	if (document.getElementById)
		{
			x = document.getElementById('showArea');
			x.innerHTML = '';
			x.innerHTML = htmlText;
		}
}