FlashObject = function(swf, id, w, h, ver, c, wm) {
   this.swf = swf;
   this.id = id;
   this.width = w;
   this.height = h;
   this.version = ver || 8; // default to 6
   this.align = "middle"; // default to middle
   this.redirect = "";
   this.sq = document.location.search.split("?")[1] || "";
   this.altTxt = "Please <a href='http://www.macromedia.com/go/getflashplayer'>upgrade your Flash Player</a>.";
   this.bypassTxt = "<p>Already have Flash Player? <a href='?detectflash=false&"+ this.sq +"'>Click here if you have Flash Player installed</a>.</p>";
   this.params = new Object();
   this.variables = new Object();
   if (c) this.color = this.addParam('bgcolor', c);
   if (wm) this.addParam('wmode', wm);
   this.addParam('quality', 'high'); // default to high
   this.doDetect = getQueryParamValue('detectflash');
}

FlashObject.prototype.addParam = function(name, value) {
   this.params[name] = value;
}

FlashObject.prototype.getParams = function() {
    return this.params;
}

FlashObject.prototype.getParam = function(name) {
    return this.params[name];
}

FlashObject.prototype.addVariable = function(name, value) {
   this.variables[name] = value;
}

FlashObject.prototype.getVariable = function(name) {
    return this.variables[name];
}

FlashObject.prototype.getVariables = function() {
    return this.variables;
}

FlashObject.prototype.getParamTags = function() {
    var paramTags = "";
    for (var param in this.getParams()) {
        paramTags += '<param name="' + param + '" value="' + this.getParam(param) + '" />';
    }
    if (paramTags == "") {
        paramTags = null;
    }
    return paramTags;
}

FlashObject.prototype.getHTML = function() {
    var flashHTML = "";
    if (window.ActiveXObject && navigator.userAgent.indexOf('Mac') == -1) { // PC IE
        flashHTML += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + this.width + '" height="' + this.height + '" id="' + this.id + '" align="' + this.align + '">';
        flashHTML += '<param name="movie" value="' + this.swf + '" />';
        if (this.getParamTags() != null) {
            flashHTML += this.getParamTags();
        }
        if (this.getVariablePairs() != null) {
            flashHTML += '<param name="flashVars" value="' + this.getVariablePairs() + '" />';
        }
        flashHTML += '</object>';
    }
    else { // Everyone else
        flashHTML += '<embed type="application/x-shockwave-flash" src="' + this.swf + '" width="' + this.width + '" height="' + this.height + '" id="' + this.id + '" align="' + this.align + '"';
        for (var param in this.getParams()) {
            flashHTML += ' ' + param + '="' + this.getParam(param) + '"';
        }
        if (this.getVariablePairs() != null) {
            flashHTML += ' flashVars="' + this.getVariablePairs() + '"';
        }
        flashHTML += '></embed>';
    }
    return flashHTML;   
}


FlashObject.prototype.getVariablePairs = function() {
    var variablePairs = new Array();
    for (var name in this.getVariables()) {
        variablePairs.push(name + "=" + escape(this.getVariable(name)));
    }
    if (variablePairs.length > 0) {
        return variablePairs.join("&");
    }
    else {
        return null;
    }
}

FlashObject.prototype.write = function(elementId) {
   if(detectFlash(this.version) || this.doDetect=='false') {
      if (elementId) {
         document.getElementById(elementId).innerHTML = this.getHTML();
      } else {
         document.write(this.getHTML());
      }
   } else {
      if (this.redirect != "") {
         document.location.replace(this.redirect);
      } else {
         if (elementId) {
            document.getElementById(elementId).innerHTML = this.altTxt +""+ this.bypassTxt;
         } else {
            document.write(this.altTxt +""+ this.bypassTxt);
         }
      }
   }       
}

