<!--//
function getElemofArray(oArray,oElement) {
	if (oArray[oElement]) {
		return oArray[oElement];
	}
	return '';
}

function setElement(LName,ifStyle,funct,wert){
	if (document.getElementById){
		if (ifStyle == 1){
			var newLayer = document.getElementById(LName).style;
		}
		else {
			var newLayer = document.getElementById(LName);
		}
		newLayer[funct]=wert;
	}
}

function getShadow() {
	setElement('shadow',1,'width','100%');
	if (document.getElementById("prospect").scrollHeight <= document.body.scrollHeight){
		setElement('shadow',1,'height',document.body.scrollHeight+"px");
	}
	else {
		setElement('shadow',1,'height',document.getElementById("prospect").scrollHeight+"px");
	}
	setElement('shadow',1,'left','0');
	setElement('shadow',1,'top','0');
	setElement('shadow',1,'display','block');
}

function getAngebot(){
	//setElement('prospect',1,'left',document.body.offsetWidth/2-385+"px");
	setElement('prospect',1,'display','block');
	getShadow();
	
}

function deleteAngebot(){
	setElement('prospect',1,'display','none');
	setElement('shadow',1,'display','none');
}


sA="";

function sizeAngebot(iID){
	if (sA=="" && document.getElementById(iID).innerHTML!=""){
		if (document.getElementById(iID).style.width != "750px"){
			setElement(iID,1,'zIndex','50');
			animAngebot(iID,375);
			sA="active";
		}
		else {
			setElement(iID,1,'zIndex','10');
			animAngebot(iID,750);
			sA="active";
		}
	}
}

anim="positiv";

function animAngebot(iID,ax){
	iIDold=iID;
	axold1=ax+25;
	
	axold2=ax-25;
	if (axold1<=750 && anim=="positiv"){
		setElement(iID,1,'width',axold1+'px');
		setElement('prospect',1,'height','1175px');
		if (axold1==750){
			anim="negativ";
			sA="";
			
			return false;
		}
		else {
			anim="positiv";
			setElement('hide_navi',1,'display','block');
		}
		
		setTimeout("animAngebot(iIDold,axold1)",20);
	}
	else if (axold2>=375 && anim=="negativ"){
		setElement(iID,1,'width',axold2+'px');
		setElement('prospect',1,'height','635px');
		anim="negativ";
		if (axold2==375){
			anim="positiv";
			setElement(iID,1,'zIndex','5');
			sA="";
			setElement('hide_navi',1,'display','none');
			return false;
		}
		else {
			anim="negativ";
		}
		setTimeout("animAngebot(iIDold,axold2)",20);
	}
	else {
		sA="";
	}
	
}

srcz1 = -1;
srcz2 = 0;

function getImages(src1a,src2a){
	if (src1a<0){
		srcz1 = "-1";
		src1a = "";
	}
	else {
		srcz1 = src1a;
	}
	
	if (src2a>=angebote.length){
		srcz2 = src2a;
		src2a = "";
	}
	else {
		srcz2 = src2a;
	}
	
	setClassAct(srcz1);
	
	src1 = angebote[src1a];
	src2 = angebote[src2a];
	
	if(src1a != '') {
		setElement("pro_seite_links",0,'innerHTML','<img src="'+src1+'" width="100%" />');
		setElement("zurueckb",1,'display','block');
	}
	else {
		setElement("pro_seite_links",0,'innerHTML','');
		setElement("zurueckb",1,'display','none');
	}
	if(src2a != '' || src2a == "0") {
		setElement("pro_seite_rechts",0,'innerHTML','<img src="'+src2+'" width="100%" />');
		setElement("vorb",1,'display','block');
	}
	else {
		setElement("pro_seite_rechts",0,'innerHTML','');
		setElement("vorb",1,'display','none');
	}
}

function getobject(id) {
	var elmID;
                
	if(document.getElementById) {elmID = document.getElementById(id);}
    else if(document.all) {elmID = document.all[id];}
    else if(document.layers) {elmID = this._getLayer(id);}
    else if(document.forms) {
        if(document.forms[id]) {elmID = document.forms[id];}
        else {
            for(var i=0; i<document.forms.length; i++) {
                if(document.forms[i][id]) {
                    elmID = document.forms[i][id];
                    break;
                }
            }
        }
    }
    else {elmID = null;}

    return elmID;
}

function setClassAct(x) {
	xa=(((x*1)+1)*1)/2;
	var navi = document.getElementById('Seitenauswahl');
	var links = navi.getElementsByTagName('a');

	for (var i=0; i<links.length; i++){
		links[i].className = 'none';
	}
	
	links[xa].className = 'act';
}

function setClassNorm() {
	var navi = document.getElementById('Seitenauswahl');
	var links = navi.getElementsByTagName('a');

	for (var ii=0; ii<links.length; ii++){
		links[ii].className = 'none';
	}
}

function showProspect(x) {
	if (x == 'an') {
		//getobject('prospect').style.width = '100%';
		//getobject('prospect').style.height = '1150px';
		//getobject('prospect').style.backgroundImage = 'url(image/shadow.png)';
		getobject('prospect').innerHTML = '<img src="image/dummy_big.jpg" />';
	}
	
	if (x == 'aus') {
		getobject('prospect').style.width = '0px';
		getobject('prospect').style.height = '0px';
		getobject('prospect').style.backgroundImage = 'none';
		getobject('prospect').innerHTML = '';
	}
	
}

