//var isIE  = (navigator.userAgent.indexOf("MSIE 8.0") != -1) ? true : false;
//----------------------------------
function loaded() {
	reset_size();
}
//----------------------------------
function resized() {
	reset_size();
}
//----------------------------------
function reset_size() {
	var myobj = document.getElementById('flashobj');
	var page_size = getPageSize();
	
	if((navigator.userAgent.indexOf("MSIE 8") != -1) || (navigator.userAgent.indexOf("MSIE 9") != -1)){
		flashout();
	}else{
		if(myobj != undefined){
			myobj.removeAttribute("width");   
			myobj.removeAttribute("height");   
			myobj.setAttribute("width", page_size[2]);
			myobj.setAttribute("height", page_size[3]);
		}	

	}
}
//----------------------------------
function flashout() {
	var page_size =[];
	var out = '';
	
	page_size = getPageSize();
	
	var flash_file = 'index'+20+'.swf';
	
	out += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+page_size[2]+'" height="'+page_size[3]+'" align="middle">';
	out += '\n<param name="allowScriptAccess" value="sameDomain" />';
	out += '\n<param name="movie" value="'+flash_file+'" />';
	out += '<param name="quality" value="high" />';
	out += '<param name="scale" value="noscale" />';
	out += '<param name="bgcolor" value="#ffffff" />';
	out += '<embed src="'+flash_file+'" quality="high" scale="noscale" wmode="window" bgcolor="#ffffff" width="'+page_size[2]+'" height="'+page_size[3]+'" name="Oreanda" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" id="flashobj"/>';
	out += '</object>';
	
	document.getElementById('flashout').innerHTML = out;
}
//----------------------------------
function  getPageSize(){
	var xScroll, yScroll;

	if (window.innerHeight && window.scrollMaxY) {
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else if (document.documentElement && document.documentElement.scrollHeight > document.documentElement.offsetHeight){ // Explorer 6 strict mode
		xScroll = document.documentElement.scrollWidth;
		yScroll = document.documentElement.scrollHeight;
	} else { // Explorer Mac...would also work in Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}

	var windowWidth, windowHeight;
	if (self.innerHeight) { // all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}

	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else {
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}

	return [pageWidth,pageHeight,windowWidth,windowHeight];
}
//----------------------------------
