//####################################################################
//Dokumentationen (Bücher)
//####################################################################

var anzb=12;  //Anzahl der Buecher
var seiten = new Array(anzb);

//####################################################################
//126 reparaturhandbuch
//####################################################################
seiten[0] = new Array();
var pre="../div/126-";
var out=".jpg";
var no="";
for (var c=0;c<=93;c++) {
	if (c==0) {
		no="00a";
	} else if (c==1) {
		no="00b";
	} else if (c<10) {
		no="0"+c;
	}else {
		no=c;
	}
	seiten[0][c]=pre+no+out;
}
seiten[0][93]="../div/126-93Lxl.jpg";
seiten[0][94]="../div/126-93Rxl.jpg";


//####################################################################
//DGF 30
//####################################################################
seiten[1] = new Array();
var pre="../div/dgf30-";
var out=".jpg";
var no="";
for (var c=0;c<=5;c++) {
	no=c;
	seiten[1][c]=pre+no+out;
}

//####################################################################
//126 BIS - Allgemeines / Technische Daten
//####################################################################
seiten[2] = new Array();
var pre="../div/bis-00-";
var out=".gif";
var no="";
for (var c=0;c<38;c++) {
	no=c+1;
	if (c<9) {
		no="0"+(c+1);
	}
	seiten[2][c]=pre+no+out;
}

//####################################################################
//126 BIS - Motor
//####################################################################
seiten[3] = new Array();
var pre="../div/bis-10-";
var out=".gif";
var no="";
for (var c=0;c<70;c++) {
	no=c+1;
	if (c<9) {
		no="0"+(c+1);
	}
	seiten[3][c]=pre+no+out;
}


//####################################################################//126 BIS - Kupplung//####################################################################seiten[4] = new Array();
var pre="../div/bis-18-";
var out=".gif";
var no="";
for (var c=0;c<3;c++) {
	no=c+1;
	if (c<9) {
		no="0"+(c+1);
	}
	seiten[4][c]=pre+no+out;
}


//####################################################################//126 BIS - Getriebe//####################################################################seiten[5] = new Array();
var pre="../div/bis-21-";
var out=".gif";
var no="";
for (var c=0;c<38;c++) {
	no=c+1;
	if (c<9) {
		no="0"+(c+1);
	}
	seiten[5][c]=pre+no+out;
}


//####################################################################//126 BIS - Bremsen//####################################################################seiten[6] = new Array();
var pre="../div/bis-33-";
var out=".gif";
var no="";
for (var c=0;c<18;c++) {
	no=c+1;
	if (c<9) {
		no="0"+(c+1);
	}
	seiten[6][c]=pre+no+out;
}


//####################################################################//126 BIS - Lenkung//####################################################################seiten[7] = new Array();
var pre="../div/bis-41-";
var out=".gif";
var no="";
for (var c=0;c<12;c++) {
	no=c+1;
	if (c<9) {
		no="0"+(c+1);
	}
	seiten[7][c]=pre+no+out;
}


//####################################################################//126 BIS - Aufhängungen und Räder//####################################################################seiten[8] = new Array();
var pre="../div/bis-44-";
var out=".gif";
var no="";
for (var c=0;c<30;c++) {
	no=c+1;
	if (c<9) {
		no="0"+(c+1);
	}
	seiten[8][c]=pre+no+out;
}


//####################################################################//126 BIS - Hilfsvorrichtungen//####################################################################seiten[9] = new Array();
var pre="../div/bis-50-";
var out=".gif";
var no="";
for (var c=0;c<7;c++) {
	no=c+1;
	if (c<9) {
		no="0"+(c+1);
	}
	seiten[9][c]=pre+no+out;
}

//####################################################################
//126 BIS - Elektrik
//####################################################################
seiten[10] = new Array();
var pre="../div/bis-55-";
var out=".gif";
var no="";
for (var c=0;c<28;c++) {
	no=c+1;
	if (c<9) {
		no="0"+(c+1);
	}
	seiten[10][c]=pre+no+out;
}

//####################################################################
//126 BIS - Karosse
//####################################################################
seiten[11] = new Array();
var pre="../div/bis-70-";
var out=".gif";
var no="";
for (var c=0;c<34;c++) {
	no=c+1;
	if (c<9) {
		no="0"+(c+1);
	}
	seiten[11][c]=pre+no+out;
}



var cimg=0;
var imgw=0;
var imgh=0;
var li=0;

