var myWidth=1024, myHeight =768;
//
function detectWindowSize() {
//  var myWidth = 0, myHeight = 0;
  if ( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
//	document.write(myWidth+' '+myHeight);
  } else if ( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if ( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  if (myWidth>=1000) {
	myWidth=1000;
  } else if (myWidth<=764) {
	myWidth=764;	
  };
  myHeight=615*(myWidth/1000);
//  if (myHeight!=644) {  
 // myHeight=644;
 // } else  if(myHeight<=600){
//	myHeight=600;
 // };
}
//
function writeMainpageFlash(){
	detectWindowSize() ;
	//alert(myWidth+' '+myHeight);
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+myWidth+'" height="'+myHeight+'" id="mainFlash" bgcolor="#40507B"><param name="movie" value="homepage.swf?flashwidth="'+myWidth+'""><param name="quality" value="high"><param name="bgcolor" value="#40507B"><embed src="homepage.swf?flashwidth="'+myWidth+'"" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+myWidth+'" height="'+myHeight+'" name="mainFlash"></embed></object>');
	//document.write(myWidth+' '+myHeight);
}

//
function resizeFlash(){
	detectWindowSize() ;
	//alert(myWidth+' '+myHeight);
	document.mainFlash.width=myWidth;
	document.mainFlash.height=myHeight;
}
