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;
}
