//Frame anpassen
document.getElementsByName(scrollframe["framename"])[0].width = scrollframe["framebreite"];
document.getElementsByName(scrollframe["framename"])[0].height = scrollframe["framehoehe"];

//Bilder in Frame schreiben - close() wichtig!
window.frames[scrollframe["framename"]].document.open();
window.frames[scrollframe["framename"]].document.write("<body bgcolor=\"#fcc000\" onmouseover=" + parent.clearInterval(parent.scrollframe['aktiv']) + " onmouseout=" + parent.intervallsetzen() + " style=\"margin:0px;\">");
window.frames[scrollframe["framename"]].document.write("<table cellspacing='0' cellpadding='0'><tr><td>");

for (x=0; x<scrollframe["quelle"].length ; x++ ) {
if(scrollframe["linked"]) {window.frames[scrollframe["framename"]].document.write("<a href=\"" + scrollframe["quelle"][x].alt + "\" rel=\"gb_imageset[imagebar]\" target=\"imagebar\">");}
window.frames[scrollframe["framename"]].document.write("<img src='" + scrollframe["quelle"][x].src + "' width='" + scrollframe["bildbreite"] + "' border='0' />");
if(scrollframe["linked"]) {window.frames[scrollframe["framename"]].document.write("</a>");}
if(!scrollframe["ausrichtung_horizontal"]) {window.frames[scrollframe["framename"]].document.write("<div style=\"height: 5px; width: 5px; font-size: 1px;\">&nbsp;</div>");}
}

window.frames[scrollframe["framename"]].document.write("</td></tr></table>");
window.frames[scrollframe["framename"]].document.close();

//----------<=>----------

function intervallsetzen() {
clearInterval(scrollframe["aktiv"]);
scrollframe["aktiv"] = setInterval("scrollen()",scrollframe["scrollintervall"]);
}
intervallsetzen();

//----------<=>----------

scrollframe["x_scrolled"] = 0;
scrollframe["y_scrolled"] = 0;

function scrollen() {
window.frames[scrollframe["framename"]].scrollTo(scrollframe["x_scrolled"],scrollframe["y_scrolled"]);

scrollframe["x_scrolled"] += scrollframe["scrollhorizontal"];
scrollframe["y_scrolled"] += scrollframe["scrollvertikal"];

//Abfrage, ob am Anfang/Ende des Frames
scrollframe["x_scroll_max"] = (scrollframe["bildbreite"] * scrollframe["quelle"].length) - scrollframe["framebreite"];
scrollframe["y_scroll_max"] = (scrollframe["bildhoehe"] * scrollframe["quelle"].length) - scrollframe["framehoehe"];

if(scrollframe["x_scrolled"] < 0 || scrollframe["y_scrolled"] < 0 || scrollframe["x_scrolled"] >= scrollframe["x_scroll_max"] || scrollframe["y_scrolled"] >= scrollframe["y_scroll_max"]) {

//scrollframe["scrollhorizontal"] *= -1; //Scrollrichtung umkehren
//scrollframe["scrollvertikal"] *= -1;
//scrollframe["scrollhorizontal"] *= -1; //Scrollrichtung umkehren
//scrollframe["scrollvertikal"] *= -1;
scrollframe["x_scrolled"] = 0;
scrollframe["y_scrolled"] = 0;

//clearInterval(scrollframe["aktiv"]); //Pause einleiten
setTimeout("intervallsetzen()",scrollframe["scrollpause"]);
}
}

