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];
}

function getClientWidth() {  
	return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;  
}  
   
function getClientHeight() {  
	return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
} 

function getMovie() {
  if (navigator.appName.indexOf("Microsoft") != -1) {
        return window['flash_obj']
    }
    else {
        return document['flash_obj']
    }
}

function resizeFlash() {
	$sizes =  getPageSize();
	$height = parseInt($sizes[3]*0.85);
	if ($height<490) $height=490;
	//$flash = $('#flash');
	//$flash.find('object').eq(0).attr('height', $height);
	$('#flash_obj').attr('height', $height);
	$('#flash_obj').find('embed').eq(0).attr('height', $height);
	if($.browser.msie && parseInt($.browser.version) < 7) $('#foo').css("top", $('#layout').height()-$('#foo').height() );
	try {
    getMovie().sendFromJS($sizes[0], $height+2);
  } catch(e) {
    setTimeout('resizeFlash()', 100);
  }
}

$(window).resize(function() {
	resizeFlash();
});

$().ready(function() {
  /*$sizes =  getPageSize();
  $height = parseInt($sizes[3]*0.85);
  if ($height<490) $height=490;
  $('#flash').flash({
    id: 'flash_obj',
    classid: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
    codebase: "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab",
    swf: '/presentation_trtr.swf?qqq='+Math.random()*999,
    width: '100%',
    height: $height,
    quality: 'high',
    scale: 'noscale',
    params: {
      scale: 'noscale',
      allowScriptAccess: "sameDomain"
    },
    flashvars: { xml_url: '/options.xml?qqq='+Math.random()*999, stageWidth: $sizes[0], stageHeight: $height }
  });*/
	//setTimeout('resizeFlash()', 1000);
  
  resizeFlash();
  
	$('#nav').hover(function() {
		$('a', this).stop().animate({color:'#ffffff'}, "normal");	 
	 }, function() {
		$('a', this).stop().animate({color:'#8093BD'}, "normal"); 
	 });
});
