var oldtop;

var oldleft;



var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;



// Handle all the FSCommand messages in a Flash movie.



var iid;



function setupInt(secs){

  iid = window.setInterval('setupInt2()', secs);

}



function setupInt2(){

  setupFlash();

  window.clearInterval(iid);

}



// Hook for Internet Explorer.

  if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {

    document.write('<script language=\"VBScript\"\>\n');

    document.write('On Error Resume Next\n');

    document.write('Sub video_FSCommand(ByVal command, ByVal args)\n');

    document.write('	Call video_DoFSCommand(command, args)\n');

    document.write('End Sub\n');

    document.write('</script\>\n');

  }





function setupFlash(){



  var div = document.getElementById("video_div");

  div.innerHTML='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="video" width="320" height="240" align="middle">'+

      '<param name="allowScriptAccess" value="always" />'+

      '<param name="movie" value="video.swf" />'+

      '<param name="quality" value="high" />'+

      '<param name="wmode" value="transparent" />'+

      '<param name="bgcolor" value="#ffffff" />'+

        '<embed src="video.swf" quality="high" wmode="transparent" bgcolor="#ffffff" width="320" height="240" swLiveConnect=true id="video" name="video" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'+

    '</object>';





  window.onscroll = alertwin;

  window.onresize = alertwin;

  ROV_interval = window.setInterval('alertwin()', 1000);



}



function video_DoFSCommand(command, args) {

	var videoObj = isInternetExplorer ? document.all.video : document.video;

	if (command=="close"){

		var div = document.getElementById("video_div");

		//div.innerHTML="";

		div.style.display="none";

	}

}







function alertwin(){

  //if ((document.body.scrollTop!=oldtop) || (document.body.scrollLeft!=oldleft)){

    //oldtop=document.body.scrollTop;

    //oldleft=document.body.scrollLeft;

    //window.resizeBy(1,1);

    //window.resizeBy(-1,-1);

  //}

	var scrW = 0;

	var scrH = 0;

	var scrOfX = 0;

	var scrOfY = 0;

        

	var div = document.getElementById("video_div");

	if( !div ) return; 

	if( div.style ) div = div.style; 

        if( typeof( window.innerWidth ) == 'number' ) 

	{ 

		scrW = window.innerWidth; 

		scrH = window.innerHeight; 

	} else 	{

		if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 

		{

			scrW = document.documentElement.clientWidth;

			scrH = document.documentElement.clientHeight; 

		} else {

			if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 

			{

				scrW = document.body.clientWidth; 

				scrH = document.body.clientHeight; 

			} 

		} 

	}



	if( typeof( window.pageYOffset ) == 'number' ) { 

		scrOfY = pageYOffset; 

		scrOfX = pageXOffset; 

	} else {

		if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) 

		{ 

			scrOfY = document.body.scrollTop; 

			scrOfX = document.body.scrollLeft;

		} else 	{

			if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) 

			{ 

				scrOfY = document.documentElement.scrollTop; 

				scrOfX = document.documentElement.scrollLeft; 

			} 

		}

	}



	var oPix = document.childNodes ? 'px' : 0;



	var iLeft = 0;

	var iTop = 0;



	var ROV_scrW = scrW;

	var ROV_scrH = scrH;

	var ROV_scrOfX = scrOfX;

	var ROV_scrOfY = scrOfY;





	if (isInternetExplorer){

		iLeft = ( ( ROV_scrW - 320 + scrOfX) );

		iTop = ( ( ROV_scrH - 240 + scrOfY) );

	} else {

		iLeft = ( ( ROV_scrW - 320 - 18 + scrOfX) );

		iTop = ( ( ROV_scrH - 240 + scrOfY) );

	}




	div.left = iLeft  + oPix;

	div.top  = iTop + oPix;

	

}