// browseWorks.js

var linkPath = "../";
var urltitlePath = "http://gp.co.at/pix/urltitles/";

var theIndeces = new Array (-1, -1, -1);


// worksList
// stores a sortable list all the works, together with
//    0 ... link= url of the case study of the project
//    1 ... urltitle= url of a picture-preview of the project
//    2 ... project= project name
//    3 ... tagline= project tagline
//    4 ... info= project info
//    5 ... client= client name
//    6 ... filler

var worksList = new Array (
	new Array ("alfredo", "card_alfredo.gif", "acamp alfredo", "sit comfortably!", "a bistro-chair", "acamp", "for"),
	new Array ("havanna", "card_havanna.jpg", "acamp havanna", "fresh. chill. lounge.", "wicker garden chair series", "acamp", "for"),
	new Array ("star", "card_star.gif", "acamp star", "swing with character", "a convertible hollywood-style swing", "acamp", "for"),
	new Array ("telezone", "card_telezone.gif", "AEC telezone", "tagline", "an architecture for net architecture", "ars electronica center", "for the"),
	new Array ("body+soul", "card_body+soul.gif", "Artweger body+soul", "tagline", "a steam shower for the rest of us", "Artweger", "for"),
	new Array ("seat", "card_seat.gif", "Artweger body&amp;soul-seat", "tagline", "a soft, foldable seat for more comfort in wellness", "Artweger", "for"),
	new Array ("cityline", "card_cityline.gif", "Artweger cityline top", "tagline", "shower enclosure with optimum transparency", "Artweger", "for"),
	new Array ("inline", "card_inline.gif", "Artweger inline", "tagline", "entry level shower enclosure", "Artweger", "for"),
	new Array ("twinline", "card_twinline.gif", "Artweger twinline", "shower & bathtub all in one", "shower bathtub", "Artweger", "for"),
//	new Array ("cream", "card_cream.gif", "cream", "tagline", "a financial self-service terminal", "arz", "for"),
	new Array ("variodyn", "card_variodyn.gif", "av digital variodyn D1", "unmistakably av digital", "sound system", "av digital", "for"),
	new Array ("biovital", "card_biovital.gif", "biovital perform", "50% market share right from the start", "package design for a tonic preparation", "biovital austria", "for"),
	new Array ("float", "card_float.gif", "B&ouml;sendorfer float", "the gesture of opening", "a contemporary interpretation of a piano which is still connected to its history", "B&ouml;sendorfer", "for"),

	new Array ("c-design", "card_c_design.gif", "Citro&euml;n c-design", "3 out of 5 awards for GP", "drain, kite and citro&euml;nette", "competition by Citro&euml;n", "for"),

	new Array ("nest", "card_nest.gif", "conlastic the nest", "more spinning fun at the playground", "spinning bowl", "conlastic", "for"),
	new Array ("cargoo", "card_cargoo.gif", "CRL cargoo", "innovation in operation", "loading procedure now faster and safer thanks to interaction design", "CRL Car Rail Logistics", "for"),
	new Array ("chairdrive", "card_chairdrive.gif", "Doppelmayr chairdrive", "quick and enthusiastic", "the drive unit housing of fixed-grip chair lifts as an industrial product", "Doppelmayr", "for"),

	new Array ("unig-v", "card_unigvision.gif", "Doppelmayr UNIG-Vision", "a huge product design", "station for ropeways with detachable chairs and gondolas", "Doppelmayr", "for"),

	new Array ("mocca", "card_mocca.gif", "Fabasoft mocca", "assist without taking over", "a pilot project", "Fabasoft", "for"),
	new Array ("facultas", "card_facultas.jpg", "facultas", "gut zu Wissen", "a new corporate design for a merger", "client", "filler"),
	new Array ("jano", "card_jano.gif", "JANO", "the evolution revolves", "diploma thesis in industrial design", "client", "filler"),
	new Array ("front", "card_front.gif", "FRONT", "a new musical interface", "diploma thesis in industrial design", "client", "filler"),
	new Array ("ipen", "card_ipen.gif", "iPen", "naturally interact with the digital world", "a concept study of a mobile device for the 21st century", "client", "filler"),
	new Array ("oasis", "card_oasis.jpg", "oasis", "a vehicle for experiencing vast areas of nature", "diploma thesis in industrial design", "client", "filler"),
//	new Array ("cream", "card_cream.gif", "cream", "tagline", "interaction design of a financial self-service terminal", "hypo tirol bank, hypo landesbank vorarlberg", "for"),
	new Array ("champ", "card_champ.jpg", "HEI champ", "photovoltaic exterior light", "photovoltaic exterior light", "HEI hornbacher energie innovation", "for"),
	new Array ("aonvirenchecker", "card_aonvirenchecker.gif", "IKARUS aonVirenchecker", "complexity made easy", "complex virus defense at long last simple", "ikarus software", "for"),

	new Array ("aero3237", "card_aero3237.gif", "MINERVA aero3237", "the product is the brand", "LCD TV, logo, packaging", "robust electronics gmbh", "for"),
	new Array ("datastation", "card_datastation.gif", "Otto Bock datastation", "seven with one blow", "software suite for prostheses, orthoses and mobility solutions", "Otto Bock", "for"),

	new Array ("dpm", "card_dpm.gif", "Philips dpm 9600", "a tool for professionals", "a digital voice recorder with barcode scanner and docking station", "Philips Speech Processing", "filler"),
	new Array ("crs955", "card_crs955.gif", "Philips crs 955", "a simply professional conference recording system", "a boundary layer conference microphone, a remote control and a click-on interview microphone are the ingredients for this conference recording system", "Philips Speech Processing", "filler"),
	new Array ("magic3", "card_magic3.gif", "Sagem magic3", "focused on on key!", "how can i change my outgoing voicemail announcement?", "Sagem", "for"),
	new Array ("cure", "card_cure.gif", "SBS cure", "tagline", "agent-based financial self service system", "SBS", "for"),
	new Array ("epen", "card_epen.gif", "Siemens ePen&trade;", "tagline", "unobtrusive remote control for hearing aids", "Siemens Audiology Group", "for"),

	new Array ("k2", "card_k2.jpg", "trenkwalder k2", "tagline", "an user-adaptable database client", "trenkwalder", "for"),

	new Array ("klimt", "card_klimt.gif", "Vienna acoustics klimt series", "tagline", "high-end speaker series", "Vienna acoustics", "for"),
	new Array ("schoenberg", "card_schoenberg.gif", "Vienna acoustics sch&ouml;nberg, webern, berg", "tagline", "high-end multichannel speaker system", "Vienna acoustics", "for"),
	new Array ("waltz", "card_waltz.gif", "Vienna acoustics waltz", "tagline", "wall-mounted speaker", "vienna acoustics", "for")
);


