/**
 * Vers. 3.3 (22-09-2011)(c) by Bernd Kiessling 
 * All Rights Reserved.
 * Es ist nicht erlaubt, diese Scripts ohne schriftliche Zustimmung des Autorīs zu verwenden, zu kopieren oder weiterzugeben !!
**/
function ie(p_mwidth,p_mheight,p_mscale){
	if(!isIEM()){
		if(isIE()){	
			//png alpha
			var images=document.getElementsByTagName("img");
			var newimages=new Array();
			for(var i=0;i<images.length;i++){
				if(images[i].src.substring(images[i].src.length-4)==".png"){
					var img=new Image();
					img.id=images[i].id;
					img.src=rtPh()+"scripts/ie/tmp.png";
					img.style.position=images[i].style.position;
					img.style.left=images[i].style.left;
					img.style.top=images[i].style.top;
					img.style.width=images[i].style.width;
					img.style.height=images[i].style.height;
					img.style.display=images[i].style.display;
					img.style.border=images[i].style.border;
					img.className=images[i].className;
					img.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+images[i].src+"',sizingMethod='scale')";
					newimages.push(new Array(images[i],img));	
				}
			}
			for(i=0;i<newimages.length;i++){
				newimages[i][0].parentNode.replaceChild(newimages[i][1],newimages[i][0]);	
			}		
		}
	}
	
	if((document.getElementsByTagName("body")[0].style.backgroundImage!=null)&&(document.getElementsByTagName("body")[0].style.backgroundImage!="")&&(document.getElementsByTagName("body")[0].style.backgroundImage!="none")){
		if((isIEM())||(isOM())){
			document.getElementsByTagName("body")[0].style.backgroundImage="none";
		}else{
			try{
				img=new Image();
				img.id="bg";
				var tmpsrc=document.getElementsByTagName("body")[0].style.backgroundImage.substring(4,document.getElementsByTagName("body")[0].style.backgroundImage.length-1);
				if((tmpsrc.substr(0,1)=="\"")&&(tmpsrc.substr(tmpsrc.length-1,1)=="\"")){
					tmpsrc=tmpsrc.substring(1,tmpsrc.length-1);
				}
				img.src=tmpsrc;
				img.style.position="absolute";
				img.style.top="0px";
				img.style.left="0px";
				img.style.width=String(p_mwidth)+"px";
				img.style.height=String(p_mheight)+"px";
				document.getElementsByTagName("body")[0].insertBefore(img,document.getElementsByTagName("body")[0].firstChild);
				document.getElementsByTagName("body")[0].style.backgroundImage="none";
			}catch(e){//nothing
			}
		}
	}
	new PCDI(p_mwidth,p_mheight,"ifr1",90,"dlgbk",null);
	new RS(p_mscale,document);
}
function isIEV(p_vers){
	if(isIE()){
		if(Number(navigator.appVersion.substr(navigator.appVersion.indexOf("MSIE")+5,1))>=p_vers){
			return true;														   
		}
	}
	return false;
}
function isIE(){
	if(navigator.appName.indexOf("Microsoft")>-1){
		return true;	
	}
	return false;
}
function isIEM(){
	if(navigator.appName.indexOf("IE Mobile")>-1){
		return true;	
	}
	return false;
}
function isNF(){
	if(navigator.userAgent.indexOf("NetFront")>-1){
		return true;	
	}
	return false;
}
function isNFVers(p_maxv){
	if(isNF()){
		if(parseFloat(navigator.appVersion)<=p_maxv){
			return true;	
		}
	}
	return false;
}
function isO(){
	if(navigator.userAgent.indexOf("Opera")>-1){
		return true;	
	}
	return false;
}
function isOM(){
	if(navigator.userAgent.indexOf("Opera Mini")>-1){
		return true;	
	}
	return false;
}
function isSFM(){
	if((navigator.userAgent.indexOf("Safari")>-1)&&(navigator.userAgent.indexOf("Mobile")>-1)){
		return true;	
	}
	return false;
}
function enPos(){
	var img=new Image();
	try{
		img.style.position="absolute";
		img.style.left="0px";
		img.style.top="0px";		
		return true;
	}catch(e){
		return false;	
	}
}
function setFilter(p_obj,p_flt){
	if(p_obj.style.filter.length==0){
		p_obj.style.filter=p_flt;
	}else{
		var tmpflt=p_obj.style.filter;
		var index=p_obj.style.filter.indexOf(p_flt.substring(0,p_flt.indexOf("("))+"(");
		if(index>-1){
			if(index==0){
				tmpflt=p_flt;
			}else{
				tmpflt=p_obj.style.filter.substring(0,index)+p_flt;
			}
			var endindex=index+p_obj.style.filter.substring(index).indexOf(")")+1;			
			if(endindex<p_obj.style.filter.length){
				tmpflt=tmpflt+p_obj.style.filter.substring(endindex);
			}
			p_obj.style.filter=tmpflt;
		}else{
			p_obj.style.filter=p_flt+tmpflt;
		}
	}
}
function ie_setAlpha(p_obj,p_value){
	try{
		if(isIE()){
			setFilter(p_obj,"alpha(opacity="+String(p_value)+")");
		}else{
			p_obj.style.opacity=p_value/100;
		}
	}catch(e){
		
	}
}
