// JavaScript Document

		function GetWidth()
		{
//			alert(document.body.offsetWidth+" vs "+self.innerWidth);
        	var x = 0;
        	if (self.innerWidth)
        	{
				if(document.body.offsetWidth) {
					if(document.body.offsetWidth < self.innerWidth) {
		           	    x = document.body.offsetWidth;
					} else {
		           	    x = self.innerWidth;
					}
				}
        	}
        	else if (document.documentElement && document.documentElement.clientHeight)
        	{
            	    x = document.documentElement.clientWidth;
        	}
        	else if (document.body)
        	{
            	    x = document.body.clientWidth;
        	}
        	return x;

		}
		
		function GetHeight() {
	        var y = 0;
	        if (self.innerHeight) {
                y = self.innerHeight;
	        } else if (document.documentElement && document.documentElement.clientHeight)  {
     	          	y = document.documentElement.clientHeight;
	      	} else if (document.body) {
               		y = document.body.clientHeight;  
			}
 	       return y;
		}
		
		timeSignature = Array();
		dateVar = new Date();
		timeSignature[0] = dateVar.getTime();
		timeSignature[1] = 0;
		timeSignature[2] = 0;
		
		function sizeDivWrapper() {
			timeSignature[4] = timeSignature[3];
			timeSignature[3] = timeSignature[2];
			timeSignature[2] = timeSignature[1];
			timeSignature[1] = timeSignature[0];
			dateVar2 = new Date();
			timeSignature[0] = dateVar2.getTime();
			if(timeSignature[0] - timeSignature[2] < 100) {
			//	document.title +=", resize loop2";
				return;
			}
			else {
				sizeExtendsDiv();
			}
		}		
		
        function sizeExtendsDiv() {

			var overlayObject = document.getElementById("sizeFrame");
			var flashDiv1 = document.getElementById("flashDiv");
			var flashDiv2 = document.getElementById("flashcontent");
			newWidth = GetWidth();
			if(newWidth < 1000) {
				newWidth = 1000;	
			}
			overlayObject.style.width = newWidth+"px";
			flashDiv1.style.width = newWidth+"px";
			heightMin = parseInt(newWidth) * 0.512;
			if(heightMin > GetHeight() ) {
				overlayObject.style.height = heightMin+"px";
				flashDiv1.style.height = heightMin+"px";
			} else {
				overlayObject.style.height = GetHeight() +"px";
				flashDiv1.style.height = GetHeight() +"px";
			}
			if(last_width > newWidth || last_height > GetHeight() && oneSizeUp == 0) {
				oneSizeUp = 1;
				sizeDivWrapper();
			} else {
				oneSizeUp = 0;
			}
			last_width = newWidth;
			last_height = parseInt(overlayObject.style.height);
		}
        
		function initResize() {
		
			last_width = 1000;
			last_height = 512;
			sizeExtendsDiv();
			
		}
		
		function loadMinisite(pagePath, type) {
//			alert("opening window");
			day = new Date();
			id = day.getTime();
			eval("minisite = window.open('"+pagePath+"', 'wasa_"+type+"', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=515,height=600');");
		}
		
		function openNewWindow(pagePath) {
//			alert("opening window");
			window.open(pagePath,"_blank");
		}
