// <![CDATA[

function openBigImage(image) {
	var content;
	content="<html><head><title>Gro&szlig;ansicht - zum Schlie&szlig; ins Bild klicken...</title></head><body>";
	content+="<a href='javascript:window.close();'><img src='img/gasthaus/"+image+"' style='border: none;'></a>";
	content+="</body></html>";
	imageWindow=window.open('','','scrollbars=0,resizable=yes,width=470,height=500');
	imageWindow.document.write(content);
}

function openBigImage2(path,image) {
	var content;
	content="<html><head><title>Gro&szlig;ansicht - zum Schlie&szlig; ins Bild klicken...</title></head><body>";
	content+="<a href='javascript:window.close();'><img src='img/"+path+image+"' style='border: none;'></a>";
	content+="</body></html>";
	imageWindow=window.open('','','scrollbars=0,resizable=yes,width=470,height=500');
	imageWindow.document.write(content);
}

function loadImage(divBox,image) {
	var content;
	content="<a href=\"javascript:openBigImage('"+image+"__big.jpg')\"><img src=\"img/gasthaus/"+image+".jpg\" /></a>";
	write(divBox,content);
}

function reloadNav(divBox,aktiv,start,stop,buttonProp,gid) {
	var content="";
	for( k = start; k <= stop; k++ ) {
		
		if ( k < 10 ) k_f = "0"+k;
		else k_f = k;
		
		if( k == aktiv ) content += "<a href=\"javascript:loadImage('first','"+ gid +"_"+ k_f +"');reloadNav('"+ divBox +"',"+ k +","+ start +","+ stop +",'"+ buttonProp +"',"+ gid +");\"><img src=\"img/layout/gasthaus_foto_aktiv.jpg\" "+ buttonProp +" onmouseover=\"window.status='aktuelles Foto';return true;\" onmouseout=\"window.status='';return true;\" /></a>";
		else content += "<a href=\"javascript:loadImage('first','"+ gid +"_"+ k_f +"');reloadNav('"+ divBox +"',"+ k +","+ start +","+ stop +",'"+ buttonProp +"',"+ gid +");\"><img src=\"img/layout/gasthaus_foto_inaktiv.jpg\" "+ buttonProp +" onmouseover=\"window.status='weiteres Foto';return true;\" onmouseout=\"window.status='';return true;\" /></a>";

		//ohne mouseover/mouseout statustext
		//if( k == aktiv ) content += "<a href=\"javascript:loadImage('first','"+ gid +"_"+ k_f +"');reloadNav('more',"+ k +","+ start +","+ stop +",'"+ buttonProp +"',"+ gid +");\"><img src=\"img/layout/gasthaus_foto_aktiv.jpg\" "+ buttonProp +" /></a>";
		//else content += "<a href=\"javascript:loadImage('first','"+ gid +"_"+ k_f +"');reloadNav('more',"+ k +","+ start +","+ stop +",'"+ buttonProp +"',"+ gid +");\"><img src=\"img/layout/gasthaus_foto_inaktiv.jpg\" "+ buttonProp +" /></a>";
		
	}
	write(divBox,content);
}

function write(divBox, content) {

    if ( document.all ) {
        eval( divBox + '.innerHTML = content' );
    }
    
    if ( document.layers ) {
        eval( 'document.' + divBox + '.document.open();' );
        eval( 'document.' + divBox + '.document.write( content );' );
        eval( 'document.' + divBox + '.document.close();' );
    }
    
    if ( document.getElementById ) {
        document.getElementById( divBox ).innerHTML = content;
    }

}
function rewrite(divBox, content) {
	write(divBox, content);
}

function reloadImgNav(pos, max_pos, step) {
	var new_pos = (parseInt(pos) + step) < 1 ? max_pos : parseInt(pos) + step;
	return new_pos > max_pos ? 1 : new_pos;
}

function dezInt(num,size,prefix) {
	prefix=(prefix)?prefix:"0";
	var minus=(num<0)?"-":"", result=(prefix=="0")?minus:""; 
	num=Math.abs(parseInt(num,10)); 
	size-=(""+num).length; for	(var i=1;i<=size;i++) { result+=""+prefix; } 
	result+=((prefix!="0")?minus:"")+num; 
	return result;
}


// ]]>

