/*
// Initialize gEbBAd if necessary
if ((typeof(gEbBAd) == "undefined") || !gEbBAd)
    gEbBAd = new Object();

//Indicate we’re running with the new banners implementation (single script loaded).
gEbBAd.fSingleScriptBanner = true;

// Define the click remote servers (in gEbInteractions)
ebDefineClickRS();

var ebStrProtocol = ebPtcl;
var ebSmallS = ebStrProtocol + ebO.sms + "/ebServing.js";
var ebBS = ebO.bs;
var ebDataCapture = ebBS;

var ebFullPageVer = ebO.fpv;
var ebFullPageSkinVer = ebO.fpsv;
var ebReportPageVer = ebO.rpv;
var ebPositionVer = ebO.pv;
var ebConduitVer = "ebV54_";
var ebIntTimeVer = "V62_12";
var ebPluID = ebO.pi;

// Currently we don't support iframe
var gfEbInIframe = false;
var gEbfOfflineDemo = false;
var gEbFlyLocal = false;

// Streaming settings (for additional assets)
var ebWMVStreamingPrefix = "mms://a419.v12429d.c12429.g.vm.akamaistream.net/7/419/12429/v0001/";
var ebFLVStreamingSuffix = ".xml";		//the XML file suffix
var ebAKAMAIFCS = "rtmp://cp16207.edgefcs.net/ondemand";	//AKAMAI FCS (appURL)

var ebFLVStreamingPrefix = ebStrProtocol + "ds.serving-sys-dev.com/BurstingRes/FLVStreamXML/";		//the path to the XML files folder in the file server(an hardcoded URL is used for referring the PLUs to our ds)
var ebFCSVirtualPath = "Res/Dev/";			//AKAMAI FCS virtual path to the resources

gEbBAd.strRand = ebRand;
gEbBAd.nHistLen = ebO.hl;
gEbBAd.nFlightID = ebO.pli;
gEbBAd.nWidth = ebO.w;
gEbBAd.nHeight = ebO.h;
gEbBAd.nAdID = ebO.ai;
gEbBAd.nCampaignID = ebO.ci;

gEbBAd.strPage = ebO.p;
// We always have a page (can be "UnSpecified")
gEbBAd.fWebPageSource = 1;

gEbBAd.fOptOut = gEbFOptOut = ebO.oo ? ebO.oo : 0;
gEbBAd.fShowOnlyImage = ebO.soi ? ebO.soi : 0;
gEbBAd.strTemplateName = gEbTemplateName = ebO.tn;
gEbBAd.strAdUrl = ebO.au;

if (ebO.dlm)
    gEbBAd.nDownloadMode = ebO.dlm;

if (ebO.dmn)
    gstrEbDomain = ebO.dmn;

if (ebO.ifl)
    var gstrEbIframeLocation = ebO.ifl;

// OnPlay / OnStartDownload events    
if (ebO.osd)
    gEbBAd.strOnStartDnl = unescape(ebO.osd);
if (ebO.op)
    gEbBAd.strOnPlay = unescape(ebO.op);

// test tags
gEbBAd.fTest = ebO.t ? true : false;
     
var gEbDbgLvl = ebO.d;

var gEbnMaxTimerTime = 15 * 1000 * 60;	//the maximum time for timers

if (typeof(gnEbLowBWLimit) == "undefined")
	gnEbLowBWLimit = 120;

// MSN in dynamic iframe - gfEbMSNIframe should be true, gfEbInIframe should be false
if (typeof(inDapIF) != "undefined")
{
    gfEbMSNIframe = inDapIF;
    if (inDapIF)
        gfEbInIframe = false;
}           


// Add the click remote servers to the interactions list (gEbInteractions)
function ebDefineClickRS()
{
    var strNClickUrl = (typeof(ebO.ncu) != "undefined") ? ebO.ncu : "";
    var strAClickUrl = (typeof(gEbBAd.AClickUrl) != "undefined") ? gEbBAd.AClickUrl : "";

    // Make sure the URLs are escaped (we don't know if it's already escaped)
    strNClickUrl = escape(unescape(strNClickUrl));
    strAClickUrl = escape(unescape(strAClickUrl));

    if (strNClickUrl || strAClickUrl)
    {
        if (typeof(gEbInteractions) == "undefined")
            gEbInteractions = "";
        else
            gEbInteractions += "::";

        gEbInteractions += "[_eyeblaster,"+strNClickUrl+","+strAClickUrl+"]";
    }
}

function ebIsPreview()
{
    return ((typeof(gfEbPreview)!= "undefined") && gfEbPreview);
}

//***************************************************************************************************
//***********							BrowserCheck Class							*****************
//***************************************************************************************************
//=====================
//	ebCBrowserCheckProto	
//=====================
// This class handles the check of client platform and browser
// Here we decide if the client's platform is eyeblaster compatible or not
// Users should not make instance of this class !!! 
// The instances should be of ebCBrowserCheck
//===========================================
function ebCBrowserCheckProto()
{
	//==================
	// Static Parameters
	//==================
	var strAgt = "";

	//Browser
	var nMajor = 0;
	var nMinor = 0;
	var flNNVer = 0.0;
	var fIsIE = 0;
	var fIsNN = 0;
	var fIsFirefox = 0;
	var fIsSafari = 0;
	var flSafariVer = 0;
	var flIEVer = 0.0;
	var flFFVer = 0.0;
	var fIsAOL = 0;
	var fIsWin = 0;
	var nEbBrowser = 0;
	
	//Platform
	var fIsWin95 = 0;
	var fIsWin98 = 0;
	var fIsWinME = 0; 
    var fIsWinNT = 0;
    var fIsWin2K = 0;
    var fIsWinXP = 0;
	var fIsWin32 = 0;
	var fIsMac = 0;
	var fIsWinVista = 0;
	var nEbPlatform = 0;
	
	var fIsCompat = false;
	var fVideoCompat = false;
	var fPlatform = 0;
	var fBrowser = 0;
	
	//	Interface Functions
	this.init = init;
	this.isCompat = function() {return fIsCompat;};
	this.isVideoCompat = function() {return fVideoCompat;};
	this.getNNVer = function() {return flNNVer;};
	this.isIE = function() {return fIsIE;};
	this.getIEVer = function() {return flIEVer;};
	this.isFF = function() {return fIsFirefox;};
	this.getFFVer = function() {return flFFVer;};
	this.isSafari = function() {return fIsSafari;};
    this.isNN = function() {return fIsNN;};
	this.getSafariVer = function() {return flSafariVer;};
	this.isAOL = function () {return fIsAOL;};
	this.isWin95 = function() {return fIsWin95;};
	this.isWin98 = function() {return fIsWin98;};
	this.isWinME = function() {return fIsWinME;};
	this.isWinNT = function() {return fIsWinNT;};
	this.isWin2K = function() {return fIsWin2K;};
	this.isWinXP = function() {return fIsWinXP;};
	this.isWin32 = function() {return fIsWin32;};
	this.isMac = function() {return fIsMac;};
	this.isWinVista = function() {return fIsWinVista;};
	this.getEbPlatform = function() {return nEbPlatform;};
	this.getEbBrowser = function() {return nEbBrowser;};
	
	//	Public Functions
	function init()
	{	
		// Check if the class is already initialized	
		if (strAgt != "")
			return;

	    // convert all characters to lowercase to simplify testing
		strAgt=navigator.userAgent.toLowerCase();
	    
	    // *** BROWSER VERSION ***
		nMajor = parseInt(navigator.appVersion);
	    nMinor = parseFloat(navigator.appVersion);

		// Firefox detection
		var nIndex = strAgt.indexOf('firefox/');
		if (nIndex != -1)
		{
		    fIsFirefox = true;
			flFFVer = parseFloat(strAgt.substr(nIndex+8,3));
		}
		
		// Safari detection
		nIndex = strAgt.indexOf('safari/');
		if (nIndex != -1)
		{
			fIsSafari = true;
			flSafariVer = parseInt(strAgt.substr(nIndex+7,3));
		}
		
		// NN detection
		nIndex = strAgt.indexOf('netscape/');
		if (nIndex != -1)
		{
		    fIsNN = true;
			flNNVer = parseFloat(strAgt.substr(nIndex+9,3));
		}
	    				
	    fIsIE = ((strAgt.indexOf("msie") != -1) && (strAgt.indexOf("opera") == -1));
	    
	    if(fIsIE)
	    {
			var nEbMsieIndex = strAgt.indexOf("msie ");
			var strEbIeVer = strAgt.substring(nEbMsieIndex+5, strAgt.indexOf(";", nEbMsieIndex));
			flIEVer = parseFloat(strEbIeVer);
	    }
	    
		fIsAOL = (fIsIE && (strAgt.indexOf("aol")!=-1));
				
	    // *** PLATFORM ***
	    fIsWin = ( (strAgt.indexOf("win")!=-1) || (strAgt.indexOf("16bit")!=-1) );
	    // NOTE: On Opera 3.0, the userAgent string includes "Windows 95/NT4" on all
	    //        Win32, so you can't distinguish between Win95 and WinNT.
	    fIsWin95 = ((strAgt.indexOf("win95")!=-1) || (strAgt.indexOf("windows 95")!=-1));

	    // NOTE: Reliable detection of Win98 may not be possible. It appears that:
	    //       - On Nav 4.x and before you'll get plain "Windows" in userAgent.
	    //       - On Mercury client, the 32-bit version will return "Win98", but
	    //         the 16-bit version running on Win98 will still return "Win95".
	    fIsWin98 = ((strAgt.indexOf("win98")!=-1) || (strAgt.indexOf("windows 98")!=-1));
	    fIsWinME = (strAgt.indexOf("win 9x 4.90") != -1); 
	    fIsWinNT = (strAgt.indexOf("winnt")!=-1);
	    fIsWin2K = (strAgt.indexOf("windows nt")!=-1);
	    fIsWinXP = (strAgt.indexOf("windows nt 5.1")!=-1);
	    fIsWinVista = (strAgt.indexOf("windows nt 6.0")!=-1);
	    fIsWin32 = (fIsWin95 || fIsWinNT || fIsWin98 || 
	                    ((nMajor >= 4) && (navigator.platform == "Win32")) ||
	                    (strAgt.indexOf("win32")!=-1) || (strAgt.indexOf("32bit")!=-1));
	    fIsMac = (strAgt.indexOf("mac os x") != -1);
	
		var fIs_winnt = ((strAgt.indexOf("winnt")!=-1) || (strAgt.indexOf("windows nt")!=-1));
		var is_win2k = ((strAgt.indexOf("windows nt 5.0")!=-1) || (strAgt.indexOf("windows 2000")!=-1));
		var is_winxp = ((strAgt.indexOf("windows nt 5.1")!=-1) || (strAgt.indexOf("windows xp")!=-1)); // 020214 - dmr
	    var is_win2003 = (strAgt.indexOf("windows nt 5.2")!=-1);

		var fRealNT = (fIs_winnt && !is_win2k && !is_winxp && !is_win2003 && !fIsWinVista);
		
		 //the video does not support win95 and win NT.
		fIsVCompatPlatform = (fIsWin32 && !fIsWin95 && !fRealNT);
 

	    // Get ebPlatform
		///////////////////////////////////////////////////////////////////////////////////////
		///these are valid values for the Platform parameter:
		///	Win95:		1	(0x1)
		///	Win98:		2	(0x2)
		///	Win2000:	4	(0x4)
		///	WinXP:		8	(0x8)
		///	WinME:		16	(0x10)
		///	WinNT:		32	(0x20)
		/// Mac:        64  (0x40)     
		///	WinVista:	128 (0x80) 
		if(fIsWin95)
		   nEbPlatform = 1;
		if(fIsWin98)
		   nEbPlatform = 2;
		if(fIsWin2K)
		   nEbPlatform = 4;
		if(fIsWinXP)
		   nEbPlatform = 8;
		if(fIsWinME)
			nEbPlatform = 16;
		if(fIsWinNT)
		   nEbPlatform = 32;
		if(fIsMac)
		   nEbPlatform = 64;
		if(fIsWinVista)
		   nEbPlatform = 128;
		    
	    // Get ebBrowser
		///////////////////////////////////////////////////////////////////////////////////////
		///	IE 5.5:						2	(0x2)
		///	IE 6.0:						4	(0x4)
		/// IE 7.0                      2048
		///	NN 7.0:						32	(0x20)
		///	AOL (IE5.5):				128	(0x80)
		///	AOL (IE6.0):				256	(0x100)
		///	AOL (IE7.0):				2048*64
		/// Firefox (>1.0):		        512	(0x200)
		///////////////////////////////////////////////////////////////////////////////////////
		if(fIsIE)
		{
			if(flIEVer >= 5.5)
			{
				if (flIEVer < 6.0)		
					nEbBrowser = 2;		//IE 5.5
				else if(flIEVer == 6.0)
					nEbBrowser = 4;		//IE 6.0
				else
				    nEbBrowser = 2048;		//IE 7.0
			}
					
			if(fIsAOL)					//AOL is based on IE
				nEbBrowser *= 64;		//the values for AOL are as for IE multed by 64
		}

        // NN 7.x
		if ((flNNVer >= 7.0) && (flNNVer < 8.0))
			nEbBrowser = 32;
			
        // Firefox
		if(flFFVer >= 1.0)
			nEbBrowser = 512;
	    
		// We support Safari 1.3 and up in preview/offline demo/full page only
        var fSafariCompat = false;
        if (flSafariVer >= 312)
        {
            nEbBrowser = 1024;
            var fFullPage = ((typeof(gfEbFullPage) != "undefined") && gfEbFullPage);
            fSafariCompat = ((ebIsPreview() || gEbfOfflineDemo || fFullPage));
        }
    
		if (fIsWin32)
		{
			if ( (flIEVer >= 5.5) || (flNNVer >= 7.0 && flNNVer < 8.0) || (flFFVer >= 1) )
				fIsCompat = true;										
		}
		else if (fIsMac)
		{
		    // On Mac we support FireFox 1.0 and up, and PREVIEW on Safari 1.3 and up
		    if ( (flFFVer >= 1) || fSafariCompat)
				fIsCompat = true;										
		}
		
		if(fIsVCompatPlatform)
		{
			if(fIsIE && (flIEVer >= 5.0))
				fVideoCompat = true;
		}
	}
}


//==================
//	ebCBrowserCheck	
//==================
// This class handles the check of client platform and browser
// Here we decide if the client's platform is eyeblaster compatible or not
//===========================================
function ebCBrowserCheck()
{
	if (typeof(Object.prototype) == "undefined")
	{
		this.isCompat = function() {return false;};
		this.isVideoCompat = function() {return false;};
	}
	else
		this.init();
}

if (typeof(ebCBrowserCheck.prototype) != "undefined")
	ebCBrowserCheck.prototype = new ebCBrowserCheckProto();

// Create a global ebCBrowserCheck object
gEbBC = new ebCBrowserCheck();
//function ebSetCookie
//	this function update the users cookie with a given value. 
//Parameters:
//	name	:	String - the name of the cookie to update.
//	val		:	String - the value for the cookie.
//  fSessionCookie : (Optional) Boolean - Indicates if the cookie per session. Default is false
function ebSetCookie(name,val,fSessionCookie)
{
	//do not write cookies to opt out users.
	
	// Banner
	if(typeof(gEbFOptOut) != "undefined" && gEbFOptOut)
		return;
		
	// OOB
    if (typeof(gEbClientInfo) != "undefined" && gEbClientInfo.cookieInfo.fOptOut)
        return;
		
	if (typeof(fSessionCookie) == "undefined")
		fSessionCookie = false;
        
	var strDomain=".";
	if(typeof(gstrEbDomain) != "undefined" && (gstrEbDomain != ""))
		strDomain += gstrEbDomain;
	else
		try
		{
			strDomain = "." + document.location.hostname;	
		}
		catch(e)
		{
			// for AOL in IFrame, document.location is not a URL, but something like
			// "javascript:parent.func(z)". In Mozilla evaluating document.location.hostname
			// throws an exception.
			strDomain = "";
		}
	
	var strCookie = name + '_' + strDomain + '=' + escape(val);
	
	// Session cookies don't have an expiration date
	if (!fSessionCookie)
	{
		var dtExpires = new Date();
		dtExpires.setTime(dtExpires.getTime() + 1000*60*60*24*365);	
		strCookie += ";expires=" + dtExpires.toGMTString();
	}
	
	strCookie += "; path=/";
	
	//if the domain is valid add it to the cookie attributes.
	//if it is not valid domain - if we add this attribute the cookie will not be updated.
	if(ebIsValidDomain(strDomain))
		strCookie += "; domain=" + strDomain;
	
	gEbDbg.info("Setting client cookie. Cookie name: " + name + " Value: " + escape(val) + " Domain: " + strDomain);
	document.cookie = strCookie;
}

//function ebIsValidDomain
//	this function checks if a given domain is a valid one. 
//Parameters:
//	strDomain	:	String - the domain to check.
function ebIsValidDomain(strDomain)
{
	if((strDomain != null)&&(strDomain != 'undefined'))
	{
		var domainParts = strDomain.split(".");
		
		//the domain parameter starts with "." therefore we get 4 elements
		//from spliting the next domain: .yahoo.com
		if(domainParts.length < 3)
			return false;
		else
			return true;
	}
	else
		return false;
}

//	=========================
//	ebReadCookie()
//	=========================
//	This function reads a specific eyeblaster cookie
function ebReadCookie(name)
{
	var strDomain=".";
	if(typeof(gstrEbDomain) != "undefined" && (gstrEbDomain != ""))
		strDomain += gstrEbDomain;
	else
	{
		// for AOL in IFrame, document.location is not a URL, but something like
		// "javascript:parent.func(z)". In Mozilla evaluating document.location.hostname
		// throws an exception. Since we can't put try-catch in this file, we'll use eval.
		eval('try{strDomain = "." + document.location.hostname;}catch(e){strDomain = "";}');
	}
		
	var cookie = document.cookie;
		
	//set the cookie name with the cookies name prefix.
	name += '_' + strDomain;

	//search for the specific cookie
	var start = cookie.indexOf(name + "=");
		
	//cookie does not exist
	if (start == -1)
		return("");
			
	//move to the value part (name=value)
	start += name.length + 1;
		
	//find the end of that specific cookie
	var end = cookie.indexOf(';',start);
		
	//the cookie continues till the end of the strGCookie
	if (end == -1)
		end = cookie.length;
		
	//return the cookie value	
	var cookieVal = cookie.substring(start,end);
	return(unescape(cookieVal));
}

//***************************************************************************************************
//***********							Constant Code								*****************
//***************************************************************************************************
//***************************************************************************************
//	ebCDebug	
//***************************************************************************************
//	this object is a utility object that handles writing all the debug messages
//Functions
//	print	:	write a debug message into the debug window for users with debug level >= lvl.
function ebCDebug(lvl)
{
	if (typeof(lvl) == "undefined")
		lvl = 0;
	
	//static parameters:
	var browser = new ebCBrowserCheck();
		
	//===============
	//	Attributes
	//===============
	this.objWindow = null; 
	this.nLevel = lvl;
	//init(this);
	
	//======================
	//	Interface Functions
	//======================
	this.setDbgLvl = setDbgLvl;
	this.debug2 = debug2;
	this.debug = debug;
	this.info = info;
	this.attention = attention;
	this.warning = warning;
	this.error = error;
	this.fatal = fatal;
	this.always = always;
	this.delimiter = delimiter;
	//======================
	//	Public Functions
	//======================
	function setDbgLvl(lvl)
	{
		if (typeof(lvl) == "undefined")
			return;
		if (this.nLevel == lvl)
			return;
			
		// Set the debug level and update the cookie
		this.nLevel = lvl;
		this.attention("Changing debug level to " + lvl);
		if(typeof(gEbClientInfo) != "undefined")
			gEbClientInfo.cookieInfo.setDbgLvl(lvl);
		else if (typeof(ebSetCookie) == "function") //Defined for banners in ebBannerServing.js
			ebSetCookie("DebugLevel",lvl);
	}
	
	function debug2(msg)
	{
		writeLine(this,msg,"#cccccc",6);
	}
	function debug(msg)
	{
		writeLine(this,msg,"#ccaccc",5);
	}
	function info(msg)
	{
		writeLine(this,msg,"#777777",4);
	}
	function attention(msg)
	{
		writeLine(this,msg,"black",3);
	}
	function warning(msg)
	{
		writeLine(this,msg,"red",2);
	}
	function error(msg)
	{
		writeLine(this,msg,"black",1,"#ffff00");
	}
	function fatal(msg)
	{
		writeLine(this,msg,"black",1,"#ff0000");
	}
	function always(msg)
	{
		writeLine(this,msg,"blue",1);
	}

	function delimiter(msg,minLvl)
	{
		if(typeof(minLvl) == "undefined")
			minLvl = 6;
		writeLine(this,msg,"green",minLvl);
	}
	
	//======================
	//	Private Functions
	//======================
	function init(objRef)
	{
		try{
			if ((typeof(gEbBannerDbgWin) != "undefined") && !gEbBannerDbgWin.closed)
				objRef.objWindow = gEbBannerDbgWin;
			else if (typeof(gEbAdWindow) != "undefined")
				objRef.objWindow = window.open("", "WinAdDebug"); 
			else if (typeof(gfEbOnIframe) != "undefined")
				objRef.objWindow = window.open("", "OOBInIframeDebug"); 
			else
				objRef.objWindow = window.open("", "EyeblasterDebug"); 
		
			if (!browser.isAOL())
				objRef.objWindow.blur();
			
			if (objRef.objWindow.document.title == "")
			{
				objRef.objWindow.document.open("text/html","aaa");
				objRef.objWindow.document.write("<HTML><HEAD><TITLE>" + objRef.objWindow.name + "</TITLE></HEAD><BODY><FONT face='Times New Roman (Hebrew)' size=2>");
				objRef.objWindow.document.writeln("<BR><BR>");
			}
		}catch(e)
		{
		}
	}
	
	//	writeLine()
	//	===========
	//	This funcion writes a debug line on the debug window
	function writeLine(objRef,msg,color,minLvl,bgColor)
	{
		try{
			if(typeof(bgColor) == 'undefined')
			{
				if (typeof(gEbAdWindow) != "undefined")
					bgColor = "#ffffcc";
				else
					bgColor = "#ffffff";
			}
	
			
			if(objRef.nLevel < minLvl)
				return;
				
			if((objRef.objWindow == null) || objRef.objWindow.closed)	
				init(objRef);
		
			msg = msg.replace(/ /g,"&nbsp;");
			var line = "<FONT color=" + color + " style='BACKGROUND-COLOR: " + bgColor + "'>";
				line = line + msg + "</FONT><BR>";
				objRef.objWindow.document.writeln(line);
				
			//objRef.objWindow.scroll(0,objRef.objWindow.document.body.scrollHeight);
		}catch(e)
		{
		}
	}
}


//***************************************************************************************
//	ebCTIObj	
//***************************************************************************************
//this is a utility object used in the TagInsertor class functions.
function ebCTIObj(name)
{
	this.id = "";
	this.name = "";
	this.src = "";
	this.play = true;
	this.width = "0";
	this.height = "0";
	this.wmode = "transparent";
	this.version = 4.0;
	this.style = new Object();
	//for object (DIV/Flash etc)
	this.style.border = 0;		// border should be 0 by default [to avoid override by the page css(bug 5344)] 
	this.style.margin = 0;		// margin should be 0 by default [to avoid override by the page css(bug 5344)]  
	this.style.padding = 0;		// padding should be 0 by default [to avoid override by the page css(bug 5344)]  
	this.style.textAlign = "left";  //text-align should be "left" by default [to avoid override by the page css]
	this.onclick = "";
	this.onload = "";			//for images
	this.refElement = null;	
	this.bgColor = "";
	this.frameborder = 0;		//used in the add iframe method
	this.adId = "";
	//for image
	this.border = 0;		// border should be 0 by default [to avoid override by the page css(bug 5344)]  
	this.margin = 0;		// margin should be 0 by default [to avoid override by the page css(bug 5344)]  
	this.padding = 0;		// padding should be 0 by default [to avoid override by the page css(bug 5344)]  
	this.strAdditionalRes = "";
	this.className = "";
	this.dir = "";
	//for containers
	this.containerStyle = new Object();
	this.containerStyle.border = "0px";		// border should be 0 by default [to avoid override by the page css(bug 5344)]  
	this.containerStyle.margin = "0px";		// margin should be 0 by default [to avoid override by the page css(bug 5344)] 
	this.containerStyle.padding = "0px";	// padding should be 0 by default [to avoid override by the page css(bug 5344)] 
	this.containerStyle.textAlign = "left"; //text-align should be "left" by default [to avoid override by the page css] 

	this.fWindowlessVideo = true;	//used for addWMP
	this.scale = "";				//for Flash objects - allow to ignore proportions.
	
	this.flashVars = "";            //FlashVars (supported for flash >= 6)
	
	if (typeof(name) != "undefined")
	{
		this.id = name;
		this.name = name;
	}
	
	this.print = printTIObj;
	
	function printTIObj()
	{
		var str = "ebCTIObj: <br>" +
			"id: " + this.id + "<br>" +
			" name: " + this.name +"<br>" +
			" src: " + this.src +"<br>" +
			
			" play: " + this.play + "<br>" +
			" width: " + this.width +"<br>" +
			" height: " + this.height +"<br>" +
			
			" wmode: " + this.wmode + "<br>" +
			" version: " + this.version +"<br>" +
			" style: " + this.style +"<br>" +
			
			" onclick: " + this.onclick + "<br>" +
			" onload: " + this.onload +"<br>" +
			" refElement: " + this.refElement +"<br>" +		
			" bgColor: " + this.bgColor;	
	
		gEbDbg.attention(str);
	}
}

//***************************************************************************************
//	ebCEventHandlerInfo	
//***************************************************************************************
// hold the information of a specific event handler which we attached.
// this will be used to later on remove the handlers
function ebCEventHandlerInfo(element, eventName, eventHandler)
{
    this.element = element; // the element to which the event is attached
    this.eventName = eventName;
    this.eventHandler = eventHandler;
}


//***************************************************************************************
//	ebCTagInsertor	
//***************************************************************************************
//this is a utility object that handles the insertions of all tags and objects into the page
//constructor parameters
//	doc - the document we insert the tags/objects into.
function ebCTagInsertor(win)
{
	if (typeof(win) == "undefined")
		win = self;
		
	//static parameters:
	var browser = new ebCBrowserCheck();
    var registeredEvents = new Array(); // will hold all name and functions of registered events
	
	//	==========
	//	attributes
	//	==========
	this.tagsContainer = null;
	this.win = win;
	
	//	====================
	//	Interface Functions
	//	====================
	this.write = write;
	this.addFlash = addFlash;
	this.addWMP = addWMP;
	this.addREAL = addREAL;
	this.addScript = addScript;
	this.addImage = addImage2;
	this.addDiv = addDiv;
	this.addInLineScript = addInLineScript;
	
//	this.appendScriptFor = appendScriptFor;
	this.addEventHandler = addEventHandler;
	this.clearAllEvents = clearAllEvents;
	this.addFsCommandHandler = addFsCommandHandler;
	this.addIframe = addIframe;
	this.addRelativeObject = addRelativeObject;
	this.addTable = addTable;
	
	this.setTagsContainer = setTagsContainer;
	this.addEyeDiv = addEyeDiv;
	this.adjustEyeDivPos = adjustEyeDivPos;
	this.calcClientAreaWidthMozilla = calcClientAreaWidthMozilla;
	this.getCurrentStyleAttr = getCurrentStyleAttr;
	this.getWin = getWin;
	this.getDoc = getDoc;
	this.getPanelsContainer = getPanelsContainer;
	
	//	====================
	//	Public Functions
	//	====================
	
	function addEyeDiv()
	{            
	    try{
	        var currentDoc = this.getDoc();
			        
			//check if the eyediv already exists.
			var divEl = this.getPanelsContainer();
			if(divEl == null)
			{          
				if(currentDoc.body == null)
				{
					gEbDbg.warning("addEyeDiv: No body is found - can't add the eyeDiv");
					return;
				}
							
				//eyeDivRefEl is the element the eyediv should be inserted before.
				//the default is the first child of the body.
				//this is apatch as a result of a req 604 where the eyediv break a line.
				//check if "secret tag" exist
				var eyeDivRefEl = null;
				if(typeof(gEbEyeDivRefElement) != "undefined")
				{
					gEbDbg.attention("addEyeDiv: add the eyeDiv before " + gEbEyeDivRefElement + " element");
					eyeDivRefEl = currentDoc.getElementById(gEbEyeDivRefElement);
					
					if(eyeDivRefEl == null)
					{
						eyeDivRefEl = currentDoc.body.firstChild;
						gEbDbg.warning("addEyeDiv: Reference element " + gEbEyeDivRefElement + " can not be found on the page. The eyeDiv will be added as the first child of the body.");
					}
				}
				else
				{
					eyeDivRefEl = currentDoc.body.firstChild;
				}
		
				var divAttr = new ebCTIObj("eyeDiv");
				divAttr.style.position = "absolute";
				divAttr.style.zIndex = gnEbMinZIndex;
				divAttr.style.top = 0;
				divAttr.style.left = 0;

				gEbDbg.debug("addEyeDiv: zIndex = " + gnEbMinZIndex);
				
				divAttr.dir = "ltr";
				divAttr.refElement = eyeDivRefEl;
					
				divEl = this.addDiv("before",divAttr);
				
				gEbDbg.info("eyeDiv was added to the page");
			}
			else
				gEbDbg.info("eyeDiv already exists on the page");
			        
			// Adjust the eyeDiv's position in case the body's real position is not
			// (0,0). Anyway, we want the eyeDiv to be at (0,0) of the client area.
			this.adjustEyeDivPos();

			return divEl;
			
		}catch(e)
		{
			gEbDbg.error("Exception in ebCTagInsertor.addEyeDiv: " + e.description);
		}
		
	}
	
	// This function gets a current value of a style attribute in an object, both for IE and Mozilla.
	// Parameters:
	//	elem - Element to inspect
	//	attr - Name of attribute to query
	function getCurrentStyleAttr(elem, attr)
	{
		var AttrVal = null;
		if (browser.isIE())
			AttrVal = elem.currentStyle[attr];
		else
		{
            // In Safari, attributes of EMBED inside OBJECT are not accessible
            // (e.g. offsetWidth, getComputedStyle() etc.) so we work
            // on the containing OBJECT element.
            if (gEbBC.isSafari() && (elem.tagName.toLowerCase() == "embed") && 
                elem.parentNode && (elem.parentNode.tagName.toLowerCase() == "object"))
            {
                // Get the containing OBJECT element 
                elem = elem.parentNode;
            }
		    
			AttrVal = this.getDoc().defaultView.getComputedStyle(elem, null).getPropertyValue(attr);
		}
		
		return AttrVal;
	}
	
	// This function repositions the eyeDiv according to the body's real position.
	// If the body is not at (0,0) with non-static position, the eyeDiv's position 
	// should change accordingly so its absolute position is at (0,0).
	function adjustEyeDivPos()
	{
		try{
			var panelsContainer = this.getPanelsContainer();
			var containerPos = this.getCurrentStyleAttr(panelsContainer.parentNode, "position");
			
			var fAOLPage = ((typeof(gfEbAOL) != "undefined") && gfEbAOL);
			if (fAOLPage && (containerPos != "static"))
			{
				var nRealTop = ebGetRealTop(panelsContainer);
				var nNewTop = parseInt(panelsContainer.style.top) - nRealTop;
				var nRealLeft = ebGetRealLeft(panelsContainer);
				var nNewLeft = parseInt(panelsContainer.style.left) - nRealLeft;
				
				panelsContainer.style.top = nNewTop + "px";
				panelsContainer.style.left = nNewLeft + "px";
			}
		} catch(e) {
			gEbDbg.error("adjustEyeDivPos: could not find eyeDiv");
		}
	}
	
	// This function calculates and returns the client area width for Mozilla browsers.
	function calcClientAreaWidthMozilla()
	{
		try{
			if(browser.isFF())
				nScroll = 19;
			else
				nScroll = 16;

			var win = this.getWin();
			var doc = win.document;
			
			var nHeight = win.innerHeight;
			if (doc.width > win.innerWidth) // has horizontal scrollbar
				nHeight -= nScroll;

			var nWidth = win.innerWidth;
			if (doc.height > win.innerHeight) // has vertical scrollbar
				nWidth -= nScroll;

			return nWidth;
		}catch(e)
		{
			gEbDbg.error("ebCClientArea.calcClientAreaWidthMozilla: "+e.description);
		}
	}
	
	//	addFlash()

*/




var thisEbFileSize = 30;

var ebBWEndTimeDate = new Date();
//document.write("end time: " + ebBWEndTimeDate.getTime());
var ebTimeBWDifferenceSecs = ((ebBWEndTimeDate.getTime() - ebBWStartTimeDate.getTime())-100)/1000;
var ebJSBandwidth = parseInt(thisEbFileSize  / ebTimeBWDifferenceSecs * 8);
//document.write("<br>BW detection file size: " + thisEbFileSize);
//document.write("<br>num of secs: " + ebTimeBWDifferenceSecs);
//document.write("<br>approx bw: " + ebJSBandwidth);


//document.write('<script src="http://bs.serving-sys.com/BurstingPipe/adServer.bs?cn=rb&c=22&pli=268010&pi=0&ai=548115&t=1&w=300&h=250&BWVal='+ebJSBandwidth+'&BWDate='+ebBWEndTimeDate+'&ncu=$$%c$$&ord=%n"></script>');
