var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
var isSafari  = (navigator.appVersion.indexOf("Safari") != -1) ? true : false;
var isMac=(navigator.userAgent.toLowerCase().indexOf("mac")!=-1)?true:false;
var isMacFinal=isMac;
var hBack=0;
var g_Langue,g_MDB;
var g_iBack;

function JSGetSwfVer(i)
{
	if (navigator.plugins != null && navigator.plugins.length > 0) 
	{
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) 
		{
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			descArray = flashDescription.split(" ");
			tempArrayMajor = descArray[2].split(".");
			versionMajor = tempArrayMajor[0];
			versionMinor = tempArrayMajor[1];
			if ( descArray[3] != "" ) 
				tempArrayMinor = descArray[3].split("r");
			else 
				tempArrayMinor = descArray[4].split("r");
   		versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
      flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
    }
		else 
			flashVer = -1;
	}
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else 
		flashVer = -1;
	return flashVer;
} 

function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) 
{
 	reqVer = parseFloat(reqMajorVer + "." + reqRevision);
	for (i=25;i>0;i=i-1) 
	{	
		if (isIE && isWin && !isOpera)
		{
			versionStr = VBGetSwfVer(i);
		}
		else
			versionStr = JSGetSwfVer(i);		
		if (versionStr == -1 )
			return false;
		else 
		if (versionStr != 0) 
		{
			if(isIE && isWin && !isOpera) 
			{
				tempArray         = versionStr.split(" ");
				tempString        = tempArray[1];
				versionArray      = tempString .split(",");				
			}
			else
				versionArray      = versionStr.split(".");
			versionMajor      = versionArray[0];
			versionMinor      = versionArray[1];
			versionRevision   = versionArray[2];
			
			versionString     = versionMajor + "." + versionRevision;   // 7.0r24 == 7.24
			versionNum        = parseFloat(versionString);
			if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) 
				return true;
			else
				return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false );	
		}
	}	
	return (reqVer ? false : 0.0);
}
var myWidth,myHeight,OffsetX=0,OffsetY=0,hasBack=0,OverlayOffsetX=0;
var first=1;
var FlashMinSX,FlashMinSY,FlashCurSY,FlashHasLayer,HasScroll;
var SizeX1,SizeY1,SizeX2,SizeY2;
var HasScrollH=0;
var CountTAB=0;

if (isMac && !isIE)
  isMac=false;

SizeX1=SizeY1=SizeX2=SizeY2=0;