function getFlashVersion() {
   var flashversion = 0;
   if (navigator.plugins && navigator.plugins.length) {
      var x = navigator.plugins["Shockwave Flash"];
      if(x){
         if (x.description) {
            var y = x.description;
               flashversion = y.charAt(y.indexOf('.')-1);
         }
      }
   } else {
      result = false;
       for(var i = 15; i >= 3 && result != true; i--){
            execScript('on error resume next: result = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+i+'"))','VBScript');
            flashversion = i;
         }
   }
   return flashversion;
}

function detectFlash(ver) {   
   if (getFlashVersion() >= ver) {
      return true;
   } else {
      return true;
   }
}

// get value of querystring param
function getQueryParamValue(param) {
   var q = document.location.search;
   var detectIndex = q.indexOf(param);
   var endIndex = (q.indexOf("&", detectIndex) != -1) ? q.indexOf("&", detectIndex) : q.length;
   if(q.length > 1 && detectIndex != -1) {
      return q.substring(q.indexOf("=", detectIndex)+1, endIndex);
   } else {
      return "";
   }
}

/* add Array.push if needed */
if(Array.prototype.push == null){
   Array.prototype.push = function(item){
      this[this.length] = item;
      return this.length;
   }
}



/***********************************
*   http://javascripts.vbarsan.com/
*   This notice may not be removed 
***********************************/

//-- Begin Scroller's Parameters and messages -->
//scroller's width
var swidth=1000;

//scroller's height
var sheight=20;

//scroller's speed 
var sspeed=5;
var restart=sspeed;
var rspeed=sspeed;

//scroller's pause 
var spause=1000;

//scroller's background
sbcolor="#FFFF00";

//messages: change to your own; use as many as you'd like; set up Hyperlinks to URLs as you normally do: <a target=... href="... URL ...">..message..</a>
var singletext=new Array();
singletext[0]='<nobr class=tan>Super Angebote! + + + Besuchen Sie unsere Häuser in Weiden und Schwandorf und Weiden! + + + </nobr>';
//singletext[...]='...';
//-- end Parameters and message -->

//-- begin: Scroller's Algorithm -->
var ii=0;
function goup(){if(sspeed!=rspeed*16){sspeed=sspeed*2;restart=sspeed;}}

function startscroll(){
if(document.getElementById){ns6div=document.getElementById('iens6div');ns6div.style.left=swidth;ns6div.innerHTML=singletext[0];sizeup=ns6div.offsetWidth;ns6scroll();}
else 
if(document.layers){ns4layer=document.ns4div.document.ns4div1;ns4layer.left=swidth;ns4layer.document.write(singletext[0]);ns4layer.document.close();sizeup=ns4layer.document.width;ns4scroll();}
else 
if(document.all){iediv=iens6div;iediv.style.pixelLeft=swidth;iediv.innerHTML=singletext[0];sizeup=iediv.offsetWidth;iescroll();}}
function iescroll(){if(iediv.style.pixelLeft>0&&iediv.style.pixelLeft<=sspeed){iediv.style.pixelLeft=0;setTimeout("iescroll()",spause);}else 
if(iediv.style.pixelLeft>=sizeup*-1){iediv.style.pixelLeft-=sspeed;setTimeout("iescroll()",100);}else{if(ii==singletext.length-1)ii=0;else ii++;iediv.style.pixelLeft=swidth;iediv.innerHTML=singletext[ii];sizeup=iediv.offsetWidth;iescroll();}}
function ns4scroll(){if(ns4layer.left>0&&ns4layer.left<=sspeed){ns4layer.left=0;setTimeout("ns4scroll()",spause);}else 
if(ns4layer.left>=sizeup*-1){ns4layer.left-=sspeed;setTimeout("ns4scroll()",100);}else{if(ii==singletext.length-1)ii=0;else ii++;ns4layer.left=swidth;ns4layer.document.write(singletext[ii]);ns4layer.document.close();sizeup=ns4layer.document.width;ns4scroll();}}
function ns6scroll(){if(parseInt(ns6div.style.left)>0&&parseInt(ns6div.style.left)<=sspeed){ns6div.style.left=0;setTimeout("ns6scroll()",spause);}else if(parseInt(ns6div.style.left)>=sizeup*-1){ns6div.style.left=parseInt(ns6div.style.left)-sspeed;setTimeout("ns6scroll()",100);}
else{if(ii==singletext.length-1)ii=0;else ii++;
ns6div.style.left=swidth;ns6div.innerHTML=singletext[ii];sizeup=ns6div.offsetWidth;ns6scroll();}}
//-- end Algorithm -->

// weitere funktionen

function owin() {
window.open('images/anfahrt-achern.png','fa','toolbar=no,status=no,location=no,menubar=no,directories=no,width=800,height=600,scrollbars=yes')}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}



