var curpage = 1;
var imgs = [
			['00_1_Nacken.png','Es gibt eine Möglichkeit Ihren schmerzhaften Nacken ohne die üblichen Spritzen und Tabletten zu behandeln!','','',127],
			['00_2_Nacken.png','Es gibt es eine sichere und risikofreie Methode als Alternative zum Einrenken!','','',135],
			['01_Dr.png','Bedeutende chiropraktorische & manualmedizinische Lehrer haben dem Spineliner den Weg bereitet.','','',127],
			['02_Dr.png','Die größten Erfahrungseffekte werden im Zuge von Hospitationen erreicht.','','',135],
			['03_Bekleidet.png','Die Behandlung mit dem Spineliner kann auf Wunsch auch bekleidet erfolgen.','','',135],
			['04_Kinder.png','Der Spineliner wird auch bei Kleinkindern angewendet.','','',135],
			['05_Strecken.png','Der Spineliner bietet eine schmerzfreie und nicht invasive Technologie.','','',135],
			['06_Dehnen.png','Der Spineliner bietet eine sehr sichere Behandlungsmethode des Bewegungsapparates.','','',127],
			['07_Entspannung.png','Sie können mit dem Spineliner in Echtzeit die Entspannung des Muskels verfolgen.','','',135],
			['08_Akupunktur.png','Der Spineliner wird auch für die Anwendung der Akupunktur erfolgreich eingesetzt.','','',135]
		];
var imgcount = imgs.length;
var totalpage = Math.ceil(imgcount/2);

$(document).ready(function() {
	calctime();
	if (typeof(homepg) != "undefined") changePhotos();
});

function calctime() {
	var currenttime = new Date();
	var hours = currenttime.getHours();
	var minutes = currenttime.getMinutes();
	var seconds = currenttime.getSeconds();
	if (hours == 0) { hours = 12; }
	if (hours < 10) { hours = "0" + hours; }
	if (minutes < 10) { minutes = "0" + minutes; }
	if (seconds < 10) { seconds = "0" + seconds; }
	var clocklocation = document.getElementById('datediv');
	clocklocation.innerHTML = hours + ":" + minutes + ":" + seconds + " ";
	
	var currentdate = new Date();
	var months = currentdate.getMonth() + 1;
	var days = currentdate.getDate();
	var years = currentdate.getFullYear();
	if (days < 10) { days = "0" + days; }
	if (months < 10) { months = "0" + months; }
	
	clocklocation.innerHTML = days + '.' + months + '.' + years + ' | ' + hours + ":" + minutes + ":" + seconds;
	setTimeout("calctime()", 1000);
}

function changePhotos() {
	$("#photodiv").fadeOut("fast", function() {
		img1 = ((curpage-1)*2); img2 = img1+1;
		link1 = ''; link2 = ''; linkx1 = ''; linkx2 = '';
		if (imgs[img1][2]!='') { link1='<a href="'+imgs[img1][2]+'" target="'+imgs[img1][3]+'">'; linkx1='</a>'; }
		if (imgs[img2][2]!='') { link2='<a href="'+imgs[img2][2]+'" target="'+imgs[img2][3]+'">'; linkx2='</a>'; }
		h1 = 178-imgs[img1][4];
		h2 = 178-imgs[img2][4];
		
		$("#photodiv").html('<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td>'+link1+'<div style=" width: 240px; height: '+h1+'px; position: absolute; margin: '+imgs[img1][4]+'px 0 0 0; text-align: left; font-size: 12px; padding: 5px 0;">'+imgs[img1][1]+'</div><img src="../images/wss/'+imgs[img1][0]+'" border="0" />'+linkx1+'</td><td width="29">&nbsp;</td><td>'+link2+'<div style=" width: 240px; height: '+h2+'px; position: absolute; margin: '+imgs[img2][4]+'px 0 0 0; text-align: left; font-size: 12px; padding: 5px 0;">'+imgs[img2][1]+'</div><img src="../images/wss/'+imgs[img2][0]+'" border="0" />'+linkx2+'</td></tr></table>');
		$("#photodiv").fadeIn("slow", function() {
			curpage=curpage+1;
			if (curpage>totalpage) curpage=1;
			setTimeout("changePhotos()", 9000);
		});
	});
}