function getMktLink(strurl) {
	if (strurl.href.indexOf("id=97")>=0 || strurl.href.indexOf("id=6")>=0) {
		mycookie = getmktcookie('VM');
		mktid_ch_array = mycookie.split("-");
						
		mktid = mktid_ch_array[0]
		chash = mktid_ch_array[1];

		strurl.href="index.php?id=97&tx_nxtoomangebote_pi3[markt]="+mktid+"&cHash="+chash;
	}
	if (strurl.href.indexOf("id=98")>=0) {
		mycookie = getmktcookie('GM');
		mktid_ch_array = mycookie.split("-");
						
		mktid = mktid_ch_array[0]
		chash = mktid_ch_array[1];

		strurl.href="index.php?id=98&tx_nxtoomangebote_pi4[markt]="+mktid+"&cHash="+chash;
	}
}

  function getmktcookie(mid) {
    var lf = "\n";
    var CookieString = document.cookie;
    var CookieSet = CookieString.split (';');
    var SetSize = CookieSet.length;
    var CookiePieces
    var ReturnValue = "";
    var x = 0;
    for (x = 0; ((x < SetSize) && (ReturnValue == "")); x++) {
      CookiePieces = CookieSet[x].split ('=');
      if (CookiePieces[0].substring (0,1) == ' ') {
        CookiePieces[0] = CookiePieces[0].substring (1, CookiePieces[0].length);
      }
      if (CookiePieces[0] == 'marktid'+mid) {
        ReturnValue = CookiePieces[1];
      }
     }
     return ReturnValue;
  }

/*WMF Aktion */

wmfID_old="";

arzbergID_old="";

function bigGR(arzbergID,arzbergGR,arzbergTEXT){
	if (document.getElementById){
		if (arzbergID_old!=""){
			document.getElementById(arzbergID_old).style.display='none';
		}
		document.getElementById(arzbergID).innerHTML='<img src="image/aktionen/Fila/'+arzbergGR+'_gr.jpg" width="656" height="657" alt="" border="0"><br /><div class="arzberg_text_b">'+arzbergTEXT+'</div><div class="hgansicht"><img src="image/aktionen/Fila/b_grossansicht.png" width="131" height="14" alt="" border="0" /></div><div class="ga_schliessen"><a href="#" onclick="SetLayer2(\''+arzbergID+'\',\'display\',\'none\');return false;"><img src="image/aktionen/Fila/b_schliessen.png" width="85" height="15" alt="" border="0" /></a></div>';
		document.getElementById(arzbergID).style.display='block';
		arzbergID_old=arzbergID;
	}
}

function SetLayer2(LName,funct,wert){
	if (document.getElementById){
		var newLayer = document.getElementById(LName).style;
		newLayer[funct]=wert;
	}
}

//check for flash
var flashversionMin = 8;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;

if (plugin) {
	for (f = 0; f < 20; f++) {
		var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
		if (plugin.description.indexOf(f+".")>=0){
			flashversion = f;
			
			if (flashversion >= flashversionMin){
				plugin = true;
				break;
			}
		}
	}
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0)) {
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+flashversionMin+'")))\n');
	document.write('</SCRIPT\> \n');
}

function playSWF(file,id,vars,width,height,wmode,bgcolor,baseurl,wLName) {
	fsource='<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
	fsource+=' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" ';
	fsource+=' ID='+id+' WIDTH="'+width+'"; HEIGHT="'+height+'">';
	fsource+=' <PARAM NAME="allowScriptAccess" VALUE="sameDomain" /> <PARAM NAME=movie VALUE="'+file+'"> <PARAM NAME=FlashVars VALUE="'+vars+'"> <PARAM NAME=menu VALUE=false>  <PARAM NAME="BASE" VALUE='+baseurl+'> <PARAM NAME=quality VALUE=high> <PARAM NAME=wmode value='+wmode+'> <PARAM NAME=bgcolor VALUE='+bgcolor+'>';
		if(navigator.userAgent.indexOf("Opera")==-1) {
			fsource+=' <EMBED src="'+file+'" FlashVars="'+vars+'" wmode='+wmode+' menu=false quality=high bgcolor='+bgcolor+'';
			fsource+=' swLiveConnect=FALSE allowScriptAccess="sameDomain" NAME='+id+' WIDTH="'+width+'" HEIGHT="'+height+'"';
			fsource+=' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" BASE='+baseurl+'>';
			fsource+=' </EMBED>';
		}
		else	{
			fsource+=' <EMBED src="'+file+'" FlashVars="'+vars+'" wmode='+wmode+' menu=false quality=high bgcolor='+bgcolor+'';
			fsource+=' swLiveConnect=FALSE allowScriptAccess="sameDomain" ID='+id+' WIDTH="'+width+'" HEIGHT="'+height+'"';
			fsource+=' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" BASE='+baseurl+'>';
			fsource+=' </EMBED>';
		}
	fsource+=' </OBJECT>';

	if (document.getElementById){
		document.getElementById(wLName).innerHTML=fsource;
	}

}

function triggerLayer() {
	var divID = document.getElementById('flashContentTeaser');
	if (divID !=null) divID.style.display = (divID.style.display=='none') ? "block" :"none";
}
//-->