function findIndex (myUrl) {
	tmpIndices = new Array (-1, -1, -1);
	tmp= myUrl.split("/")
	tmpWorksPath= tmp[tmp.length-2];
	//tmpWorksPath= myUrl.slice(7, myUrl.lastIndexOf("/"));
	for (i= 0; i < worksList.length; i++) {
 		if (worksList[i][0] ==  tmpWorksPath) {
 			tmpIndices[0]= i-1;
 			tmpIndices[1]= i;
 			tmpIndices[2]= i+1;
 		}
 	}
	if (tmpIndices[1] == -1) { tmpIndices[1]= 1; }
	if (tmpIndices[1] == 0) { tmpIndices[0]= worksList.length-1; } else if (tmpIndices[1] == worksList.length-1) { tmpIndices[2]= 0; }
	{ return tmpIndices; }
}

theIndeces= findIndex(location.pathname);

function formString (myIndex) {
	tmpArray= worksList[myIndex];

	tmpString= '<a href="'+linkPath+tmpArray[0]+'/" title="<img src='+urltitlePath+tmpArray[1]+'>">';
/*
	tmpString= '<a href="'+linkPath+tmpArray[0]+'/" title="<img src='+urltitlePath+tmpArray[1]+'><br>'+tmpArray[2];
	if (tmpArray[3] != "tagline") {
		tmpString += ' &#8212; '+tmpArray[3];
	}
	tmpString += '<br>'+tmpArray[4];
	if (tmpArray[5] != "client") {
		tmpString += ' '+tmpArray[6]+' '+tmpArray[5]+'">';
	} else {
		tmpString += '">';
	}
*/
	return tmpString;
}


function writeHorizNavi (myString) {
	myString = formString(theIndeces[0])+'previous: '+worksList[theIndeces[0]][2]+'</a>'
	myString +=' | <a href="'+linkPath+'clients/">client list</a> | ';
	myString += formString(theIndeces[2])+'next: '+worksList[theIndeces[2]][2]+'</a>';
	document.write (myString);
}