// WBSuperAdCarousel.action v3.0 - July, 2008
// Copyright © 1999 by Walter Blady
// All rights reserved
var SACW3C = document.getElementById ? true : false;
var SACisNav4 = navigator.appName.indexOf("Netscape") >= 0 && parseInt(navigator.appVersion.charAt(0)) == 4;
var SACisIE4 = navigator.appVersion.indexOf("MSIE 4") >= 0;
function WBSuperAdCarousel(action) {
if (SACVersion() && action[3] != "" || action[4] != 0) {
try {
SACSize1();
}
catch (errorCode) {
var mess = "SuperAdCarousel can not find the SACAd.js file.\n";
mess += "You must link the SACAd.js file, inside your site folder, to this page."
alert(mess);
return;
}
if (action[3] != "") {
var adObject = SACGetObject(action[3]);
adObject.type = "box";
}
else if (action[4] != "") {
if (window.navigator.userAgent.indexOf("MSIE") > 0 || SACW3C) {
var adObject = document.images[action[4]];
}
else {
var adObject = parseInt(navigator.appVersion.charAt(0)) > 3 ? AGRFindImageObject(action[4],0) : document.images[action[4]];
}
adObject.type = "image";
}
adObject.adGroup = action[2]+1;
adObject.loop = action[5];
adObject.action = action;
adObject.display = SACDisplay;
adObject.getad = SACGetAd;
adObject.onmousedown = SACAdLinks;
adObject.total = action[1] == 0 ? 3600 : 1440;
for (var count = 1; eval("SACAd" + adObject.adGroup + "_" + count + "()").toLowerCase() != "end" && count <= adObject.total; count++) { }
adObject.count = count - 1;
adObject.getad();
if (adObject.ad != "") adObject.display();
}
return;
}
function SACGetAd() {
var thisDate = new Date();
var thisHour = thisDate.getHours();
var thisMin = thisDate.getMinutes();
var thisSec = thisDate.getSeconds();
if (this.action[1] == 0) {
thisSec = (thisSec * thisMin) % this.count + 1;
this.ad = eval("SACAd" + this.adGroup + "_" + thisSec + "()");
}
else {
thisMin = (thisMin * thisHour) % this.count + 1;
this.ad = eval("SACAd" + this.adGroup + "_" + thisMin + "()");
}
this.isswf = this.ad.indexOf("swf") > -1 ? true : false;
if (this.isswf && (SACisNav4 || SACisIE4)) {
for (var i = 1; i < this.count && this.isswf; i++) {
thisSec += 1;
if (thisSec > this.count) thisSec = 1;
this.ad = eval("SACAd" + this.adGroup + "_" + thisSec + "()");
this.isswf = this.ad.indexOf("swf") > -1 ? true : false;
if (this.isswf) this.ad = ""
}
}
return;
}
function SACDisplay() {
var size = eval("SACSize" + this.adGroup + "()");
this.url = SACAdURL;
if (this.ad != "") {
this.height = SACHeight == 0 ? SACdefaultHeight : SACHeight;
this.width = SACWidth == 0 ? SACdefaultWidth : SACWidth;
if (this.type == "box") {
if (!this.isswf) {
var html = "
";
this.isswf = false;
}
else if (this.isswf) {
var html = '';
this.isswf = true;
}
if (document.getElementById) {
this.innerHTML = html;
}
else if (document.all) {
if (this.isswf) {
this.exposure = 0;
}
else {
this.innerHTML = "";
this.innerHTML = html;
}
}
else if (document.layers) {
if (this.isswf) {
this.exposure = 0;
}
else {
this.clip.width = this.width;
this.clip.height = this.height;
this.background.src = this.ad;
}
}
}
else if (this.type == "image") {
this.src = this.ad;
}
}
return;
}
function SACGetObject(objName) {
var params;
if (document.getElementById) {
params = eval("document.getElementById('" + objName + "')");
}
else if (document.all) {
params = eval("document.all." + objName);
}
else if (document.layers) {
params = SACFindLayerObject(objName, 0);
}
return params;
}
function SACFindLayerObject(layer, thisLayer) {
if (thisLayer) {
var thisDocument = thisLayer.document;
}
else {
var thisDocument = document;
}
var layerObj = thisDocument[layer];
if (layerObj) {
return layerObj;
}
else {
for (var i = 0; i < thisDocument.layers.length; i++) {
layerObj = SACFindLayerObject(layer, thisDocument.layers[i]);
if (layerObj) {
break;
}
}
}
return layerObj;
}
function SACFindImageObject(baseImage, thisLayer) {
if (thisLayer) {
var thisDocument = thisLayer.document;
}
else {
var thisDocument = document;
}
var imageObj = thisDocument[baseImage];
if (imageObj) {
return imageObj;
}
else {
for (var i = 0; i < thisDocument.layers.length; i++) {
imageObj = SACFindImageObject(baseImage, thisDocument.layers[i]);
if (imageObj) {
break;
}
}
}
return imageObj;
}
function SACAdLinks() {
if (this.url != "") {
var params;
if (this.action[6] == "") {
window.location.href = this.url;
}
else {
if (this.action[6].toLowerCase().indexOf("blank") != -1) {
var params = "";
var top = "";
var left = "";
if (this.action[18] == 1) {
top = this.action[9] <= screen.availHeight ? this.action[19] : 0;
left = this.action[8] <= screen.availWidth ? this.action[20] : 0;
}
else if (this.action[18] == 2) {
top = Math.round(screen.availHeight-this.action[9])/2;
left = Math.round(screen.availWidth-this.action[8])/2;
}
var newWidth = "";
var newHeight = "";
if (this.action[7] == 1) {
newWidth = (this.action[8] <= screen.availWidth) ? this.action[8] : screen.availWidth;
newHeight = (this.action[9] <= screen.availHeight) ? this.action[9] : screen.availHeight;
}
else if (this.action[7] == 2) {
newWidth = (this.action[8]*screen.availWidth/100 <= screen.availWidth) ? Math.round(this.action[8]*screen.availWidth/100) : screen.availWidth;
newHeight = (this.action[9]*screen.availWidth/100 <= screen.availHeight) ? Math.round(this.action[9]*screen.availWidth/100) : screen.availHeight;
}
else if (this.action[7] == 3) {
newWidth = screen.availWidth;
newHeight = screen.availHeight;
}
params += "width=" + newWidth;
params += ",height=" + newHeight;
params += ",toolbar=" + (this.action[10] ? "1" : "0");
params += ",location=" + (this.action[11] ? "1" : "0");
params += ",directories=" + (this.action[12] ? "1" : "0");
params += ",status=" + (this.action[13] ? "1" : "0");
params += ",menubar=" + (this.action[14] ? "1" : "0");
params += ",favorites=" + (this.action[15] ? "1" : "0");
params += ",scrollbars=" + (this.action[16] ? "1" : "0");
params += ",resizable=" + (this.action[17] ? "1" : "0");
params += (SACW3C) ? ",top=" + top + ",left=" + left : ",screenY=" + top + ",screenX=" + left;
var SACLNewWindow = window.open(this.url,"AGRNewWindow", params);
return;
}
else {
params = eval(this.action[6] + ".window.location");
params.href = this.url;
}
}
}
return;
}
function SACVersion() {
return true;
}
//