var uagent=navigator.userAgent.toLowerCase();
var is_safari=((uagent.indexOf('safari')!=-1)||(navigator.vendor=="Apple Computer, Inc."));
var is_opera=(uagent.indexOf('opera')!=-1);
var is_webtv=(uagent.indexOf('webtv')!=-1);
var is_ie=((uagent.indexOf('msie')!=-1)&&(!is_opera)&&(!is_safari)&&(!is_webtv));
var is_ie4=((is_ie)&&(uagent.indexOf("msie 4.")!=-1));
var is_ie7=((is_ie)&&(uagent.indexOf("msie 7.")!=-1));
var is_moz=(navigator.product=='Gecko');
var is_ns=((uagent.indexOf('compatible')==-1)&&(uagent.indexOf('mozilla')!=-1)&&(!is_opera)&&(!is_webtv)&&(!is_safari));
var is_ns4=((is_ns)&&(parseInt(navigator.appVersion)==4));
var is_kon=(uagent.indexOf('konqueror')!=-1);
var is_win=((uagent.indexOf("win")!=-1)||(uagent.indexOf("16bit")!=-1));
var is_mac=((uagent.indexOf("mac")!=-1)||(navigator.vendor=="Apple Computer, Inc."));
var ua_vers=parseInt(navigator.appVersion);

function add_shadow(wrapname,divname){
	var divobj=document.getElementById(divname);
	var wrapobj=document.getElementById(wrapname);
	if(is_ie){
		wrapobj.className='shadow-ie';
		wrapobj.style.width=divobj.offsetWidth+1+'px';
		wrapobj.style.height=divobj.offsetHeight+1+'px';
	}else{
		wrapobj.className='shadow-moz';
		wrapobj.style.width=divobj.offsetWidth+0+'px';
		wrapobj.style.height=divobj.offsetHeight+0+'px';}
}

function center_div(){
	this.divname='';
	this.divobj='';
	this.shimobj='';
}

center_div.prototype.move_div=function(){
	try{
		if(parent.document.getElementById(this.divname)){
			this._document=parent.document;this._window=parent.window;
		}
	}catch(e){return;}

	this.divobj=this._document.getElementById(this.divname);
	var my_width=0;
	var my_height=0;
	if(typeof(this._window.innerWidth)=='number'){
		my_width=this._window.innerWidth;
		my_height=this._window.innerHeight;
	}else 
		if(this._document.documentElement&&(this._document.documentElement.clientWidth||this._document.documentElement.clientHeight)){
			my_width=this._document.documentElement.clientWidth;
			my_height=this._document.documentElement.clientHeight;
		}else 
			if(this._document.body&&(this._document.body.clientWidth||this._document.body.clientHeight)){
				my_width=this._document.body.clientWidth;
				my_height=this._document.body.clientHeight;
			}
			
	this.divobj.style.position='absolute';
	this.divobj.style.display='block';
	this.divobj.style.zIndex=-1;
	
	if(is_ie){
		var layer_html=this.divobj.innerHTML;
		var full_html="<iframe id='"+this.divname+"-shim' src='/data/images/iframe.html' class='iframshim' scrolling='no' frameborder='0' style='position:absolute; top:0px; left:0px; right:0px; display: none;'></iframe>"+layer_html;
		this.divobj.innerHTML=full_html;
	}
	
	if(is_ie){
		this.shimobj=this._document.getElementById(this.divname+"-shim");
		this.shimobj.style.width=(parseInt(this.divobj.offsetWidth)-5)+"px";
		this.shimobj.style.height=this.divobj.offsetHeight;
		this.shimobj.style.zIndex=this.divobj.style.zIndex-1;
		this.shimobj.style.top=this.divobj.style.top;
		this.shimobj.style.left=this.divobj.style.left;
		this.shimobj.style.display="block";
	}
	
	var divheight=parseInt(this.divobj.style.height)?parseInt(this.divobj.style.height):parseInt(this.divobj.offsetHeight);
	var divwidth=parseInt(this.divobj.style.width)?parseInt(this.divobj.style.width):parseInt(this.divobj.offsetWidth);
	
	divheight=divheight?divheight:200;
	divwidth=divwidth?divwidth:400;
	
	var scrolly=this.getYscroll();
	var setX=(my_width-divwidth)/2;
	var setY=(my_height-divheight)/2+scrolly;

	setX=(setX<0)?0:setX;
	setY=(setY<0)?0:setY;
	
	this.divobj.style.left=setX+"px";
	this.divobj.style.top=setY+"px";
	this.divobj.style.zIndex=99;
};

center_div.prototype.hide_div=function(){
	try{
		if(!this.divobj){
			return;
		}else{
			this.divobj.style.display='none';
		}
	}catch(e){return;}
};

center_div.prototype.getYscroll=function(){
	var scrollY=0;
	if(this._document.documentElement&&this._document.documentElement.scrollTop){
		scrollY=this._document.documentElement.scrollTop;
	}else 
		if(this._document.body&&this._document.body.scrollTop){
			scrollY=this._document.body.scrollTop;
		}else
			if(this._window.pageYOffset){
				scrollY=this._window.pageYOffset;
			}else 
				if(this._window.scrollY){
					scrollY=this._window.scrollY;
				}return scrollY;
};