function BuildSize()
{
  if( typeof( window.innerWidth ) == 'number' ) 
	{
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  }
	else 
	if( document.documentElement &&( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
	{
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  }
	else 
	if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
	{
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
	myWidth-=SizeX1+SizeX2;
	myHeight-=SizeY1+SizeY2;
}


function BuildClip()
{
	var i;
	for (i=0;i<10;i++)
	{
		var clp=document.getElementById("CLayerD"+i);
		if (clp.style.visibility!="visible")
			continue;
		clp=document.getElementById("CLayer"+i);
		if (clp.style.visibility!="visible")
			continue;
		var x=clp.Xori;
		var y=clp.Yori;
		if (x==undefined)
		  x=y=0;
		clp.style.left=x+OffsetX;
		clp.style.top=y+OffsetY;
		var sx=parseInt(clp.style.width);
		var sy=parseInt(clp.style.height);
			// Top Right Bottom Left
		if (x+OffsetX+sx>myWidth-16)
			sx=(myWidth-16)-x-OffsetX;
		if (y+OffsetY+sy>myHeight-16*HasScrollH)
			sy=(myHeight-16*HasScrollH)-y-OffsetY;
    clp.style.clip="rect(0,"+sx+","+sy+",0)";
  }
}

function ResizeFlash()
{
  BuildSize();

	if (HasScroll)
	{
	  var flash;

	  if (!isIE && !isSafari)
  	  flash=document.getElementById("OpenFlash").getElementsByTagName('embed')[0];
		else
		  flash=document.getElementById("OpenFlash");
		flash.SetVariable("_root.WindowSizeX",myWidth);
	  flash.SetVariable("_root.WindowSizeY",myHeight);
	  flash.TGotoLabel("_level0/__ScrollManage","SetSize");
    BuildClip();
	}
	else
	{
		if (myWidth<FlashMinSX)
			myWidth=FlashMinSX;
		if (myHeight<FlashCurSY)
			myHeight=FlashCurSY;
		if (myHeight<FlashMinSY)
			myHeight=FlashMinSY;
	  if (FlashHasLayer)
	  {
		  if (x_Align=="T")
			  OverlayOffsetX=myWidth/2-FlashMinSX/2;
			else
			  OverlayOffsetX=0;
			var i;
			for (i=0;i<10;i++)
			{
				var clp=document.getElementById("CLayer"+i);
				if (clp.style.visibility!="visible")
					continue;
				clp=document.getElementById("CLayerD"+i);
				if (clp.style.visibility!="visible")
					continue;
				var x=clp.Xori;
				if (x==undefined)
					x=0;
				clp.style.left=x+OverlayOffsetX;
			}
    }
	}
  if (document.getElementById("flashObject"))
	{
    document.getElementById("flashObject").style.width=myWidth;
    document.getElementById("flashObject").style.height=myHeight;
	}
	if (SizeX1!=0)
    document.getElementById("LLayer").style.height=myHeight;
	if (SizeX2!=0)
	{
	  document.getElementById("RLayerD").style.left=myWidth+SizeX1;
    document.getElementById("RLayer").style.height=myHeight;
	}
	if (SizeY2!=0)
	{
    document.getElementById("BLayerD").style.top=SizeY1+myHeight;
    document.getElementById("BLayer").style.width=SizeX1+SizeX2+myWidth;
	}
	if (SizeY1!=0)
    document.getElementById("TLayer").style.width=SizeX1+SizeX2+myWidth;
}

function CallHelp(key)
{
  neww=window.open("/WebEdit/CallHelp.asp?Key="+key,"OpenSiteHelp","toolbar=0,status=0,menubar=0,topmost=1,dependent=1,alwaysRaised=1");
	neww.focus();
}

function CallPrint(par,sizex,sizey)
{
  window.open("/WebEdit/PrintPage.asp?SizeX="+sizex+"&"+par,"OpenSiteDump","resizable=yes,toolbar=0,status=0,menubar=0,topmost=1,dependent=1,scrollbars=1,alwaysRaised=1,width="+(sizex+32));
}

function CallPrintFlat(par,sizex,sizey)
{
  window.open("/WebEdit/PrintPageFlat.asp?SizeX="+sizex+"&"+par,"OpenSiteDump","resizable=yes,toolbar=0,status=0,menubar=0,topmost=1,dependent=1,scrollbars=1,alwaysRaised=1,width="+(sizex+32));
}

function CallPrint2(url)
{
  window.open(url,"OpenSiteDump","resizable=yes,toolbar=0,status=0,menubar=0,topmost=1,dependent=1,scrollbars=1,alwaysRaised=1");
}

function replace(string,text,by) 
{
  var reg=new RegExp("("+text+")","g");
  return string.replace(reg,by);
}

function DecodeStr(str)
{
  var str2,p,i,c;
	var pos=0;

  do
  {
    p=str.indexOf("##",pos);
    if (p==-1)
      break;
		pos=p+1;
		str2=str.substr(p+2,str.indexOf(";",p+2)-p-2);
		c=parseInt(str2,10);
		if (!c)
		  str=replace(str,"##"+str2+";","##");
		else
		  str=replace(str,"##"+str2+";",String.fromCharCode(c));
  }
  while(1);
 	return(str);
}

function EncodeHTML(str)
{
  str=replace(str,'À','&Agrave;');
  str=replace(str,'à','&agrave;');
  str=replace(str,'Â','&Acirc;');
  str=replace(str,'â','&acirc;');
  str=replace(str,'Ç','&Ccedil;');
  str=replace(str,'ç','&ccedil;');
  str=replace(str,'È','&Egrave;');
  str=replace(str,'è','&egrave;');
  str=replace(str,'É','&Eacute;');
  str=replace(str,'é','&eacute;');
  str=replace(str,'Ê','&Ecirc;');
  str=replace(str,'ê','&ecirc;');
  str=replace(str,'Ô','&Ocirc;');
  str=replace(str,'ô','&ocirc;');
  str=replace(str,'€','&euro;');
  str=replace(str,'£','&pound;');
  str=replace(str,'«','&laquo;');
  str=replace(str,'»','&raquo;');
  str=replace(str,'©','&copy;');
	return(str);
}

function OpenFlash_DoFSCommand(command, args) 
{
	if (!isIE && first && !isMacFinal)
	{
	  var flash;

 	  flash=document.getElementById("OpenFlash").getElementsByTagName('embed')[0];
		flash.SetVariable("_global.m_Flash8",0);
		first=0;
	}
	if (command=='GoURL')
	{
	  return;
	}
  if (command=='NoTAB')
	{
	  var way=parseInt(args);
		if (way==0)
		{
		  CountTAB-=1;
			if (CountTAB==0)
			  unsetEventListener(disableTabKey);
			if (CountTAB<0)
			  CountTAB=0;
		}
		else
		{
  		CountTAB++;
			if (CountTAB==1)
			  setEventListener(disableTabKey);
		}
	}
  if (command=='ScrollManage')
	{
	  var flash;

	  if (!isIE && !isSafari)
  	  flash=document.getElementById("OpenFlash").getElementsByTagName('embed')[0];
		else
		  flash=document.getElementById("OpenFlash");
		flash.SetVariable("_root.WindowSizeX",myWidth);
	  flash.SetVariable("_root.WindowSizeY",myHeight);
	  flash.TGotoLabel("_level0/__ScrollManage","SetSize");
		return;
	}
  if (command=='Title')
	{
	  if (args=="")
		  document.title=xp_PageTitle;
		else
	    document.title=DecodeStr(args);//EncodeHTML(args);
		return;
	}
  if (command=='Urchin')
	{
    urchinTracker(args);
		return;
	}
  if (command=='Back')
	{
	  if (g_iBack)
		{
	    hasBack=1;
      document.getElementById("Back").src="/WebEdit/IBack.asp?Back="+args+"&HB="+hBack+"&Title="+document.title;
		  hBack++;
		}
		return;
	}
  if (command=='SetAnchor')
	{
	  if (!g_iBack)
		  SWFAddress.setValue(args);
		return;
	}
  if (command=='MaxSizeY')
	{
    var sy=parseInt(args);

    if (HasScroll)
		  return;
		BuildSize();
	  if (myHeight<sy)
	    myHeight=sy;
  	if (myHeight<FlashMinSY)
  	  myHeight=FlashMinSY;
	  FlashCurSY=sy;

    document.getElementById("flashObject").style.height=myHeight;
		if (SizeX1!=0)
			document.getElementById("LLayer").style.height=myHeight;
		if (SizeX2!=0)
			document.getElementById("RLayer").style.height=myHeight;
  	if (SizeY2!=0)
      document.getElementById("BLayerD").style.top=SizeY1+myHeight;
		return;
	}
	if (command=='HTMLLayer')		// TopLayer : SizeY,Url
	{
	  var mode=args.substr(0,1);
		args=args.substr(2);
	  if (args=="")
		{
			document.getElementById(mode+"Layer").src="";
			switch(mode)
			{
			  case "T":
				  SizeY1=0;
			    document.getElementById(mode+"Layer").style.height=0;
			    document.getElementById("flashObject").style.top=0;
					break;
			  case "B":
				  SizeY2=0;
			    document.getElementById(mode+"Layer").style.height=0;
			    document.getElementById("flashObject").style.top=0;
					break;
			  case "L":
				  SizeX1=0;
			    document.getElementById(mode+"Layer").style.width=0;
			    document.getElementById("flashObject").style.left=0;
					break;
			  case "R":
				  SizeX2=0;
			    document.getElementById(mode+"Layer").style.width=0;
			    document.getElementById("flashObject").style.left=0;
					break;
			}
			document.getElementById(mode+"Layer").style.visibility="hidden";
		}
		else
		{
	    var j=args.indexOf(',');
			var sy;

		  if (j==-1)
			  sy=parseInt(args);
			else
			{
				var url=args.substr(j+1);

				sy=parseInt(args.substr(0,j));
				document.getElementById(mode+"Layer").src=url;
			}
			switch(mode)
			{
			  case "T":
				  SizeY1=sy;
					document.getElementById(mode+"Layer").style.height=sy;
					document.getElementById("flashObject").style.top=sy;
					document.getElementById(mode+"Layer").style.width=SizeX1+SizeX2+myWidth;
					break;
			  case "B":
				  SizeY2=sy;
					document.getElementById(mode+"Layer").style.height=sy;
					document.getElementById(mode+"LayerD").style.top=SizeY1+myHeight;
					document.getElementById(mode+"Layer").style.width=SizeX1+SizeX2+myWidth;
					break;
				case "L":
				  SizeX1=sy;
					document.getElementById(mode+"Layer").style.width=sy;
					document.getElementById("flashObject").style.left=sy;
					document.getElementById(mode+"Layer").style.height=myHeight;
					document.getElementById(mode+"LayerD").style.top=SizeY1;
				  break;
				case "R":
				  SizeX2=sy;
					document.getElementById(mode+"Layer").style.width=sy;
					document.getElementById(mode+"Layer").style.height=myHeight;
					document.getElementById(mode+"LayerD").style.top=SizeY1;
					document.getElementById(mode+"LayerD").style.left=myWidth+SizeX1;
				  break;
			}
			document.getElementById(mode+"Layer").style.visibility="visible";
		}
		return;
	}
	if (command=='OverflowLayer')
	{
	  var j=args.indexOf(',');
		if (j==-1)
		{
			var lid=parseInt(args);
			document.getElementById("CLayer"+lid).src="";
	    document.getElementById("CLayerD"+lid).style.width=0;
	    document.getElementById("CLayerD"+lid).style.height=0;
 			document.getElementById("CLayerD"+lid).style.visibility="hidden";
			document.getElementById("CLayer"+lid).style.visibility="hidden";
		}
		else
		{
			var lid=parseInt(args.substr(0,j));
			args=args.substr(j+1);
	    j=args.indexOf(',');
			var x=parseInt(args.substr(0,j));
			args=args.substr(j+1);
			j=args.indexOf(',');
			var y=parseInt(args.substr(0,j));
			args=args.substr(j+1);
			j=args.indexOf(',');
			var sx=parseInt(args.substr(0,j));
			args=args.substr(j+1);
			j=args.indexOf(',');
			var sy=parseInt(args.substr(0,j));
			url=args.substr(j+1);
		  var clp=document.getElementById("CLayerD"+lid);
			if (url.substr(0,1)=="@")
			{
			  var d=new Date(); 
			  document.getElementById("CLayer"+lid).src="/WebEdit/GetWebContent.asp?Ref="+url.substr(1)+"&UID="+d.getTime()+"&MDB="+g_MDB+"&Langue="+g_Langue;
			}
			else
			  document.getElementById("CLayer"+lid).src=url;
			clp.style.left=x+OverlayOffsetX;
			clp.Xori=x;
			clp.style.top=y;
			clp.Yori=y;
			clp.style.width=sx;
			clp.style.height=sy;
     	clp.style.visibility="hidden";
  		clp.style.visibility="visible";
  		document.getElementById("CLayer"+lid).style.visibility="visible";

		  var clp=document.getElementById("CLayer"+lid);
			clp.style.scrollbarFaceColor=document.body.style.scrollbarFaceColor;
			clp.style.scrollbarArrowColor=document.body.style.scrollbarArrowColor;
			clp.style.scrollbarTrackColor=document.body.style.scrollbarTrackColor;
			clp.style.scrollbarDarkshadowColor=document.body.style.scrollbarDarkshadowColor;
			clp.style.scrollbarHighlightColor=document.body.style.scrollbarHighlightColor;
			clp.style.scrollbar3dlightColor=document.body.style.scrollbar3dlightColor;
			clp.style.scrollbarShadowColor=document.body.style.scrollbarShadowColor;

		  var clp=document.getElementById("CLayerD"+lid);
				// Top Right Bottom Left
			if (x+sx>myWidth-16)
			  sx=(myWidth-16)-x;
			//if (y+sy>FlashCurSY-16*HasScrollH)
			//  sy=(FlashCurSY-16*HasScrollH)-y;
			//clp.style.clip="rect(0,"+sx+","+sy+",0)";
		}
		return;
	}
	if (command=="HasScrollH")
	{
	  HasScrollH=parseInt(args);
		BuildClip();
		return;
	}
	if (command=="SetVPos")
	{
	  OffsetY=parseInt(args);
		BuildClip();
	  return;
	}
	if (command=="SetHPos")
	{
	  OffsetX=parseInt(args);
		BuildClip();
	  return;
	}
	if (command=="Wheel")
	{
	  scrollBy(0,parseInt(args)*8);
		return;
	}
	if (command=="ScrollColor")
	{
	  var j=args.indexOf(',');
    document.body.style.scrollbarFaceColor=args.substr(0,j);
		args=args.substr(j+1);
	  j=args.indexOf(',');
    document.body.style.scrollbarArrowColor=args.substr(0,j);
		args=args.substr(j+1);
	  j=args.indexOf(',');
    document.body.style.scrollbarTrackColor=args.substr(0,j);
		args=args.substr(j+1);
	  j=args.indexOf(',');
    document.body.style.scrollbarDarkshadowColor=args.substr(0,j);
		args=args.substr(j+1);
	  j=args.indexOf(',');
    document.body.style.scrollbarHighlightColor=args.substr(0,j);
		args=args.substr(j+1);
	  j=args.indexOf(',');
    document.body.style.scrollbar3dlightColor=args.substr(0,j);
		args=args.substr(j+1);
	  j=args.indexOf(',');
    document.body.style.scrollbarShadowColor=args.substr(0,j);
		return;
  }
	if (command=="SetScrollTop")
	{
	  scroll(0,0);
	  return;
	}
	if (command=="GotoScroll")
	{
	  var j=args.indexOf(',');
    var x=args.substr(0,j);
		var y=args.substr(j+1);
	  scroll(x,y);
	  return;
	}
}

function IsBack(id)
{
  var flash;

  if (!hasBack || !g_iBack)
	  return;
  if (!isIE && !isSafari)
  	flash=document.getElementById("OpenFlash").getElementsByTagName('embed')[0];
	else
		flash=document.getElementById("OpenFlash");
  flash.SetVariable("_root.__WantBackPage",id);
  flash.TGotoLabel("_root","OpenSite");
}

myTracker=function(id)
{
	if (!isIE && !isSafari)
  	flash=document.getElementById("OpenFlash").getElementsByTagName('embed')[0];
	else
		flash=document.getElementById("OpenFlash");
	if (id.substr(1)=="/")
	  id=id.substr(1);
  flash.SetVariable("_root.__WantTrackPage",id);
  flash.TGotoLabel("_level0/__ScrollManage","SetSize");
}

function CheckBack(id,bck)
{
  if (id==undefined)
    return(false);
	if (id<hBack-1)
	{
	  IsBack(bck);
		return(true);
	}
	return(false);
}

function MM_openBrWindow(theURL,winName,features) 
{
  var wnd;

  wnd=window.open(theURL,winName,features);
	wnd.opener=self;
}
function flashGetHref() { return location.href; }
function flashPutHref(href) { location.href = href; }
function flashGetTitle() { return document.title; }
function flashPutTitle(title) { document.title = title; }

function disableTabKey (evt) 
{ 
  var event; 

  if (evt)
     event = evt; 
  else
	if (window.event)
    event = window.event; 
  if (event) 
	{ 
    var keyCode = event.keyCode ? event.keyCode : event.charCode; 
    if (keyCode == 9) 
		{ 
      if (event.preventDefault) 
        event.preventDefault(); 
      return false; 
    } 
  } 
} 

/*
function ArrowListener() 
{ 
  alert("OK key");
} 

function setArrowListener() 
{ 
  if (!isIE || x_HasLayer!=1)
	  return;
  if (document.addEventListener) 
    document.addEventListener('keypress',ArrowListener,true); 
  else 
	if (document.attachEvent)
    document.attachEvent("onkeydown",ArrowListener); 
  else
    document.onkeydown=ArrowListener; 
} 
*/

function setEventListener (eventListener) 
{ 
  if (document.addEventListener) 
    document.addEventListener('keypress', eventListener, true); 
  else 
	if (document.attachEvent)
   document.attachEvent('onkeydown', eventListener); 
  else
   document.onkeydown = eventListener; 
} 

function unsetEventListener (eventListener) 
{ 
  if (document.removeEventListener)
     document.removeEventListener('keypress', eventListener, true); 
  else
	if (document.detachEvent)
    document.detachEvent('onkeydown', eventListener); 
  else
    document.onkeydown = null; 
}

function initDiv(clp)
{
  var _v1=48;
	var _v2=24;
	var _v=_v1/_v2-1;
	//clp.style.width=_v;
	//clp.style.height=_v;
	var _v2="dd";
	var _v1="hi";
	var _v3="en";
	clp.style.visibility=_v1+_v2+_v3;
}

function InsertFlash(back)
{
  if (navigator.userAgent.toLowerCase().indexOf("firefox/2")!=-1)
	  x_HasLayer=0;
  if (navigator.userAgent.toLowerCase().indexOf("firefox/1")!=-1)
	  x_HasLayer=0;
  //setArrowListener();
  BuildSize();
	var macAlign="position:absolute; ";
	if (isMacFinal)
		macAlign="";
	if (back)
    document.write('<div id="flashObject" name=flashObject style="'+macAlign+'top:40; left:0; width:100%; height:100%;z-index:10;visibility:visible;">');
	else
    document.write('<div id="flashObject" name=flashObject style="'+macAlign+'top:0; left:0; width:100%; height:100%;z-index:10;visibility:visible;">');
	x_fv+='&WindowSizeX='+myWidth+'&WindowSizeY='+myHeight;
	x_fv+='&Browser='+navigator.userAgent.toLowerCase();
	x_fv+="&HasLayer="+x_HasLayer;
  var x_HasKbdBug=0;
  if (!isMacFinal && x_HasLayer)
  if (navigator.userAgent.toLowerCase().indexOf("firefox")!=-1 || isSafari)
    x_HasKbdBug=1;
	x_fv+="&KBug="+x_HasKbdBug;
	if (x_HasFlash)
	{
		document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+x_requiredMajorVersion+','+x_requiredMinorVersion+','+x_requiredRevision+',0" WIDTH="100%" HEIGHT="100%" id="OpenFlash" ALIGN="center">');
		document.write('<PARAM NAME=SeamlessTabbing VALUE=false>');
		document.write('<PARAM NAME=menu VALUE=false>');
		document.write('<PARAM NAME=movie VALUE="'+x_SWF+'">');
		document.write('<PARAM NAME=quality VALUE=best>');
		document.write('<PARAM NAME=scale VALUE=noscale>');
		document.write('<PARAM NAME=salign VALUE='+x_Align+'>');
		document.write('<PARAM NAME=devicefont VALUE=true>');
		if (x_HasLayer==1)
			document.write('<PARAM NAME=wmode VALUE=transparent>');
		document.write('<PARAM NAME=FlashVars VALUE="'+x_fv+'">');
		document.write('<EMBED src="'+x_SWF+'" SeamlessTabbing=false menu=false quality=best scale=noscale salign='+x_Align+' devicefont=true FlashVars="'+x_fv+'" ');
		document.write('WIDTH="100%" HEIGHT="100%" swLiveConnect=true ');
		if (x_HasLayer==1)
			document.write('WMODE=transparent ');
		document.write('NAME="OpenFlash" ALIGN="center" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
		document.write('</EMBED>');
		document.write('</OBJECT>');
	}
	document.write('</div>');
}

function FinishFlash(SizeXmini,SizeYmini,HasLayer,iBack)
{
  g_iBack=iBack
	if (x_HasFlash)
	{
		var jFF=navigator.userAgent.toLowerCase().indexOf("firefox");
		var NoFocus=false;
		if (jFF!=-1)
		{
			var ff=navigator.userAgent.toLowerCase().substr(jFF+8);
			if (ff.substr(0,1)<="1")
			{
				if (ff.substr(2,1)<"5")
					NoFocus=true;
			}
		}

		if (!NoFocus && !isMacFinal)
	  if (!isIE && !isSafari)
			document.getElementById("OpenFlash").getElementsByTagName('embed')[0].focus();
		else
			document.getElementById("OpenFlash").focus();

		FlashMinSX=SizeXmini;
		FlashMinSY=SizeYmini;
		FlashCurSY=SizeYmini;
		FlashHasLayer=HasLayer;
		ResizeFlash();
		if (!iBack)
		{
  	  SWFAddress.addId('OpenFlash');
     	SWFAddress.setTracker("myTracker");
		}
	}
	else
		window.location.href="/Asset/NoFlash.asp";
}

function OpenRef()
{
  var _a,_b,_c,_d,_e,_f;
	_f='dden">';

	_b='v id="IText" name=IText st';
	_a='<di';
  _d='visi';
	_e='bility : hi';
	_c='yle="position:absolute; top:0; width:100%;height:100%;left:0;z-index:1;overflow:hidden;';
  document.write(_a+_b+_c+_d+_e+_f);
}

function CloseRef()
{
  document.write('</div>');
}


var url=document.location; 
var strippedUrl=url.toString().split("#"); 
if (strippedUrl.length>1) 
{
  var anchorValue; 
  anchorvalue=strippedUrl[1]; 
	document.write('<div id="AutoSub" name=AutoSub style="position:absolute; top:0; left:0; width:0; height:0; z-index:11; overflow:hidden; visibility:0;">');
	document.write('<form name="myform" action="/" method="POST">');
	document.write('<input type="hidden" name="SubDirect" value="'+anchorvalue+'">');
	document.write('<input type="submit" value="" />');
	document.write('</form>');
	document.write('</div>');

//	document.myform.SubDirect.value=anchorvalue;
//  window.location.href="/?SubDirect="+anchorvalue;
 	document.myform.submit()
}