//####################################################################
//Zu einer Bestimmten Seite wechseln
//####################################################################
function changeto(i) {
	cimg=i;
	if (cimg<0) cimg=0;
	if (cimg>(seiten[bind].length-1)) cimg=seiten[bind].length-1;
	document.images.book.alt="Image loading...";
	document.images.book.src="";
	document.images.book.src=seiten[bind][cimg];
	var c= new Image();
	c.src=seiten[bind][cimg];
	imgh=c.height;
	imgw=c.width;
	delete c;
	document.all["ct"+li].style.backgroundColor="#65DAFF";
	document.all["ct"+cimg].style.backgroundColor="#ffffff";
	li=cimg;
	rescale(scale.value);
}


//####################################################################
//Um x Seiten vor oder Zurück
//####################################################################
function changerel(i) {
	li=cimg;
	cimg+=i;
	if (cimg<0) cimg=0;
	if (cimg>(seiten[bind].length-1)) cimg=seiten[bind].length-1;
	document.images.book.alt="Image loading...";
	document.images.book.src="";
	document.images.book.src=seiten[bind][cimg];
	var c= new Image();
	c.src=seiten[bind][cimg];
	imgh=c.height;
	imgw=c.width;
	delete c;
	document.all["ct"+li].style.backgroundColor="#65DAFF";
	document.all["ct"+cimg].style.backgroundColor="#ffffff";
	li=cimg;
	rescale(scale.value);
}

//####################################################################
//Die Navigationen in das document schreiben
//####################################################################
function buchnavi() {
	document.write("<select name=\"scale\" size=\"1\" onchange=\"if (scale.value>0) rescale(scale.value);\">");
	document.write("<option value=0>-- Select zoom -- </option>");
	for (var i=10;i<=200;i+=10) {
			document.write("<option value="+i+">"+i+"%</option>");
	}
	document.write("</select>");
	document.write("<br>");
	document.write("<a href=\"javascript:changerel(-10);\"><<</a> ");
	document.write("<a href=\"javascript:changerel(-1);\"><</a> Seiten ");
	document.write("<a href=\"javascript:changerel(1);\">></a> ");
	document.write("<a href=\"javascript:changerel(10);\">>></a><br>");
	for (var i=0; i<=seiten[bind].length-1; i++) {
			document.write("<span id=\"ct"+i+"\"><a href=\"javascript:changeto("+i+");\">"+(i+1)+"</a></span> ");
	}
}

//####################################################################
//Skalierung des Bildes ändern
//####################################################################
function rescale(a) {
	if (a>0) {
		document.images.book.width=imgw*(a/100);
		document.images.book.height=imgh*(a/100);
	}
}


//####################################################################
//Auswahldaten
//####################################################################
var bisdoku = new Array();

bisdoku[0]="Data and sketches Fiat 126 BIS";
bisdoku[1]="Weber DGF 30 100/3";
bisdoku[2]="Workshop manual Fiat 126";
bisdoku[3]="Workshop manual Fiat 126 BIS - General information / technical data";
bisdoku[4]="Workshop manual Fiat 126 BIS - Engine";
bisdoku[5]="Workshop manual Fiat 126 BIS - Clutch";
bisdoku[6]="Workshop manual Fiat 126 BIS - Gear";
bisdoku[7]="Workshop manual Fiat 126 BIS - Brakes";
bisdoku[8]="Workshop manual Fiat 126 BIS - Steering";
bisdoku[9]="Workshop manual Fiat 126 BIS - Suspension and wheels";
bisdoku[10]="Workshop manual Fiat 126 BIS - Auxilliary parts";
bisdoku[11]="Workshop manual Fiat 126 BIS - Electrics";
bisdoku[12]="Workshop manual Fiat 126 BIS - Bodywork";

var bisdokul = new Array();

bisdokul[0]="126bis.html";
bisdokul[1]="dgf30.html";
bisdokul[2]="126repbuch.html";
bisdokul[3]="126bisbuch1.html";
bisdokul[4]="126bisbuch2.html";
bisdokul[5]="126bisbuch3.html";
bisdokul[6]="126bisbuch4.html";
bisdokul[7]="126bisbuch5.html";
bisdokul[8]="126bisbuch6.html";
bisdokul[9]="126bisbuch7.html";
bisdokul[10]="126bisbuch8.html";
bisdokul[11]="126bisbuch9.html";
bisdokul[12]="126bisbuch10.html";

//####################################################################
//Auswahlliste in das document schreiben
//####################################################################
function doksel() {
	document.write("<select name=\"docselect\" size=\"1\" onchange=\"if (docselect.selectedIndex>0) window.location.href=docselect.value;\">");
	document.write("<option value=\"NIL\">--- Select documentation ---</option>");
	for (var i=0;i<=bisdoku.length-1;i++) {
		document.write("<option value="+bisdokul[i]+">"+bisdoku[i]+"</option>");
	}
	document.write("</select>");
}
