/*He keeps me functioning each n everyday...without him i am nothings*/
var popup=function(){
	var ie = document.all ? true : false;
	var timer = 20;
	var alpha = 0;
	var endalpha = 100;
	var speed = 10;
	return{
		browser:function(){
			var bodyWidth = document.documentElement.clientWidth;
			var bodyHeight = document.documentElement.clientHeight;
			if(self.innerHeight){
				bodyWidth = self.innerWidth; 
				bodyHeight = self.innerHeight; 	
			}else if(document.documentElement && document.documentElement.clientHeight){
				bodyWidth = document.documentElement.clientWidth; 
				bodyHeight = document.documentElement.clientHeight;
			}else if(document.body){
				bodyWidth = document.body.clientWidth; 
				bodyHeight = document.body.clientHeight; 
			}
			return [bodyWidth,bodyHeight];
		 },	
		show:function(id){
			elem=document.getElementById(id);
			var arrSize=popup.browser();
			elem.style.display='block';
			
			var x=(arrSize[0]/2)-(585/2);
			var y=(arrSize[1]/2)-(250/2)+Math.max(document.body.scrollTop,document.documentElement.scrollTop);
			elem.style.left=(x+10)+'px';
			elem.style.top=(y-10)+'px';
			clearInterval(elem.timer);
  		 	elem.timer=setInterval(function(){popup.fadepic(1)},timer);
		},
		hide:function(id){
			elem = document.getElementById(id);
			if(elem.style.display!='none'){
			 clearInterval(elem.timer);
			 elem.timer=setInterval(function(){popup.fadepic(-1)},timer);	
			}
			//elem.style.display = 'none';
			return false;
		},
		fadepic:function(d){
			 var a=alpha; 
			 if((a !=  endalpha && d == 1) || (a != 0 && d == -1)){
				 var i=speed;
				 if(endalpha - a < speed && d == 1){
					i= endalpha-a;
				 }else if(alpha < speed && d == -1){
					 i  = a;
				 }
				 alpha = a + (i * d);
				 elem.style.opacity  = alpha * .01;
				 elem.style.filter = 'alpha(opacity=' + alpha + ')';
			 }else{
					clearInterval(elem.timer);
					if(d == -1){elem.style.display = 'none'}
				}
		},
		doit:function(e){
			if (!e) var e = window.event;
			if (e.button!=2) {
				popup.hide();
			}
		}
	};
}();
//document.onmousedown=popup.doit;
/*var elem = document.getElementById('pop');
document.addEventListener('click',popup.hide,true);
elem.addEventListener('click',function(){popup.show; },true);*/