userAgent = navigator.userAgent.toLowerCase();
n4 = document.layers;
ie = (document.all && userAgent.indexOf("mac")<0);
w3c = document.documentElement;
dhtml = ((n4 || ie || w3c) &&  userAgent.indexOf("aol")<0);
function popupseiteempfehlen(url)
{
	myCMSFenster = window.open(url,'Empfehlung','width=347,height=550,status=no,resizable=no,menubar=no,toolbar=no,locationbar=no,scrollbars=no,dependent=no' );
}

function popupempfehlung(url)
{
	myCMSFenster = window.open(url,'Empfehlungsnotiz','top=0,left=0,width=347,height=400,status=no,resizable=no,menubar=no,toolbar=no,locationbar=no,scrollbars=no,dependent=no' );
}

function scrollit(xoffset,yoffset)
{
	scrollTo(xoffset,yoffset);
}

function markArea(left,top,width,height,xoffset,yoffset,win_width,win_height)
{
	if(xoffset || yoffset || win_width || win_height)
	{
		//alert('scrollBy:'+xoffset+'x'+yoffset);
		window.moveTo(0,0);
		window.resizeTo(win_width,win_height);
		scrollit(0,0);
	}

	if(n4)
	{
		document.layers['highlight'].left = left;
		document.layers['highlight'].top = top;
		document.layers['highlight'].width = width;
		document.layers['highlight'].height = height;
		document.layers['highlight'].visibility = 'show';
	}
	else if (ie)
	{
		document.all['highlight'].style.left = left;
		document.all['highlight'].style.top = top;
		document.all['highlight'].style.width = width;
		document.all['highlight'].style.height = height;
		document.all['highlight'].style.visibility = 'visible';
	}
	else if(w3c)
	{
		document.getElementById('highlight').style.left = left;
		document.getElementById('highlight').style.top = top;
		document.getElementById('highlight').style.width = width;
		document.getElementById('highlight').style.height = height;
		document.getElementById('highlight').style.visibility = 'visible';
	}
}
function showselect()
{
	userAgent = navigator.userAgent.toLowerCase();
	n4 = document.layers;
	ie = (document.all && userAgent.indexOf("mac")<0);
	w3c = document.documentElement;
	dhtml = ((n4 || ie || w3c) &&  userAgent.indexOf("aol")<0);
	//alert('ie:'+ie+' n4:'+n4+' w3c: '+w3c);
	if(ie)
	{
	    	op_width=document.body.clientWidth;
		op_height=document.body.clientHeight;
		op_yoffset=document.body.scrollTop;
		op_xoffset=document.body.scrollLeft;
	}
	else if(n4)
	{
		op_width=window.innerWidth;
		op_height=window.innerHeight;
		op_yoffset=window.pageYOffset;
		op_xoffset=window.pageXOffset;
	}

	if (document.selection.type!="None")
	{
		var sel = document.selection;
		var rng = sel.createRange();
		var itm = rng.htmlText;
		//alert((op_width)+"--"+(rng.boundingLeft-4)+","+(rng.boundingTop-4)+","+(rng.boundingWidth+7)+","+(rng.boundingHeight+7));
		markArea(rng.boundingLeft-4,rng.boundingTop-4,rng.boundingWidth+7,rng.boundingHeight+7);
		//rng.pasteHTML("<font color=\"#ff0000\"><b>"+itm+"</b></font>");
	}
}

function popup(url, width, height, name, addon)
{
	var x = (screen.availWidth - width) / 2;
	var y = (screen.availHeight - height) / 2;
	if(addon)
	{
		myCMSFenster = window.open(url,name,'width=' + width + ',height=' + height + ',left=' + x + ',top=' + y + addon + "'");
	}
	else
	{
		myCMSFenster = window.open(url,name,'width=' + width + ',height=' + height + ',left='+ x +',top='+ y + ',status=yes,resizable=yes,menubar=no,locationbar=no,scrollbars=yes,dependent=yes' );
	}
}

function popupmenu(url, width, height, name)
{
	myCMSFenster = window.open(url,name,'width=' + width + ',height=' + height + ',status=yes,resizable=yes,menubar=yes,toolbar=yes,locationbar=no,scrollbars=yes,dependent=yes' );
}

function conf()
{
	check = confirm("Wollen Sie das wirklich?");
	return check;
}

// Flash-Version prüfen
var isFlashAvailable = false;
var installedVersion = deconcept.SWFObjectUtil.getPlayerVersion();
if (installedVersion.major >= 8) {
        isFlashAvailable = true;
}

//MMSwap Image Zeug
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
