	
		window.onresize=function(){
			
			if (document.getElementById("popup").style.display=="block"){
			    HideScreen();
			    CenterPopup();
			}
		}
		
		function GetDocWidth(){
			
			var cw=document.documentElement.clientWidth;
			var sw=document.documentElement.scrollWidth;
			
			return (cw>sw?cw:sw);				
		}
			
		function GetDocHeight(){
			var ch=document.documentElement.clientHeight;
			var sh=document.documentElement.scrollHeight;
			
			return (ch>sh?ch:sh);		
			
		}	 
		
		
         function showPopup(flashpath,headertext,width,height){
		 	
			HidePageElements();
			HideScreen();
			DisplayPopup(width,height);
			SetPopupHeader(headertext);	
			LoadFlash(flashpath);
						 
        }
        
        function LoadFlash(flashpath){
        
            var ifrm=document.getElementById("minisite_flash_frame").src=flashpath;        
        
        }
        
        function SetPopupHeader(headertext){
        
            var hd=document.getElementById("popup_header");
            if (hd) {
                hd.innerHTML=headertext;
            }
        
        }
        
        function HideScreen(){
            
           
			var document_width=GetDocWidth();
			var document_height=GetDocHeight();
						
         	var ms=document.getElementById("mask");
			if (ms){
				
				ms.style.width=document_width + "px";
				ms.style.height=document_height + "px";	
				
				ms.style.display="block";
                ms.style.opacity=0.7;
                ms.style.filter="alpha(opacity=70)";			
								
			}
        }
        
        
        function DisplayPopup(popup_width,popup_height){
        
                var mypopup=document.getElementById("popup");
                var myifrm=document.getElementById("minisite_flash_frame");
                if (mypopup){
                    
                    mypopup.style.display="block";
                                       
                    myifrm.style.width=(popup_width+40)+"px";
                    myifrm.style.height=(popup_height+40)+"px";
                         
                    CenterPopup();
				   
                }
        
        }
        
        function CenterPopup(){
            
            var target_div=document.getElementById("popup");
            if (target_div){
                
                var screen_width=document.documentElement.clientWidth;
			    var screen_height=document.documentElement.clientHeight;
                target_div.style.top=(screen_height-target_div.clientHeight)/2 + "px";
				target_div.style.left=(screen_width-target_div.clientWidth)/2 + "px";
            
            }
        
        
        }
        
        
		
		function HidePageElements(){
		
		    document.getElementById("selectproject").style.display="none";
			
			/*var d=document.getElementById("flash_wrapper");
			if (d) {				
				d.style.position="absolute";
				d.style.top="-200px"; 
				d.style.position="relative"; 
				
			}		*/	
		}
		
		function ShowPageElements(){
			
		    document.getElementById("selectproject").style.display="inline";

//			var d=document.getElementById("flash_wrapper");
//			if (d) {				
//				d.style.position="static";
//					
//						
//			}	
		}
		
	
		
		function ClosePopup(){
		
		  HidePopup();
		  ShowScreen();
		  ShowPageElements();
		
			
		}
		
		
		function ShowScreen(){
		
		    var ms=document.getElementById("mask");
		    if (ms){
		    
		        ms.style.display="none";
		    
		    }
		
		}
		
		
		function HidePopup(){
		    
		     var target_div=document.getElementById("popup");
                if (target_div){
                    
                    target_div.style.display="none";
                    var myifrm=document.getElementById("minisite_flash_frame");
                    myifrm.src="about:blank";
                   
                }
		
		}

