//-- Focus Blur  --//
function bluring(){
	if(event.srcElement.tagName=="A" || event.srcElement.tagName=="IMG"){
		document.body.focus();
	}
}
document.onfocusin=bluring;

//-- Quickmenu --//
var stmnLEFT = 880;
var stmnGAP1 = 200;
var stmnGAP2 = 0; 
var stmnBASE = 100; 
var stmnActivateSpeed = 10;
var stmnScrollSpeed = 5;


function RefreshStaticMenu()
{
  var stmnStartPoint, stmnEndPoint, stmnRefreshTimer;

  stmnStartPoint = parseInt(STATICMENU.style.top, 10);
  stmnEndPoint = document.body.scrollTop + document.body.clientHeight-400; 
  if (stmnEndPoint < stmnGAP1) stmnEndPoint = stmnGAP1;

  if ( stmnStartPoint != stmnEndPoint ) {
    stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 15 );
    STATICMENU.style.top = parseInt(STATICMENU.style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount );
    stmnRefreshTimer = stmnScrollSpeed;
  }
         else {
    stmnRefreshTimer = stmnActivateSpeed;
  }

  setTimeout ("RefreshStaticMenu();", stmnRefreshTimer);
}

 

function InitializeStaticMenu()
{
  STATICMENU.style.top =document.body.scrollTop - stmnBASE; 
  RefreshStaticMenu();
  STATICMENU.style.left = stmnLEFT;
}

//-- GO TOP --//
function back_top()
{
x = document.body.scrollLeft;
y = document.body.scrollTop;
step = 2;

while ((x != 0) || (y != 0)) {
scroll (x, y);
step += (step * step / 100);
x -= step;
y -= step;
if (x < 0) x = 0;
if (y < 0) y = 0;
} 
scroll (0, 0);
}

//-- FLASH & MOVIE --//
function printSWFHAVEID(idz, fn, w, h)
{
	var arg = arguments;
	var argc =  arguments.length;
	str   = "<object id=\""+idz+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\"width=\""+w+"\" height=\""+h+"\">";
	str += "        <param name=\"SRC\" value=\""+fn+"\">";
	for(i = 4; i < argc ; i++){
		str += "        <param name=\""+arg[i++]+"\" value=\""+arg[i]+"\">";
	}
	str += "</object>";
	document.write(str);
}
// printSWF('link', width, height);
function printSWF(fn, w, h)
{
	var arg = arguments;
	var argc =  arguments.length;
	str   = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\"width=\""+w+"\" height=\""+h+"\">";
	str += "        <param name=\"SRC\" value=\""+fn+"\">";
	str += "        <param name=\"wmode\" value=\"transparent\">";
	for(i = 3; i < argc ; i++){
		str += "        <param name=\""+arg[i++]+"\" value=\""+arg[i]+"\">";
	}
	str += "        <embed wmode='transparent' src=\""+fn+"\" pluginspage=\"http://www.macromedia.com/shockwave/download/\" type=\"application/x-shockwave-flash\" width=\""+w+"\" height=\""+h+"\">";
	str += "        </embed> ";
	str += "</object>";
	document.write(str);
}

function printMEDIA(id, fn, w, h)
{
	
	objstr  = "<OBJECT id=\""+id+"\" name=\""+id+"\" classid=\"CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95\" codebase=\" ";
	objstr += "http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701\" ";
	objstr += "standby=\"Loading Microsoft Windows Media Player components...\" ";
	objstr += "type=\"application/x-oleobject\" bgcolor=\"DarkBlue\" ";
	objstr += "width=\""+w+"\" height=\""+h+"\" ";
	objstr += ">";
	objstr += " <PARAM NAME=\"Filename\" VALUE=\""+fn+"\">";
	objstr += "      <param name=\"ClickToPlay\" value=\"true\">";
	objstr += "      <param name=\"width\" value=\""+w+"\">";
	objstr += "      <param name=\"height\" value=\""+h+"\">";
	objstr += "      <param name=\"AutoSize\" value=\"true\">";
	objstr += "      <param name=\"AutoStart\" value=\"true\">";
	objstr += "      <param name=\"ShowControls\" value=\"false\">";
	objstr += "      <param name=\"ShowAudioControls\" value=\"true\">";
	objstr += "      <param name=\"ShowDisplay\" value=\"false\">";
	objstr += "      <param name=\"ShowTracker\" value=\"true\">";
	objstr += "      <param name=\"ShowStatusBar\" value=\"true\">";
	objstr += "      <param name=\"EnableContextMenu\" value=\"false\">";
	objstr += "      <param name=\"ShowPositionControls\" value=\"false\">";
	objstr += "      <param name=\"ShowCaptioning\" value=\"false\">";
	objstr += "      <param name=\"AutoRewind\" value=\"true\">";
	objstr += "      <param name=\"Enabled\" value=\"true\">";
	objstr += "      <param name=\"EnablePositionControls\" value=\"true\">";
	objstr += "      <param name=\"EnableTracker\" value=\"true\">";
	objstr += "      <param name=\"PlayCount\" value=\"1\">";
	objstr += "      <param name=\"SendWarningEvents\" value=\"true\">";
	objstr += "      <param name=\"SendErrorEvents\" value=\"true\">";
	objstr += "      <param name=\"SendKeyboardEvents\" value=\"false\">";
	objstr += "      <param name=\"SendMouseClickEvents\" value=\"false\">";
	objstr += "      <param name=\"SendMouseMoveEvents\" value=\"false\">";
	objstr += "      <param name=\"ShowGotoBar\" value=\"false\">";
	objstr += "      <param name=\"TransparentAtStart\" value=\"false\">";
	objstr += "      <param name=\"Volume\" value=\"50\">";
	objstr += "	  <param name=\"DisplaySize \" value=\"0\">";
	objstr += "</OBJECT>";
	return objstr;
}

function playMovie(id, fn, w, h){
	document.all.oDivPlayer.innerHTML = printMEDIA(id, fn, w, h)
	obj = eval("document.all."+id);
	obj.Filename=fn;
	setTimeout("VodPlay('"+id+"')", 1000);
}

function VodPause(id){
	obj = eval("document.all."+id);
	if(obj) obj.pause();
}

function VodPlay(id){
	obj = eval("document.all."+id);
	if(obj) obj.play();
}

function VodStop(id){
	obj = eval("document.all."+id);
	if(obj) obj.stop();
}

// PRINT //


function printDiv(){
 if (document.all && window.print){
  window.onbeforeprint = beforeDivs;
  window.onafterprint = afterDivs;
  window.print();
 }
}


function beforeDivs(){
 if(document.all){
  objContents.style.display = 'none';
  objSelection.innerHTML = document.all['print_contents'].innerHTML;
 }
}

function afterDivs(){
 if(document.all){
  objContents.style.display='block';
  objSelection.innerHTML = "";
 }
}