﻿var BrowserDetect = { init: function() { this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "an unknown version"; this.OS = this.searchString(this.dataOS) || "an unknown OS"; }, searchString: function(data) { for (var i = 0; i < data.length; i++) { var dataString = data[i].string; var dataProp = data[i].prop; this.versionSearchString = data[i].versionSearch || data[i].identity; if (dataString) { if (dataString.indexOf(data[i].subString) != -1) return data[i].identity; } else if (dataProp) return data[i].identity; } }, searchVersion: function(dataString) { var index = dataString.indexOf(this.versionSearchString); if (index == -1) return; return parseFloat(dataString.substring(index + this.versionSearchString.length + 1)); }, dataBrowser: [{ string: navigator.userAgent, subString: "OmniWeb", versionSearch: "OmniWeb/", identity: "OmniWeb" }, { string: navigator.vendor, subString: "Apple", identity: "Safari" }, { prop: window.opera, identity: "Opera" }, { string: navigator.vendor, subString: "iCab", identity: "iCab" }, { string: navigator.vendor, subString: "KDE", identity: "Konqueror" }, { string: navigator.userAgent, subString: "Firefox", identity: "Firefox" }, { string: navigator.vendor, subString: "Camino", identity: "Camino" }, { string: navigator.userAgent, subString: "Netscape", identity: "Netscape" }, { string: navigator.userAgent, subString: "MSIE", identity: "Explorer", versionSearch: "MSIE" }, { string: navigator.userAgent, subString: "Gecko", identity: "Mozilla", versionSearch: "rv" }, { string: navigator.userAgent, subString: "Mozilla", identity: "Netscape", versionSearch: "Mozilla"}], dataOS: [{ string: navigator.platform, subString: "Win", identity: "Windows" }, { string: navigator.platform, subString: "Mac", identity: "Mac" }, { string: navigator.platform, subString: "Linux", identity: "Linux"}] }; BrowserDetect.init();


// Comscore code
if (typeof COMSCORE == "undefined") { var COMSCORE = {} } COMSCORE.beacon = function(d) { if (!d) { return } var a = 1.6, e = document, g = e.location, c = function(h) { if (h == null) { return "" } return (encodeURIComponent || escape)(h) }, f = [(g.protocol == "https:" ? "https://sb" : "http://b"), ".scorecardresearch.com/b?", "c1=", c(d.c1), "&c2=", c(d.c2), "&rn=", Math.random(), "&c7=", c(g.href), "&c3=", c(d.c3), "&c4=", c(d.c4), "&c5=", c(d.c5), "&c6=", c(d.c6), "&c15=", c(d.c15), "&c16=", c(d.c16), "&c8=", c(e.title), "&c9=", c(e.referrer), "&cv=", a].join(""); f = f.length > 1500 ? f.substr(0, 1495) + "&ct=1" : f; var b = new Image(); b.onload = function() { }; b.src = f; return f };

/*********************************************
/* New LiteBOx
/*********************************************/

//function getPageScroll(){var yScroll;if(self.pageYOffset){yScroll=self.pageYOffset;}else if(document.documentElement&&document.documentElement.scrollTop){yScroll=document.documentElement.scrollTop;}else if(document.body){yScroll=document.body.scrollTop;};arrayPageScroll=new Array('',yScroll);return arrayPageScroll;};function getPageSize(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=document.body.scrollWidth;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;};var windowWidth,windowHeight;if(self.innerHeight){windowWidth=self.innerWidth;windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;};if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;};if(xScroll<windowWidth){pageWidth=windowWidth;}else{pageWidth=xScroll;};arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight);return arrayPageSize;};function Fivemin_LiteBox(){/*@cc_on/*@if(@_jscript)this.ie=(document.all&&!window.opera)?true:false;/*@else @*/this.ie=false;/*@end@*/this.ie7=(this.ie&&window.XMLHttpRequest);this.initialize();};Fivemin_LiteBox.prototype.initialize=function(){var objBody=document.getElementsByTagName("body").item(0);if(document.getElementById('lbOverlay')){objBody.removeChild(document.getElementById("lbOverlay"));objBody.removeChild(document.getElementById("lbMain"));};var objOverlay=document.createElement("div");objOverlay.setAttribute('id','lbOverlay');objOverlay.setAttribute((this.ie?'className':'class'),'black_overlay');objOverlay.style.display='none';objBody.appendChild(objOverlay);var objLitebox=document.createElement("div");objLitebox.setAttribute('id','lbMain');objLitebox.setAttribute((this.ie?'className':'class'),'white_content');objLitebox.style.display='none';var objHeaderContainer=document.createElement('div');objHeaderContainer.setAttribute('id','lbHeaderContainer');objHeaderContainer.setAttribute((this.ie?'className':'class'),'header');var objHeaderTitle=document.createElement('div');objHeaderTitle.setAttribute('id','lbHeaderTitle');objHeaderTitle.setAttribute((this.ie?'className':'class'),'headerTitle');var objHeaderClose=document.createElement('div');objHeaderClose.setAttribute('id','lbHeaderClose');var objCloseLink=document.createElement('a');objCloseLink.setAttribute('id','fivemin_lbHrefClose');objCloseLink.setAttribute((this.ie?'className':'class'),'link_close');objCloseLink.innerHTML='CLOSE';if(window.addEventListener){objHeaderClose.addEventListener('click',closeLiteBox,false);objOverlay.addEventListener('click',closeLiteBox,false);}else if(window.attachEvent){objHeaderClose.attachEvent("onclick",closeLiteBox);objOverlay.attachEvent("onclick",closeLiteBox);};objHeaderClose.appendChild(objCloseLink);objHeaderContainer.appendChild(objHeaderTitle);objHeaderContainer.appendChild(objHeaderClose);objLitebox.appendChild(objHeaderContainer);var objIframeContainer=document.createElement("div");objIframeContainer.setAttribute('id','lbIframeContainer');objLitebox.appendChild(objIframeContainer);objBody.appendChild(objLitebox);};function closeLiteBox(){var objBody=document.getElementsByTagName("body").item(0);if(document.getElementById('lbOverlay')){document.getElementById("lbMain").style.display='none';objBody.removeChild(document.getElementById("lbOverlay"));objBody.removeChild(document.getElementById("lbMain"));fivemin_initLitebox();}};function fivemin_initLitebox(){myLitebox=new Fivemin_LiteBox();};function lb(width,height,htmlCode,htmlTitle){var arrayPageSize=getPageSize();var arrayPageScroll=getPageScroll();var objOverlay=document.getElementById('lbOverlay');objOverlay.style.height=(arrayPageSize[1]+'px');objOverlay.style.display='block';objOverlay.style.zIndex=99999998;var objLitebox=document.getElementById('lbMain');objLitebox.style.top=(arrayPageScroll[1]+((arrayPageSize[3]-35-height)/2)+'px');objLitebox.style.left=(((arrayPageSize[0]-20-width)/2)+'px');objLitebox.style.height=height+"px";objLitebox.style.width=width+"px";objLitebox.style.zIndex=99999999;var objLiteBoxHeader=document.getElementById('lbHeaderTitle');objLiteBoxHeader.innerHTML=htmlTitle;var objIframe=document.getElementById('lbIframeContainer');objIframe.innerHTML=htmlCode;objIframe.style.height=height+"px";objIframe.style.width=width+"px";objLitebox.style.display='block';}

/*********************************************
/* New LiteBox
/*********************************************/

//
// getPageScroll()
// Returns array with x,y page scroll values.
// Core code from - quirksmode.org
//
function getPageScroll() {

	var yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop) {	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
	}

	arrayPageScroll = new Array('', yScroll);
	return arrayPageScroll;
}


//
// getPageSize()
// Returns array with page width, height and window width, height
// Core code from - quirksmode.org
// Edit for Firefox by pHaez
//
function getPageSize() {

	var xScroll, yScroll;

	if (window.innerHeight && window.scrollMaxY) {
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight) { // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}

	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}

	// for small pages with total height less then height of the viewport
	if (yScroll < windowHeight) {
		pageHeight = windowHeight;
	} else {
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if (xScroll < windowWidth) {
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth, pageHeight, windowWidth, windowHeight);
	return arrayPageSize;
}



function Fivemin_LiteBox() {
	/*@cc_on
	/*@if (@_jscript)
	this.ie = (document.all && !window.opera) ? true : false;
	/*@else @*/
			this.ie = false;
		/*@end
	@*/
	this.ie7 = (this.ie && window.XMLHttpRequest);
	this.ie8 = (BrowserDetect.browser == "Explorer" && BrowserDetect.version == "8");
	this.initialize();


}

Fivemin_LiteBox.prototype.initialize = function() {

	var objBody = document.getElementsByTagName("body").item(0);
	if (document.getElementById('lbOverlay')) {
		objBody.removeChild(document.getElementById("lbOverlay"));
		objBody.removeChild(document.getElementById("lbMain"));
	}
	var objOverlay = document.createElement("div");
	objOverlay.setAttribute('id', 'lbOverlay');
	objOverlay.setAttribute(((this.ie && !this.ie8) ? 'className' : 'class'), 'fivemin_black_overlay');
	//		objOverlay.setAttribute((this.ie ? 'className' : 'class'), this.theme);
	//		if ((this.ie && !this.ie7) || (this.ie7 && this.doc.compatMode == 'BackCompat')) {
	//			objOverlay.style.position = 'absolute';
	//		}

	objOverlay.style.display = 'none';
	objBody.appendChild(objOverlay);
	var objLitebox = document.createElement("div");
	objLitebox.setAttribute('id', 'lbMain');
	objLitebox.setAttribute(((this.ie && !this.ie8) ? 'className' : 'class'), 'fivemin_white_content');
	objLitebox.style.display = 'none';

	var objHeaderContainer = document.createElement('div');
	objHeaderContainer.setAttribute('id', 'lbHeaderContainer');
	objHeaderContainer.setAttribute(((this.ie && !this.ie8) ? 'className' : 'class'), 'fivemin_header');

	var objHeaderTitle = document.createElement('div');
	objHeaderTitle.setAttribute('id', 'fivemin_lbHeaderTitle');
	objHeaderTitle.setAttribute(((this.ie && !this.ie8) ? 'className' : 'class'), 'fivemin_headerTitle');

	var objHeaderClose = document.createElement('div');
	objHeaderClose.setAttribute('id', 'fivemin_lbHeaderClose');

	var objCloseLink = document.createElement('a');
	objCloseLink.setAttribute('id', 'fivemin_lbHrefClose');
	objCloseLink.setAttribute(((this.ie && !this.ie8) ? 'className' : 'class'), 'fivemin_link_close');
	objCloseLink.innerHTML = 'CLOSE';

	if (window.addEventListener) {
		objHeaderClose.addEventListener('click', closeLiteBox, false);
		objOverlay.addEventListener('click', closeLiteBox, false);
	} else if (window.attachEvent) {
		objHeaderClose.attachEvent("onclick", closeLiteBox);
		objOverlay.attachEvent("onclick", closeLiteBox);
	}

	objHeaderClose.appendChild(objCloseLink);

	objHeaderContainer.appendChild(objHeaderTitle);
	objHeaderContainer.appendChild(objHeaderClose);

	objLitebox.appendChild(objHeaderContainer);


	var objIframe = document.createElement("iframe");
	objIframe.setAttribute('id', 'fivemin_hider-iframe');
	objIframe.setAttribute('frameborder', '0');
	objIframe.setAttribute('scrolling', 'no');
	objIframe.style.top = 0;
	objIframe.style.left = 0;
	//objIframe.style.display = 'none';


	//    var objIframe = "<iframe id='fivemin_hider-iframe' frameborder='0' scrolling='0'></iframe>";
	//    <iframe id="fivemin_hider-iframe" style="display:none" frameborder="0" scrolling="no"></iframe>


	var objIframeContainer = document.createElement("div");
	objIframeContainer.setAttribute('id', 'fivemin_lbIframeContainer');
	//	objIframeContainer.innerHTML = objIframe;
	//objIframeContainer.appendChild(objIframe);


	objLitebox.appendChild(objIframeContainer);

	if (this.ie && (!this.ie7) && (!this.ie8)) {
		if (document.body && document.body.clientHeight) { // Explorer 6 Strict Mode
			objBody.appendChild(objIframe);
		}
	}
	objBody.appendChild(objLitebox);

}

function closeLiteBox() {
	var objBody = document.getElementsByTagName("body").item(0);

	if (document.getElementById("fivemin_hider-iframe"))
		objBody.removeChild(document.getElementById("fivemin_hider-iframe"));

	if (document.getElementById('lbOverlay')) {
		document.getElementById("lbMain").style.display = 'none';
		objBody.removeChild(document.getElementById("lbOverlay"));
		objBody.removeChild(document.getElementById("lbMain"));
		fivemin_initLitebox();
	}
}

function fivemin_initLitebox() { myLitebox = new Fivemin_LiteBox(); }


function lb(width, height, htmlCode, htmlTitle) {
	var arrayPageSize = getPageSize();
	var arrayPageScroll = getPageScroll();

	//objLoadingImage.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 35 - objLoadingImage.height) / 2) + 'px');

	var objOverlay = document.getElementById('lbOverlay');
	objOverlay.style.height = (arrayPageSize[1] + 'px');
	objOverlay.style.display = 'block';
	objOverlay.style.zIndex = 99999998;

	var objLitebox = document.getElementById('lbMain');
	objLitebox.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 35 - height) / 2) + 'px');
	objLitebox.style.left = (((arrayPageSize[0] - 20 - width) / 2) + 'px');
	objLitebox.style.height = height + "px";
	objLitebox.style.width = width + "px";
	objLitebox.style.zIndex = 99999999;

	if (document.getElementById("fivemin_hider-iframe")) // For IE6
	{
		var objIframe = document.getElementById("fivemin_hider-iframe");
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
		objIframe.style.width = windowWidth + "px";
		objIframe.style.height = windowHeight + "px";
		objIframe.style.zIndex = 99999997;
	}




	var objLiteBoxHeader = document.getElementById('fivemin_lbHeaderTitle');
	objLiteBoxHeader.innerHTML = htmlTitle;

	var objIframe = document.getElementById('fivemin_lbIframeContainer');
	objIframe.innerHTML = htmlCode;
	objIframe.style.height = height + "px";
	objIframe.style.width = width + "px";
	//    //objIframe.style.border = 0;
	//    objIframe.setAttribute('frameborder', '0');
	//    objIframe.setAttribute('scrolling', 'no');
	//    objIframe.setAttribute('src', url);
	objLitebox.style.display = 'block';



}


// function that return params from Querystring
function getQuerystring(key, default_) {
	if (default_ == null) default_ = "";
	key = key.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
	var regex = new RegExp("[\\?&]" + key + "=([^&#]*)");
	var qs = regex.exec(window.location.href);
	if (qs == null)
		return default_;
	else
		return qs[1];
}

/***************************************************************************************************
/*     encode ZONE
/***************************************************************************************************/

function encode(string) {
	return string.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;').replace('\'', '&apos;').replace('"', '&quot;');
}


/***************************************************************************************************
/*     jsonp ZONE
/***************************************************************************************************/


function fivemin_jsonp(url, name, query) {

	if (url.indexOf("?") > -1)
		url += "&callback="
	else
		url += "?callback="
	url += name + "&";
	if (query)
		url += encodeURIComponent(query) + "&";
	url += new Date().getTime().toString(); // prevent caching        

	var script = document.createElement("script");
	script.setAttribute("src", url);
	script.setAttribute("type", "text/javascript");
	document.getElementsByTagName('head')[0].appendChild(script);
}

/***************************************************************************************************
/*     ThumbSeed ZONE
/***************************************************************************************************/

// Global variables
var vsThumbSeed = new Array();
var cbfunc = new Array();
var thumbSeedCounter = 0;
var fivMin_synUrl = 'http://syn.5min.com';
var fivMin_shared = 'http://pshared.5min.com';


if (getQuerystring("test", "") == "localhost") {
	fivMin_synUrl = 'http://localhost/syn';
	fivMin_shared = 'http://localhost/shared';
}
else if (getQuerystring("test", "") == "5minlocal") {
	fivMin_synUrl = 'http://syn.5minlocal.com';
	fivMin_shared = 'http://shared.5minlocal.com';
}



function fivemin_makeDoubleDelegate(function1, function2) {
	return function() {
		if (function1)
			function1();
		if (function2)
			function2();
	}
}


/***********************************************/
/* Load css & external js zone
/***********************************************/

loadjscssfile = function(filename, filetype) {
	if (filetype == "js") { //if filename is a external JavaScript file
		var fileref = document.createElement('script');
		fileref.setAttribute("type", "text/javascript");
		fileref.setAttribute("src", filename);
	}
	else if (filetype == "css") { //if filename is an external CSS file
		var fileref = document.createElement("link");
		fileref.setAttribute("rel", "stylesheet");
		fileref.setAttribute("type", "text/css");
		fileref.setAttribute("media", "screen");
		fileref.setAttribute("href", filename);
	}
	if (typeof fileref != "undefined")
		document.getElementsByTagName("head")[0].appendChild(fileref)
}
// Load lytebox Scripts and style
loadjscssfile(fivMin_synUrl + "/Styles/LiteBoxSkin1.css", "css");
loadjscssfile(fivMin_shared + "/Scripts/DetectFlashVersion.js", "js");


ReportComscore = function(key) {
	// Report to comscore
	if (COMSCORE != undefined) {
		COMSCORE.beacon({
			c1: 7,
			c2: "6473742",
			c3: key,
			c4: "",
			c5: "",
			c6: "",
			c15: ""
		});
	}
	

};

onSuccessURL = function(reqJSONtext) {

	if (!reqJSONtext.success) {
		if (vsThumbSeed[1].toRemoveIfNR && vsThumbSeed[1].toRemoveIfNR.length > 0)
			document.getElementById(vsThumbSeed[1].toRemoveIfNR).innerHTML = '';
		return;
	}

	// Set player type (sp2 || sp3)
	vsThumbSeed[reqJSONtext.thumbSeedCounter].videoStripSetting.UsePlayer3 = (reqJSONtext.UsePlayer3 == undefined) ? false : reqJSONtext.UsePlayer3;
	//Evaluate Json string to Videos object
	vsThumbSeed[reqJSONtext.thumbSeedCounter].videoStripSetting.videosResults = reqJSONtext.binding;
	if (vsThumbSeed[reqJSONtext.thumbSeedCounter].videoStripSetting.hasCompanion == undefined)
		vsThumbSeed[reqJSONtext.thumbSeedCounter].videoStripSetting.hasCompanion = reqJSONtext.DisplayCompanion;

	// Check if no videos then display none
	if (vsThumbSeed[reqJSONtext.thumbSeedCounter].videoStripSetting.videosResults == undefined || vsThumbSeed[reqJSONtext.thumbSeedCounter].videoStripSetting.videosResults.length == 0) {
			ReportComscore("8");
		return;
	}
	
	vsThumbSeed[reqJSONtext.thumbSeedCounter].draw();
		ReportComscore("7");

};




/***********************************************
/* Initalize zone
/***********************************************/

var ThumbSeed = function(divLayer) {
	// doctype detection functions
	var _isFFChromeStrictDoctype = null;
	var _isIEStrictDoctype = null;

	function isDoctypeStringStrict(s) {
		return s.toLowerCase().indexOf("strict") > -1 || s.toLowerCase().indexOf("xhtml 1.1") > -1;
	}

	function isFFChromeStrictDoctype() {
		if (_isFFChromeStrictDoctype !== null) return _isFFChromeStrictDoctype;
		try {
			_isFFChromeStrictDoctype = isDoctypeStringStrict(document.doctype.publicId);
		} catch (e) { _isFFChromeStrictDoctype = false; }
		return _isFFChromeStrictDoctype;
	}

	function isIEStrictDoctype() {
		if (_isIEStrictDoctype !== null) return _isIEStrictDoctype;
		if (navigator.appName != "Microsoft Internet Explorer") return false;
		try {
			var doctype = document.all[0].nodeValue;
			_isIEStrictDoctype = doctype.toLowerCase().indexOf("strict") > -1 || doctype.toLowerCase().indexOf("xhtml11") > -1;
		} catch (e) { _isIEStrictDoctype = false; }
		return _isIEStrictDoctype;
	}
	// end doctype detection functions


	this.divLayer = divLayer
	this.layout = "700X180";
	this.sid;
	this.horizontalLayout = false;
	this.width;
	this.url = null;
	this.featured;
	this.videoCount;
	this.playList;
	this.categories // For choosing categories
	this.parentDiv = '_' + this.divLayer;
	this.useIEFix = undefined;
	this.libraryID = 0;
	this.cbCount = -1;

	this.wrapperColor = "#999999";
	// Design variables
	this.buildWrapper // buildWrapper style of the widget
	this.headerStrip //Build the strip of the header
	this.headertitle // span title of widget
	this.titleFontWeight = "13px";
	this.headerLeftArrow //Choose the arrow style & color of the widget
	this.buildCube  // Buil one cube
	this.title = "Related videos"; // set title text
	this.titleColor = "#000000";
	this.headerColor = (this.headerColor) ? this.headerColor : "grey";
	this.backgroundColor = this.backgroundColor ? (this.backgroundColor) : "grey";
	this.backgroundColorCode = "#F3F3F3";
	this.photoStyle = ''; // Set style & size of the display image
	this.playImageCode; // Set code for play button
	this.duration // Set the duration style
	this.footer
	this.colorText = "#000000";
	this.footerVideoPediaColor = "#63B0E6";
	this.videoDivTitleStyle;
	this.wrapperColor;
	this.seperator = "";
	this.hasCompanion = undefined;

	// CssClases
	this.fiveMinHeader;
	this.fiveMinWrappAllVideos;
	this.fiveMinWrapper; // Use for one div controll
	this.fiveMinHeader = 'fivemin_header';
	this.fiveMinFooter = 'fivemin_footer';
	this.fiveMinCloseFooter = 'fivemin_closeFooter';

	thumbSeedCounter++;
	this.videosStripControl;

	this.videoStripSetting = new Object();


	this.Load = function() {
		vsThumbSeed[thumbSeedCounter] = this;
		cbfunc[thumbSeedCounter] = onSuccessURL;

		if ((navigator.appName == "Microsoft Internet Explorer" && this.useIEFix == undefined) || this.useIEFix) {
			var tsc = thumbSeedCounter;

			window.onload = fivemin_makeDoubleDelegate(window.onload, function() {

				//window.onload = function(){  
				// Init variables

				vsThumbSeed[tsc].initVariables();

				// Ajax call
				fivemin_jsonp(fivMin_synUrl + '/handlers/SenseHandler.ashx?func=GetResults&thumbSeedCounter=' + tsc + "&sid=" + vsThumbSeed[tsc].sid + vsThumbSeed[tsc].GetParams() + '&url=' + encodeURIComponent(vsThumbSeed[tsc].url), 'cbfunc[' + tsc + ']', "");
				//ahCalls.createAhCall('scriptTag','http://syn.5min.com/handlers/SenseHandler.ashx?func=GetResults&url='+ vsThumbSeed[thumbSeedCounter].url + "&sid=" + vsThumbSeed[thumbSeedCounter].sid + vsThumbSeed[thumbSeedCounter].GetParams(),'jsonString' ,cbfunc[thumbSeedCounter], false);
			});
		}
		else {

			// Init variables
			this.initVariables();

			// Ajax call
			//ahCalls.createAhCall('scriptTag','http://syn.5min.com/handlers/SenseHandler.ashx?func=GetResults&url='+ this.url + "&sid=" + this.sid + this.GetParams(),'jsonString' ,onSuccessURL, false);
			fivemin_jsonp(fivMin_synUrl + '/handlers/SenseHandler.ashx?func=GetResults&thumbSeedCounter=' + thumbSeedCounter + "&sid=" + this.sid + this.GetParams() + '&url=' + encodeURIComponent(this.url), 'cbfunc[' + thumbSeedCounter + ']', "");

		}


	};

	this.GetParams = function() {
		var str = '';

		if (this.videoCount > 0 && this.videoCount <= this.getVideoCount())
			str += '&videoCount=' + this.videoCount;
		else
			str += '&videoCount=' + this.getVideoCount();

		if (this.categories)
			if (this.categories.length > 0)
			str += '&categories=' + this.categories;

		if (this.playList)
			if (this.playList.length > 0)
			str += '&playlist=' + this.getRandomList(this.playList);

		if (this.fallback)
			str += '&fallback=' + this.getRandomList(this.fallback);

		if (this.featured && this.featured == true)
			str += '&featured=true';

		if (this.fallbackType)
			str += "&fallbackType=" + this.fallbackType;

		if (this.contentQuality && this.contentQuality > 0)
			str += '&ContentQuality=' + this.contentQuality;

		if (this.layout)
			str += '&rectSize=' + this.layout;

		if (this.testData)
			str += '&testData=' + this.testData;

		if (this.autoStart != undefined)
			this.videoStripSetting.autoStart = '&autoStart=' + this.autoStart;
		else
			this.videoStripSetting.autoStart = '&autoStart=true';

		str += '&cbCustomID=fiveMinAdaptvCompanionDiv&ExposureType=ThumbSeed';

		if (getQuerystring("playernewversion3", "") == "true")
			str += '&playernewversion3=true';

		if (getQuerystring("isTestDensity", "") == "true")
			str += '&isTestDensity=true';

		if (getQuerystring("playerdebug5min", "") != "")
			str += '&playerdebug5min=' + getQuerystring("playerdebug5min", "");

		if (document.getElementsByTagName('title')[0])
			str += '&shortAnalysisText=' + document.getElementsByTagName('title')[0].innerHTML;

		if (this.libraryID > 0)
			str += "&libraryID=" + this.libraryID;

		return str;

	};

	this.getRandomList = function(videoList) {
		var videoListArr;
		var newVideoListArr = new Array();


		if (videoList.length > 0) {

			videoListArr = videoList.split(',');
			var videoCount = Math.min(this.getVideoCount(), videoListArr.length);


			var counter = 0;
			while (counter < videoCount) {
				var no = Math.round(Math.random() * (videoListArr.length - 1));
				var isInArray = false;
				// Check if no in Array if yes we have to 
				for (var i = 0; i < newVideoListArr.length; i++) {
					if (newVideoListArr[i].toString() == videoListArr[no].toString()) {
						isInArray = true;
						break;
					}

				}

				if (!isInArray) {
					newVideoListArr.push(videoListArr[no]);
					counter++;
				}

			}



		}

		return newVideoListArr.toString();
	};

	this.getVideoCount = function() {

		var videocount
		switch (this.layout) {
			case "160X600":
			case "700X180":
				videocount = 5;
				break;
			case "728X90":
			case "205X335":
			case "500X175":
				videocount = 4;
				break;
			case "590X96":
			case "575X100":
				videocount = 3;
				break;
			case "468X60":
			case "250X250":
			case "300X250":
				videocount = 2;
				break;
			case "120X120":
				videocount = 1;
				break;
			case "425X400":
				videocount = 9;
				//this.videoStripSetting.videoResultsLenth = 6;
				break;

			default:
				videocount = 5;
				break;

		}

		return videocount;

	};


	this.initVariables = function() {

		this.videoStripSetting.displayBorder = true;
		this.videoStripSetting.displayHeader = true;
		this.videoStripSetting.displayFooter = true;
		this.videoStripSetting.ht = "_blank";
		this.videoStripSetting.videoCountThumbSeedPage = 0;



		if (this.videoCountThumbSeedPage)
			this.videoStripSetting.videoCountThumbSeedPage = this.videoCountThumbSeedPage;


		if (this.url == null)
			this.url = escape(document.location);


		if (this.layout) {
			this.layout = this.layout.toUpperCase();
			if (this.videoStripSetting.videosResults) {
				var videoNum = this.getVideoCount();
				this.videoStripSetting.videoResultsLenth = this.videoStripSetting.videosResults.length < videoNum ? this.videoStripSetting.videosResults.length : videoNum;

				this.videoStripSetting.videoResultsLenth = (this.videoStripSetting.videoCountThumbSeedPage > 0) && this.videoStripSetting.videoCountThumbSeedPage < this.videoStripSetting.videoResultsLenth
                 ? this.videoStripSetting.videoCountThumbSeedPage : this.videoStripSetting.videoResultsLenth;

				// Check results for layout 425X400
				if (this.layout == "425X400" && !(this.videoStripSetting.videoResultsLenth % 3 == 0)) {
					this.videoStripSetting.videoResultsLenth = this.CorrectVideo425X400();

					if (this.videoStripSetting.videoResultsLenth < 3)
						return;
				}
			}
		}



		// init design variables

		if (this.hasCompanion != undefined)
			this.videoStripSetting.hasCompanion = this.hasCompanion;

		if (this.headerColor)
			this.headerColor = this.headerColor.toLowerCase();


		if (this.ht)
			this.videoStripSetting.ht = this.ht;

		if (this.displayBorder != undefined)
			this.videoStripSetting.displayBorder = this.displayBorder;

		if (this.displayHeader != undefined)
			this.videoStripSetting.displayHeader = this.displayHeader;


		if (this.displayFooter != undefined)
			this.videoStripSetting.displayFooter = this.displayFooter;

		// Init Background colors
		this.BackgroundColors();


	};

	this.CorrectVideo425X400 = function() {
		var num;
		switch (this.videoStripSetting.videoResultsLenth) {
			case 8:
			case 7: num = 6;
				break;
			case 5:
			case 4: num = 3;
				break;
			default:
				num = this.videoStripSetting.videoResultsLenth;
				break;
		}

		return num;



	};

	this.SetLayoutVars = function(videoResultsCount) {
		this.videoCount = videoResultsCount;
		var stripPixelLineHeight = "26px";
		this.wrapperWidth = this.videoCount * 140 + "px";
		var wrapperHeight = 0;
		var stripPixel = '';
		var trigPixel = '';
		var stripPixelstr = (BrowserDetect.version == "6" && BrowserDetect.browser == "Explorer") ? "Strip_700X180.gif" : "Strip_700X180.png";
		var trigPixelstr = (BrowserDetect.version == "6" && BrowserDetect.browser == "Explorer") ? "Trig_700X180.gif" : "Trig_700X180.png";
		var stripPixelHeight = 29;
		var stripPixelWidth = "width:690px";
		var headerLeftArrowWidth = "10px";
		var positionPlay = null;
		var playButtonSize = null; ;
		var playButtonName = (BrowserDetect.version == "6" && BrowserDetect.browser == "Explorer") ? "play_22X22.gif" : "play_22X22.png";
		var arrowHeader = null; ;
		var wrapperFooterWidth = this.videoCount * 140 - 10 + "px;";
		var photoHeight = "62px";
		var photoWidth = "85px";
		var backGroundHeaderColor = this.headerColor == "black" ? "black" + this.headerColor : this.backgroundColor + "" + this.headerColor;
		var leftSeperatorPixel = this.backgroundColor + "LeftSeperator_700X180.png";

		this.videoStripSetting.addLogoLeft = '';
		this.videoStripSetting.leftSeperator = '';
		this.footer = '<div style="clear:both"></div>';

		this.seperator = '';
		this.videoStripSetting.wrapperDuration = '';
		this.videoStripSetting.titleLinkStyle = '';
		this.duration = '';
		positionPlay = null;
		this.videoStripSetting.buildCubeLast = '';
		this.buildCube = '';
		this.videoStripSetting.durationInline = '';
		this.buildWrapper = '';
		this.wrapperWidth = '';

		headerLeftArrow = '';
		headerStrip = '';
		photoStyle = '';
		playImageCode = '';

		switch (this.layout) {

			case "425X400":
				// set wrapper
				this.videoStripSetting.isUpperTitle = true;

				wrapperFooterWidth = this.videoCount * 140 - 10 + "px;"


				// set header
				//              stripPixel = backGroundHeaderColor + "Strip_700X180.png";
				stripPixelHeight = 29;
				stripPixelLineHeight = "26px";
				stripPixelWidth = "690px";
				//              arrowHeader = backGroundHeaderColor + "Trig_700x180.png";


				stripPixel = this.backgroundColor + "" + this.headerColor + stripPixelstr;
				arrowHeader = this.backgroundColor + "" + this.headerColor + trigPixelstr;

				titleFontWeight = "12px";
				photoHeight = "62px";
				photoWidth = "85px";
				this.videoStripSetting.title = this.title.substring(0, 41);
				playButtonSize = "22";
				playButtonName = (BrowserDetect.version == "6" && BrowserDetect.browser == "Explorer") ? "play_22X22.gif" : "play_22X22.png";
				this.duration = "position:absolute;font-size: 10px;font-weight: bold;";
				this.videoStripSetting.titleLinkStyle = "font-weight:normal;font-size:12px;overflow:hidden;";
				this.videoStripSetting.wrapperDuration = "position:relative;top:-25px;";


				if (!this.videoStripSetting.displayHeader)
					wrapperHeight = stripPixelHeight * -1;

				// set video title
				videoDivTitleStyle = "height: 45px;width: 120px;overflow:hidden;color:#026799;line-height:14px;";

				this.videoStripSetting.leftSeperator = "<div style='font-size:0px;background-image: url(" + fivMin_shared + "/Graphics/VideoSeed/" + leftSeperatorPixel + ");background-repeat: repeat-y;width:2px;height:123px;float:left;'></div>";


				if (navigator.appName == "Microsoft Internet Explorer" && !this.ie8) {
					if (this.videoCount >= 3)
						this.wrapperWidth = '423px';
					else
						this.wrapperWidth = this.videoCount * 140 - 1 + "px";

					//wrapperHeight += 180;
					positionPlay = "position: relative;left: 60px;top: 0px;border: 0px;";
					//this.buildCube = "font-family:verdana;background-color: " + this.backgroundColorCode + ";border-right:solid 1px " + this.videoStripSetting.leftSeperatorColor + ";float:left;" + 
					this.buildCube = "font-family:verdana;background-color: " + this.backgroundColorCode + ";float:left;" +
                        "width:119px;height: 110px;" + ((BrowserDetect.version == "6") ? "padding: 5px 9px 8px 10px;" : "padding: 5px 10px 8px 10px;") + "font-size: 12px;margin-bottom:1px;";

					this.videoStripSetting.buildCubeLast = "font-family:verdana;background-color: " + this.backgroundColorCode + ";float:left;" +
                        "width:119px;height: 110px;padding: 5px 10px 8px 10px;font-size: 12px;";

					this.videoStripSetting.durationInline = "position:relative;top:12px;left:70px;";
				}
				else {
					if (this.videoCount >= 3)
						this.wrapperWidth = '423px';
					else
						this.wrapperWidth = this.videoCount * 140 - 2 + "px";

					//wrapperHeight += 178;
					positionPlay = "position: relative;left: 63px;top: 0px;border: 0px;";
					this.buildCube = "font-family:verdana;background-color: " + this.backgroundColorCode + ";float:left;" +
                        "width:119px;height: 110px;padding: 5px 10px 8px 10px;font-size: 12px;margin-bottom:1px;";
					this.videoStripSetting.buildCubeLast = "font-family:verdana;background-color: " + this.backgroundColorCode + ";float:left;" +
                        "width:121px;height: 110px;padding: 5px 10px 8px 10px;font-size: 12px;";
					this.videoStripSetting.durationInline = "position:relative;top:-8px;left:92px;";

					// this.videoStripSetting.buildCubeLast = this.buildCube;
				}

				this.videoStripSetting.durationInline += "font-family:verdana;font-size:10px;";



				// Set Footer
				//                    this.footer = "<div style='background-color: " + this.backgroundColorCode + ";font-size:0px;width:100%;overflow:auto;height:26px;" +
				//                            "background-image: url(" + fivMin_shared + "/Graphics/VideoSeed/" + this.backgroundColor + "seperator_700x180.gif);background-repeat: repeat-x;" +
				//                            "background-position: top;'>" + 
				//                            "<div style='font-family:Verdana;font-weight:bolder;line-height:25px;padding:0px 0px 0px 10px;font-size:13px;'><a href='http://www.5min.com' target='new' style='text-decoration:none;z-index:100;'><span style='color:" + this.colorText +";'>By 5min</span> <span style='color:" + this.footerVideoPediaColor +"'>Life Videopedia</span></a></div></div>" ;
				this.footer = "<div style='clear:both'></div>" + this.seperator +
                                        "<div style='position:relative;z-index:10;background-color: " + this.backgroundColorCode + ";font-size:13px;width:" + this.wrapperWidth + ";height:26px;" +
                                        "background-position: top;font-family:Verdana;font-weight:bolder;'>" +
                                        "<a href='http://www.5min.com' target='_new'><div style='padding-left:10px;line-height:25px;text-decoration:none;'><span style='color:" + this.colorText + ";font-size:13px;'>By 5min</span> <span style='font-size:13px;color:" + this.footerVideoPediaColor + "'>Life Videopedia</span></div></a></div>";

				break;
			case "205X335":
				this.videoStripSetting.isUpperTitle = false;

				// set header
				stripPixel = this.backgroundColor + "" + this.headerColor + stripPixelstr;
				arrowHeader = this.backgroundColor + "" + this.headerColor + trigPixelstr;

				//stripPixel = backGroundHeaderColor + "Strip_700X180.png";
				stripPixelHeight = 29;
				stripPixelLineHeight = "26px";
				//stripPixelWidth = "690px";
				//arrowHeader = backGroundHeaderColor + "Trig_700x180.png";
				titleFontWeight = "12px";
				photoHeight = "60px";
				photoWidth = "84px";

				playButtonSize = "22";
				playButtonName = (BrowserDetect.version == "6" && BrowserDetect.browser == "Explorer") ? "play_22X22.gif" : "play_22X22.png";
				this.videoStripSetting.title = this.title.substring(0, 21);
				this.videoStripSetting.titleLinkStyle = "position:relative;height:50px;width: 92px;line-height:13px;display:block;overflow:hidden;font-family:verdana;font-size:11px;font-weight:normal;";
				this.videoStripSetting.durationInline = "font-family:verdana;font-size:11px;font-weight:bold;";

				if (!this.videoStripSetting.displayHeader)
					wrapperHeight = stripPixelHeight * -1;

				wrapperHeight += 94;

				// set video title
				videoDivTitleStyle = "position: absolute;height: 35px;width: 95px;";
				this.videoStripSetting.titleLeftStyle = '';
				this.seperator = "<div style='background-image: url(" + fivMin_shared + "/Graphics/VideoSeed/" + this.backgroundColor + "Seperator_160X600.png);background-repeat: repeat-x;" +
                                "background-position: top ;width:198px;height:12px;font-size:0px;'></div>";

				photoStyle = "position:relative;top:-7px;";

				if (navigator.appName == "Microsoft Internet Explorer" && BrowserDetect.version != "8") {
					this.wrapperWidth = "198px";
					positionPlay = "position: relative;left: -23px;top: 27px;border: 0px;";
					this.videoStripSetting.titleLeftStyle = "style='position:relative;font-weight:normal;top:-10px;left:4px;text-decoration: none;color: " + this.videoStripSetting.titleVideoColor + ";" + this.videoStripSetting.titleLinkStyle + "'";
					this.buildCube = "font-family:verdana;background-color: " + this.backgroundColorCode + ";border-right:solid 1px " + this.videoStripSetting.leftSeperatorColor + ";" +
                        "width: 180px;height: 50px;padding: 8px 9px 7px 9px;font-size: 10px";
					videoDivTitleStyle += "padding-left:4px;";
					this.duration = "position:relative;display: inline;font-family:verdana;font-size: 9px;font-weight: bold;padding-left:7px;top:-8px;";
				}
				else {
					this.wrapperWidth = "198px";
					positionPlay = "position: relative;left:59px;top: -32px;border: 0px;";
					this.videoStripSetting.titleLeftStyle = "style='position:relative;font-weight:normal;top: -73px;left:94px;text-decoration: none;color: " + this.videoStripSetting.titleVideoColor + ";" + this.videoStripSetting.titleLinkStyle + "'";
					this.buildCube = "font-family:verdana;background-color: " + this.backgroundColorCode + ";border-right:solid 1px " + this.videoStripSetting.leftSeperatorColor + ";" +
                        "width: 180px;height: 50px;padding: 8px 9px 7px 9px;font-size: 10px";
					this.duration = "position:relative;font-family:verdana;font-size: 9px;font-weight: bold;padding-left:7px;top:-19px;left:85px;";
				}

				this.videoStripSetting.buildCubeLast = this.buildCube;


				// Set Footer
				//                    this.footer = "<div style='clear:both'></div>" + 
				//                            "<div style='background-color: " + this.backgroundColorCode + ";font-size:0px;width:100%;overflow:auto;height:26px;" +
				//                            "background-image: url(" + fivMin_shared + "/Graphics/VideoSeed/" + this.backgroundColor + "seperator_700x180.gif);background-repeat: repeat-x;" +
				//                            "background-position: top;'>" + 
				//                            "<div style='font-family:Verdana;font-weight:bolder;line-height:25px;padding:0px 0px 0px 10px;font-size:13px;'><a href='http://www.5min.com' target='new' style='text-decoration:none;z-index:100;'><span style='color:" + this.colorText +";'>By 5min</span> <span style='color:" + this.footerVideoPediaColor +"'>Life Videopedia</span></a></div></div>" ;
				//        
				this.footer = "<div style='clear:both'></div>" + this.seperator +
                                        "<div style='position:relative;z-index:10;background-color: " + this.backgroundColorCode + ";font-size:13px;width:" + this.wrapperWidth + ";height:26px;" +
                                        "background-position: top;font-family:Verdana;font-weight:bolder;'>" +
                                        "<a href='http://www.5min.com' target='_new'><div style='padding-left:10px;line-height:25px;text-decoration:none;'><span style='color:" + this.colorText + ";font-size:13px;'>By 5min</span> <span style='font-size:13px;color:" + this.footerVideoPediaColor + "'>Life Videopedia</span></div></a></div>";

				break;

			case "700X180":
				// set wrapper
				this.videoStripSetting.isUpperTitle = true;

				wrapperFooterWidth = this.videoCount * 140 - 10 + "px;"


				// set header
				stripPixel = this.backgroundColor + "" + this.headerColor + stripPixelstr;
				arrowHeader = this.backgroundColor + "" + this.headerColor + trigPixelstr;


				//stripPixel = backGroundHeaderColor + "Strip_700X180.png";
				stripPixelHeight = 29;
				stripPixelLineHeight = "26px";
				stripPixelWidth = "690px";
				//arrowHeader = backGroundHeaderColor + "Trig_700x180.png";
				titleFontWeight = "12px";
				photoHeight = "90px";
				photoWidth = "120px";
				this.videoStripSetting.title = this.title.substring(0, 61);
				playButtonSize = "28";
				playButtonName = (BrowserDetect.version == "6" && BrowserDetect.browser == "Explorer") ? "play_28X28.gif" : "play_28X28.png";
				this.duration = "position:absolute;font-size:11px;"; //"position:absolute;font-size: 10px;font-weight: bold;";
				this.videoStripSetting.titleLinkStyle = "font-size:11px;overflow:hidden;font-weight:normal;";
				this.videoStripSetting.wrapperDuration = "position:relative;top:-35px;";

				if (!this.videoStripSetting.displayHeader)
					wrapperHeight = stripPixelHeight * -1;

				// set video title
				videoDivTitleStyle = "position:relative;height: 23px;width: 120px;color:#026799;line-height:11px;padding-top:0px;margin-top:0px;top:-5px;overflow:hidden;";
				this.videoStripSetting.leftSeperator = "<div style='font-size:0px;background-image: url(" + fivMin_shared + "/Graphics/VideoSeed/" + leftSeperatorPixel + ");background-repeat: repeat-y;width:2px;height:123px;float:left;'></div>";

				if (navigator.appName == "Microsoft Internet Explorer" && BrowserDetect.version != "8") {
					this.wrapperWidth = this.videoCount * 142 + "px";
					//wrapperHeight += 180;
					positionPlay = "position: relative;left:89px;top:3px;border: 0px;";
					//this.buildCube = "font-family:verdana;background-color: " + this.backgroundColorCode + ";border-right:solid 1px " + this.videoStripSetting.leftSeperatorColor + ";float:left;" + 
					this.buildCube = "font-family:verdana;display:inline;background-color: " + this.backgroundColorCode + ";float:left;" +
                            "width:121px;height: 110px;" + ((BrowserDetect.version == "6") ? "padding: 5px 6px 8px 9px;" : "padding: 5px 7px 8px 10px;") + "font-size: 12px;";


					this.videoStripSetting.buildCubeLast = "font-family:verdana;background-color: " + this.backgroundColorCode + ";display:inline;float:left;" +
                            "width:" + ((BrowserDetect.version == "6") ? "123px;" : "121px;") + "height: 110px;padding: 5px 8px 8px 10px;font-size: 12px;";
					this.videoStripSetting.durationInline = "position:relative;top:-56px;left:23px;background-image: url(" + fivMin_shared + "/Graphics/VideoSeed/durationBg.png);background-repeat:no-repeat;width:70px;height:15px;color:#000000;font-weight:bold;text-align:right;"; //"position:relative;top:-14px;left:92px;";
					// this.videoStripSetting.durationInline = "";//"position:relative;top:53px;";
				}
				else {
					this.wrapperWidth = this.videoCount * 140 - 2 + "px";
					//wrapperHeight += 178;
					positionPlay = "position: relative;left: 88px;top:2px;border: 0px;";
					this.buildCube = "font-family:verdana;background-color: " + this.backgroundColorCode + ";float:left;" +
                            "width:118px;height: 110px;padding: 5px 10px 8px 10px;font-size: 12px;";
					this.videoStripSetting.buildCubeLast = "font-family:verdana;background-color: " + this.backgroundColorCode + ";float:right;" +
                            "width:118px;height: 110px;padding: 5px 10px 8px 10px;font-size: 12px;";
					this.videoStripSetting.durationInline = "position:relative;top:-84px;left:51px;background-image: url(" + fivMin_shared + "/Graphics/VideoSeed/durationBg.png);background-repeat:no-repeat;width:70px;height:15px;color:#000000;font-weight:bold;text-align:right;"; //"position:relative;top:-14px;left:92px;";
				}



				// Set Footer
				this.footer = "<div style='clear:both'></div>" +
                            "<div style='background-color: " + this.backgroundColorCode + ";font-size:0px;width:100%;overflow:hidden;height:26px;" +
                            "background-image: url(" + fivMin_shared + "/Graphics/VideoSeed/" + this.backgroundColor + "seperator_700x180.gif);background-repeat: repeat-x;" +
                            "background-position: top;'>" +
                            "<div style='font-family:Verdana;font-weight:bolder;line-height:25px;padding:0px 0px 0px 10px;font-size:13px;position:relative;z-index:10;'><a href='http://www.5min.com' target='new' style='text-decoration:none;z-index:100;'><span style='color:" + this.colorText + ";'>By 5min</span> <span style='color:" + this.footerVideoPediaColor + "'>Life Videopedia</span></a></div></div>";

				break;
			case "500X175":
				// set wrapper
				this.videoStripSetting.isUpperTitle = true;

				wrapperFooterWidth = this.videoCount * 140 - 10 + "px;"


				// set header
				stripPixel = this.backgroundColor + "" + this.headerColor + stripPixelstr;
				arrowHeader = this.backgroundColor + "" + this.headerColor + trigPixelstr;


				//stripPixel = backGroundHeaderColor + "Strip_700X180.png";
				stripPixelHeight = 29;
				stripPixelLineHeight = "26px";
				stripPixelWidth = "690px";
				//arrowHeader = backGroundHeaderColor + "Trig_700x180.png";
				titleFontWeight = "12px";
				photoHeight = "75px";
				photoWidth = "104px";
				this.videoStripSetting.title = this.title.substring(0, 61);
				playButtonSize = "22";
				playButtonName = (BrowserDetect.version == "6" && BrowserDetect.browser == "Explorer") ? "play_22X22.gif" : "play_22X22.png";
				this.duration = "position:absolute;font-size:11px;"; //"position:absolute;font-size: 10px;font-weight: bold;";
				this.videoStripSetting.titleLinkStyle = "font-size:11px;overflow:hidden;font-weight:normal;";
				this.videoStripSetting.wrapperDuration = "position:relative;top:-35px;";

				if (!this.videoStripSetting.displayHeader)
					wrapperHeight = stripPixelHeight * -1;

				// set video title
				videoDivTitleStyle = "position:absolute;width:105px;height:" + (BrowserDetect.browser == "Firefox" && isFFChromeStrictDoctype() ? 27 : 25) + "px;color:#026799;line-height:12px;top:86px;overflow:hidden;";

				var nonIE67Style = "margin:0 2px";
				if (navigator.appName == "Microsoft Internet Explorer" && BrowserDetect.version != "8") nonIE67Style = "";

				this.videoStripSetting.leftSeperator = "<div style='font-size:0px;background-image: url(" + fivMin_shared + "/Graphics/VideoSeed/" + leftSeperatorPixel + ");background-repeat: repeat-y;width:2px;height:120px;float:left;" + nonIE67Style + "'></div>";

				if (navigator.appName == "Microsoft Internet Explorer" && BrowserDetect.version != "8") {
					this.wrapperWidth = this.videoCount * 125 + "px";
					//wrapperHeight += 180;
					positionPlay = "position: relative;left:84px;top:5px;border: 0px;";
					//this.buildCube = "font-family:verdana;background-color: " + this.backgroundColorCode + ";border-right:solid 1px " + this.videoStripSetting.leftSeperatorColor + ";float:left;" +
					this.buildCube = "position:relative;font-family:verdana;display:inline;background-color: " + this.backgroundColorCode + ";float:left;" +
                            "width:107px;height: 110px;" + ((BrowserDetect.version == "6") ? "padding: 5px 6px 8px 9px;" : "padding: 5px 7px 8px 10px;") + "font-size: 12px;";


					this.videoStripSetting.buildCubeLast = "position:relative;font-family:verdana;background-color: " + this.backgroundColorCode + ";display:inline;float:left;" +
                            "width:" + ((BrowserDetect.version == "6") ? "111px;" : "107px;") + "height: 110px;padding: 5px 6px 8px 6px;font-size: 12px;";
					this.videoStripSetting.durationInline = "position:relative;top:-41px;left:12px;background-image: url(" + fivMin_shared + "/Graphics/VideoSeed/durationBg.png);background-repeat:no-repeat;width:70px;height:15px;color:#000000;font-weight:bold;text-align:right;"; //"position:relative;top:-14px;left:92px;";
					// this.videoStripSetting.durationInline = "";//"position:relative;top:53px;";
				}
				else {
					this.wrapperWidth = this.videoCount * 125 - 2 + "px";
					//wrapperHeight += 178;
					positionPlay = "position: relative;left: 82px;top:8px;border: 0px;";
					this.buildCube = "position:relative;font-family:verdana;background-color: " + this.backgroundColorCode + ";float:left;" +
                            "width:108px;height: 104px;padding: 5px 6px 0px 6px;font-size: 12px;";
					this.videoStripSetting.buildCubeLast = "position:relative;font-family:verdana;background-color: " + this.backgroundColorCode + ";float:left;" +
                            "width:108px;height: 104px;padding: 5px 6px 0px 6px;font-size: 12px;";


					var strictCss = "top:-63px;";
					if (isFFChromeStrictDoctype() || isIEStrictDoctype()) strictCss = "top:-67px;";

					this.videoStripSetting.durationInline = "position:relative;" + strictCss + "left:35px;background-image: url(" + fivMin_shared + "/Graphics/VideoSeed/durationBg.png);background-repeat:no-repeat;width:70px;height:15px;color:#000000;font-weight:bold;text-align:right;"; //"position:relative;top:-14px;left:92px;";
				}



				// Set Footer
				// Set Footer
				this.footer = "<div style='clear:both'></div>" +
                            "<div style='background-color: " + this.backgroundColorCode + ";font-size:0px;width:100%;overflow:hidden;height:26px;" +
                            "background-image: url(" + fivMin_shared + "/Graphics/VideoSeed/" + this.backgroundColor + "seperator_700x180.gif);background-repeat: repeat-x;" +
                            "background-position: top;'>" +
                            "<div style='font-family:Verdana;font-weight:bolder;line-height:25px;padding:0px 0px 0px 10px;font-size:13px;position:relative;z-index:10;'><a href='http://www.5min.com' target='new' style='text-decoration:none;z-index:100;'><span style='color:" + this.colorText + ";'>By 5min</span> <span style='color:" + this.footerVideoPediaColor + "'>Life Videopedia</span></a></div></div>";


				break;
			case "728X90":
				this.videoStripSetting.isUpperTitle = false;


				// set header
				stripPixel = this.backgroundColor + "" + this.headerColor + stripPixelstr;
				arrowHeader = this.backgroundColor + "" + this.headerColor + trigPixelstr;

				//stripPixel = backGroundHeaderColor + "Strip_700X180.png";
				stripPixelHeight = 29;
				stripPixelLineHeight = "26px";
				//stripPixelWidth = "690px";
				//arrowHeader = backGroundHeaderColor + "Trig_700x180.png";
				titleFontWeight = "12px";
				photoHeight = "45px";
				photoWidth = "60px";

				playButtonSize = "18";
				playButtonName = (BrowserDetect.version == "6" && BrowserDetect.browser == "Explorer") ? "play_18X18.gif" : "play_18X18.png";

				if (!this.videoStripSetting.displayHeader)
					wrapperHeight = stripPixelHeight * -1;
				wrapperHeight += 88;

				this.videoStripSetting.title = this.title.substring(0, 64);

				videoDivTitleStyle = "position: absolute;height: 35px;width: 92px;";
				this.videoStripSetting.titleLeftStyle = '';
				this.videoStripSetting.titleLinkStyle = "position:relative;font-size:10px;font-weight:normal;height: 35px;width: 92px;display:block;overflow:hidden;";
				this.videoStripSetting.leftSeperator = "<div style='font-size:0px;background-image: url(" + fivMin_shared + "/Graphics/VideoSeed/" + leftSeperatorPixel + ");background-repeat: repeat-y;width:2px;height:59px;float:left;'></div>";


				if (navigator.appName == "Microsoft Internet Explorer" && BrowserDetect.version != "8") {

					this.wrapperWidth = this.videoCount * 167 + ((this.videoStripSetting.displayFooter) ? 58 : 1) + "px";
					//wrapperFooterWidth = this.videoCount * 168 -10 + "px;"
					positionPlay = "position: relative;left: -23px;top: 27px;border: 0px;";
					this.videoStripSetting.titleLeftStyle = "style='text-decoration: none;font-weight:normal;color: " + this.videoStripSetting.titleVideoColor + ";font-size:10px;font-family:verdana;'";
					this.buildCube = "font-family:verdana;background-color: " + this.backgroundColorCode + ";float: left;" +
                        "width: 152px;height: 45px;padding: 7px 6px 7px 7px;font-size: 10px";
					videoDivTitleStyle += "padding-left:5px;";

				}
				else {
					this.wrapperWidth = this.videoCount * 167 + ((this.videoStripSetting.displayFooter) ? 59 : 1) + "px";

					positionPlay = "position: relative;left: 45px;top: -21px;border: 0px;";
					this.videoStripSetting.titleLeftStyle = "style='position:relative;top: -50px;left:67px;font-weight:normal;text-decoration: none;color: " + this.videoStripSetting.titleVideoColor + ";font-size:10px;font-family:verdana;'";
					this.buildCube = "font-family:verdana;background-color: " + this.backgroundColorCode + ";float: left;" +
                        "width: 152px;height: 45px;padding: 7px 6px 7px 7px;font-size: 10px";

				}

				this.videoStripSetting.buildCubeLast = this.buildCube;
				this.duration = "display: inline;font-size: 9px;font-weight: bold;padding-left:5px;";

				this.videoStripSetting.addLogoLeft = this.videoStripSetting.displayFooter ? (this.videoStripSetting.leftSeperator + "<div style='width:58px;height:59px;float: left;background-color:" + this.backgroundColorCode + "';><a href='http://www.5min.com' target='new' style='text-decoration:none;border:0px;'><img style='margin:0;padding:0;' src='" + fivMin_shared + "/Graphics/VideoSeed/" + this.videoStripSetting.leftLogoColor + "logo_728X90.png' width='55' height='59' border='0'></a></div>") : "";

				break;

			case "590X96":
				this.videoStripSetting.isUpperTitle = false;

				// set header
				stripPixel = this.backgroundColor + "" + this.headerColor + stripPixelstr;
				arrowHeader = this.backgroundColor + "" + this.headerColor + trigPixelstr;

				//stripPixel = backGroundHeaderColor + "Strip_700X180.png";
				stripPixelHeight = 29;
				stripPixelLineHeight = "26px";
				//stripPixelWidth = "690px";
				//arrowHeader = backGroundHeaderColor + "Trig_700x180.png";
				titleFontWeight = "12px";
				photoHeight = "45px";
				photoWidth = "62px";

				playButtonSize = "18";
				playButtonName = (BrowserDetect.version == "6" && BrowserDetect.browser == "Explorer") ? "play_18X18.gif" : "play_18X18.png";
				this.videoStripSetting.title = this.title.substring(0, 51);


				if (!this.videoStripSetting.displayHeader)
					wrapperHeight = stripPixelHeight * -1;

				wrapperHeight += 94;

				// set video title
				videoDivTitleStyle = "position: absolute;height: 35px;width: 95px;";
				this.videoStripSetting.titleLeftStyle = '';
				this.videoStripSetting.titleLinkStyle = "position:relative;height: 35px;width: 95px;display:block;overflow:hidden;font-family:verdana;font-size:10px;font-weight:normal;";
				this.videoStripSetting.leftSeperator = "<div style='font-size:0px;background-image: url(" + fivMin_shared + "/Graphics/VideoSeed/" + leftSeperatorPixel + ");background-repeat: repeat-y;width:2px;height:65px;float:left;'></div>";

				this.wrapperWidth = this.videoCount * 175 + ((this.videoStripSetting.displayFooter) ? 63 : 1) + "px";
				if (navigator.appName == "Microsoft Internet Explorer" && BrowserDetect.version != "8") {

					positionPlay = "position: relative;left: -23px;top: 27px;border: 0px;";
					this.videoStripSetting.titleLeftStyle = "style='text-decoration: none;color: " + this.videoStripSetting.titleVideoColor + ";" + this.videoStripSetting.titleLinkStyle + "'";
					this.buildCube = "font-family:verdana;background-color: " + this.backgroundColorCode + ";float: left;" +
                        "width: 154px;height: 50px;padding: 8px 9px 7px 9px;font-size: 10px";
					videoDivTitleStyle += "padding-left:4px;";
				}
				else {

					positionPlay = "position: relative;left: 45px;top: -21px;border: 0px;";
					this.videoStripSetting.titleLeftStyle = "style='position:relative;top: -50px;left:67px;text-decoration: none;color: " + this.videoStripSetting.titleVideoColor + ";" + this.videoStripSetting.titleLinkStyle + "'";
					this.buildCube = "font-family:verdana;background-color: " + this.backgroundColorCode + ";float: left;" +
                        "width: 155px;height: 50px;padding: 8px 9px 7px 9px;font-size: 10px";

				}

				this.videoStripSetting.buildCubeLast = this.buildCube;

				this.duration = "display: inline;font-size: 9px;font-weight:bolder;padding-left:3px;";

				this.videoStripSetting.addLogoLeft = this.videoStripSetting.displayFooter ? (this.videoStripSetting.leftSeperator + "<div style='width:62px;height:60px;float: left;'><a href='http://www.5min.com' target='new' style='text-decoration:none;'><img src='" + fivMin_shared + "/Graphics/VideoSeed/" + this.videoStripSetting.leftLogoColor + "logo_590X96.png' style='margin:0;padding:0;' width='64' height='64' border='0'></a></div>") : "";

				break;

			case "575X100":
				this.videoStripSetting.isUpperTitle = false;

				// set header
				stripPixel = this.backgroundColor + "" + this.headerColor + stripPixelstr;
				arrowHeader = this.backgroundColor + "" + this.headerColor + trigPixelstr;

				//stripPixel = backGroundHeaderColor + "Strip_700X180.png";
				stripPixelHeight = 29;
				stripPixelLineHeight = "26px";
				//stripPixelWidth = "690px";
				//arrowHeader = backGroundHeaderColor + "Trig_700x180.png";
				titleFontWeight = "12px";
				photoHeight = "51px";
				photoWidth = "69px";

				playButtonSize = "22";
				playButtonName = (BrowserDetect.version == "6" && BrowserDetect.browser == "Explorer") ? "play_22X22.gif" : "play_22X22.png";
				this.videoStripSetting.title = this.title.substring(0, 51);


				if (!this.videoStripSetting.displayHeader)
					wrapperHeight = stripPixelHeight * -1;

				wrapperHeight += 94;

				// set video title
				videoDivTitleStyle = "position: absolute;height: 51px;width: 83px;";
				this.videoStripSetting.titleLeftStyle = '';
				this.videoStripSetting.titleLinkStyle = "position:relative;height: 51px;width: 83px;display:block;overflow:hidden;font-family:verdana;font-size:10px;font-weight:normal;";
				this.videoStripSetting.leftSeperator = "<div style='font-size:0px;background-image: url(" + fivMin_shared + "/Graphics/VideoSeed/" + leftSeperatorPixel + ");background-repeat: repeat-y;width:2px;height:69px;float:left;'></div>";


				if (navigator.appName == "Microsoft Internet Explorer" && BrowserDetect.version != "8") {
					this.wrapperWidth = this.videoCount * 166 + ((this.videoStripSetting.displayFooter) ? 75 : 1) + "px";
					positionPlay = "position: relative;left: -23px;top: 27px;border: 0px;";
					this.videoStripSetting.titleLeftStyle = "style='text-decoration: none;color: " + this.videoStripSetting.titleVideoColor + ";" + this.videoStripSetting.titleLinkStyle + "'";
					this.buildCube = "position:relative;font-family:verdana;background-color: " + this.backgroundColorCode + ";float: left;" +
                        "width: 149px;height: 55px;padding: 8px ;font-size: 10px";
					videoDivTitleStyle += "padding-left:4px;";
				}
				else {
					this.wrapperWidth = this.videoCount * 166 + ((this.videoStripSetting.displayFooter) ? 73 : 1) + "px";
					positionPlay = "position: relative;left: 45px;top: -21px;border: 0px;";
					this.videoStripSetting.titleLeftStyle = "style='position:relative;top: -57px;left:74px;text-decoration: none;color: " + this.videoStripSetting.titleVideoColor + ";" + this.videoStripSetting.titleLinkStyle + "'";
					this.buildCube = "position:relative;font-family:verdana;background-color: " + this.backgroundColorCode + ";float: left;" +
                        "width: 148px;height: 55px;padding: 8px;font-size: 10px";

				}

				this.videoStripSetting.buildCubeLast = this.buildCube;

				this.duration = "position:absolute;top:9px;left:36px;text-align:right;width:40px;background-image: url(" + fivMin_shared + "/Graphics/VideoSeed/durationBg.png);background-repeat:no-repeat;font-size: 9px;font-weight:bolder;padding-left:3px;";

				this.videoStripSetting.addLogoLeft = this.videoStripSetting.displayFooter ? (this.videoStripSetting.leftSeperator + "<div style='width:62px;height:60px;float: left;'><a href='http://www.5min.com' target='new' style='text-decoration:none;'><img src='" + fivMin_shared + "/Graphics/VideoSeed/" + this.videoStripSetting.leftLogoColor + "logo_590X96.png' style='margin:0;padding:0;' width='64' height='64' border='0'></a></div>") : "";


				break;

			case "468X60":
				this.videoStripSetting.isUpperTitle = false;

				stripPixelstr = (BrowserDetect.version == "6" && BrowserDetect.browser == "Explorer") ? "Strip_700X180.gif" : "Strip_700X180.png";
				trigPixelstr = (BrowserDetect.version == "6" && BrowserDetect.browser == "Explorer") ? "Trig_700X180.gif" : "Trig_700X180.png";

				// set header
				stripPixel = this.backgroundColor + "" + this.headerColor + stripPixelstr;
				arrowHeader = this.backgroundColor + "" + this.headerColor + trigPixelstr;

				//stripPixel = backGroundHeaderColor + "Strip_468X60.png";
				stripPixelHeight = 19;
				stripPixelLineHeight = "13px";
				//stripPixelWidth = "690px";
				//arrowHeader = backGroundHeaderColor + "Trig_468X60.png";
				titleFontWeight = "11px";
				photoHeight = "34px";
				photoWidth = "46px";

				playButtonSize = "18";
				playButtonName = (BrowserDetect.version == "6" && BrowserDetect.browser == "Explorer") ? "play_18X18.gif" : "play_18X18.png";
				this.videoStripSetting.title = this.title.substring(0, 45);
				this.videoStripSetting.titleLinkStyle = "position:relative;height: 25px;width: 140px;display:block;font-size:10px;font-family:verdana;font-weight:normal;overflow:hidden;";


				videoDivTitleStyle = "position: absolute;height: 25px;width: 140px;font-size: 10px;";

				this.videoStripSetting.titleLeftStyle = '';
				this.videoStripSetting.leftSeperator = "<div style='font-size:0px;background-image: url(" + fivMin_shared + "/Graphics/VideoSeed/" + leftSeperatorPixel + ");background-repeat: repeat-y;width:2px;height:39px;float:left;'></div>";


				if (!this.videoStripSetting.displayHeader)
					wrapperHeight = stripPixelHeight * -1;

				wrapperHeight += 58;


				if (navigator.appName == "Microsoft Internet Explorer" && BrowserDetect.version != "8") {
					this.wrapperWidth = this.videoCount * 205 + ((this.videoStripSetting.displayFooter) ? 58 : 1) + "px";
					wrapperFooterWidth = this.videoCount * 205 - 10 + "px;"
					positionPlay = "position: relative;left: -22px;top: 19px;border: 0px;";
					this.videoStripSetting.titleLeftStyle = "style='position:relative;left:5px;text-decoration: none;color: " + this.videoStripSetting.titleVideoColor + ";" + this.videoStripSetting.titleLinkStyle + "'";
					this.buildCube = "font-family:verdana;background-color: " + this.backgroundColorCode + ";float: left;" +
                        "width: 190px;height: 36px;padding: 1px 5px 2px 9px;font-size: 10px";
				}
				else {
					this.wrapperWidth = this.videoCount * 205 + ((this.videoStripSetting.displayFooter) ? 59 : 1) + "px";
					wrapperFooterWidth = this.videoCount * 205 - 10 + "px;"
					positionPlay = "position: relative;left: 32px;top: -20px;border: 0px;";
					this.videoStripSetting.titleLeftStyle = "style='position:relative;top: -40px;left:53px;text-decoration: none;color: " + this.videoStripSetting.titleVideoColor + ";" + this.videoStripSetting.titleLinkStyle + "'";
					this.buildCube = "font-family:verdana;background-color: " + this.backgroundColorCode + ";float: left;" +
                        "width: 190px;height: 36px;padding: 1px 5px 2px 9px;font-size: 10px";
				}


				this.videoStripSetting.buildCubeLast = this.buildCube;



				this.duration = "display: inline;font-size: 10px;padding-left:5px;";


				this.videoStripSetting.addLogoLeft = this.videoStripSetting.displayFooter ? (this.videoStripSetting.leftSeperator + "<div style='background-color:" + this.backgroundColorCode + ";width:57px;_width:56px;height:39px;float: left;'><a href='http://www.5min.com' target='new' style='text-decoration:none;'><img style='margin:0;padding:0;' src='" + fivMin_shared + "/Graphics/VideoSeed/" + this.videoStripSetting.leftLogoColor + "logo_468X60.png' width='55' height='38' border='0'></a></div>") : "";

				break;
			case "120X120":
				// set wrapper
				this.videoStripSetting.isUpperTitle = true;

				stripPixelstr = (BrowserDetect.version == "6" && BrowserDetect.browser == "Explorer") ? "Strip_120X120.gif" : "Strip_120X120.png";
				trigPixelstr = (BrowserDetect.version == "6" && BrowserDetect.browser == "Explorer") ? "Trig_120X120.gif" : "Trig_120X120.png";


				// set header
				stripPixel = this.backgroundColor + "" + this.headerColor + stripPixelstr;
				arrowHeader = this.backgroundColor + "" + this.headerColor + trigPixelstr;

				//stripPixel = backGroundHeaderColor + "Strip_120X120.png";
				stripPixelHeight = 22;
				stripPixelLineHeight = "15px";
				stripPixelWidth = "110px";
				//arrowHeader = backGroundHeaderColor + "Trig_120x120.png";
				titleFontWeight = "11px";
				photoHeight = "53px";
				photoWidth = "72px";

				playButtonSize = "18";
				playButtonName = (BrowserDetect.version == "6" && BrowserDetect.browser == "Explorer") ? "play_18X18.gif" : "play_18X18.png";
				this.videoStripSetting.title = this.title.substring(0, 14);

				if (!this.videoStripSetting.displayHeader)
					wrapperHeight = stripPixelHeight * -1;

				wrapperHeight += 118;

				// set cube

				this.videoStripSetting.titleLeftStyle = '';
				this.duration = "position:absolute;font-size: 9px;";
				this.videoStripSetting.wrapperDuration = "position:relative;top:-20px;";


				// set video title
				videoDivTitleStyle = "height:36px;width:107px;overflow:hidden;color:#026799;";
				this.videoStripSetting.titleLinkStyle = "font-family:verdana;font-weight:normal;font-size:10px;overflow:hidden;";
				this.videoStripSetting.durationInline = "position:relative;font-family:verdana;font-size: 9px;font-weight:bold;";

				if (navigator.appName == "Microsoft Internet Explorer" && BrowserDetect.version != "8") {
					this.wrapperWidth = 118 + "px";
					positionPlay = "position: relative;left: 50px;top: -1px;border: 0px;";
					this.buildCube = "font-family:verdana;background-color: " + this.backgroundColorCode + ";" +
                        "width: 107px;height: 91px;padding: 2px 6px 3px 5px;font-size: 10px;";

					this.videoStripSetting.durationInline += "top:8px;left:60px";
				}
				else {
					this.wrapperWidth = 118 + "px";
					positionPlay = "position: relative;left: 53px;top: -2px;border: 0px;";
					this.buildCube = "font-family:verdana;background-color: " + this.backgroundColorCode + ";" +
                        "width: 107px;height: 91px;padding: 2px 6px 3px 5px;font-size: 10px;";
					this.videoStripSetting.durationInline += "left:80px;top:-10px;";
				}

				this.videoStripSetting.buildCubeLast = this.buildCube;

				break;
			case "300X250":
			case "250X250":
				var is250x250 = this.layout == "250X250" ? true : false;

				this.videoStripSetting.isUpperTitle = false;

				stripPixel = this.backgroundColor + "" + this.headerColor + stripPixelstr;
				arrowHeader = this.backgroundColor + "" + this.headerColor + trigPixelstr;
				stripPixelHeight = 30;
				stripPixelLineHeight = "26px";
				titleFontWeight = "12px";
				photoHeight = "72px";
				photoWidth = "95px";

				playButtonSize = "28";
				playButtonName = (BrowserDetect.version == "6" && BrowserDetect.browser == "Explorer") ? "play_28X28.gif" : "play_28X28.png";
				this.videoStripSetting.title = this.title.substring(0, 21);

				videoDivTitleStyle = "position: absolute;height: 45px;width:" + (is250x250 ? "125px" : "170px") + ";font-size: 12px;";
				this.videoStripSetting.titleLeftStyle = '';

				if (!this.videoStripSetting.displayHeader)
					wrapperHeight = stripPixelHeight * -1;

				this.videoStripSetting.titleLinkStyle = "position:relative;height: 45px;width:" + (is250x250 ? "125px" : "170px") + ";display:block;overflow:hidden;font-family:verdana;font-size:12px;font-weight:normal;";

				wrapperHeight += this.videoCount * 96 + 56;

				if (navigator.appName == "Microsoft Internet Explorer" && BrowserDetect.version != "8") {
					this.wrapperWidth = is250x250 ? 248 : 298;
					this.buildCube = "font-family:verdana;background-color: " + this.backgroundColorCode + ";" +
                                        "width:" + (is250x250 ? "228px" : "278px") + ";height: 76px;padding: 4px 10px 4px 10px;font-size: 10px";
					positionPlay = "position: relative;left: -33px;top: 42px;border: 0px;";
					this.videoStripSetting.titleLeftStyle = "style='position:relative;left:10px;text-decoration: none;color: " + this.videoStripSetting.titleVideoColor + ";" + this.videoStripSetting.titleLinkStyle + "'";
					this.seperator = "<div style='background-image: url(" + fivMin_shared + "/Graphics/VideoSeed/" + this.backgroundColor + "Seperator_160X600.png);background-repeat: repeat-x;" +
                                        "background-position: top ;width:" + (this.wrapperWidth) + "px;height:12px;font-size:0px;'></div>";
					this.footer = "<div style='clear:both'></div>" + this.seperator +
                                        "<div style='position:relative;z-index:10;background-color: " + this.backgroundColorCode + ";font-size:13px;width:" + this.wrapperWidth + "px;height:26px;" +
                                        "background-position: top;font-family:Verdana;font-weight:bolder;'>" +
                                        "<div style='padding-left:10px;line-height:24px;'><span style='color:" + this.colorText + ";'>By 5min</span> <span style='color:" + this.footerVideoPediaColor + "'>Life Videopedia</span></div></div>";
				}
				else {
					this.wrapperWidth = is250x250 ? "248px" : "298px";
					this.buildCube = "font-family:verdana;background-color: " + this.backgroundColorCode + ";" +
                                        "width:" + (is250x250 ? "228px" : "278px") + ";height: 76px;padding: 4px 10px 4px 10px;font-size: 10px";
					positionPlay = "position: relative;left: 67px;top: -32px;border: 0px;";
					this.videoStripSetting.titleLeftStyle = "style='position:relative;top: -77px;left:105px;text-decoration: none;color: " + this.videoStripSetting.titleVideoColor + ";" + this.videoStripSetting.titleLinkStyle + "'";
					this.seperator = "<div style='background-image: url(" + fivMin_shared + "/Graphics/VideoSeed/" + this.backgroundColor + "Seperator_160X600.png);background-repeat: repeat-x;" +
                                        "background-position: top ;width:" + this.wrapperWidth + ";height:12px;font-size:0px;'></div>";
					this.footer = "<div style='clear:both'></div>" + this.seperator +
                                        "<div style='background-color: " + this.backgroundColorCode + ";font-size:13px;width:" + this.wrapperWidth + ";height:26px;" +
                                        "background-position: top;font-family:Verdana;font-weight:bolder;'>" +
                                        "<a href='http://www.5min.com' target='_new'><div style='padding-left:10px;line-height:25px;position:relative;z-index:10;'><span style='color:" + this.colorText + ";'>By 5min</span> <span style='color:" + this.footerVideoPediaColor + "'>Life Videopedia</span></div></a></div>";
				}

				this.videoStripSetting.buildCubeLast = this.buildCube;
				this.duration = "display: inline;font-size: 9px;font-weight: bold;padding-left:10px;";




				break;


			case "160X600":
				this.videoStripSetting.isUpperTitle = true;

				// set header
				stripPixel = this.backgroundColor + "" + this.headerColor + stripPixelstr;
				arrowHeader = this.backgroundColor + "" + this.headerColor + trigPixelstr;

				stripPixelHeight = 30;
				stripPixelLineHeight = "26px";
				stripPixelWidth = "690px";
				titleFontWeight = "12px";
				playButtonSize = "22";
				playButtonName = (BrowserDetect.version == "6" && BrowserDetect.browser == "Explorer") ? "play_22X22.gif" : "play_22X22.png";
				photoHeight = "60px";
				photoWidth = "83px";
				this.videoStripSetting.title = this.title.substring(0, 16);
				this.videoStripSetting.titleLinkStyle = "font-size:10px;font-weight:normal;";

				if (!this.videoStripSetting.displayHeader)
					wrapperHeight = stripPixelHeight * -1;


				this.seperator = "<div style='background-image: url(" + fivMin_shared + "/Graphics/VideoSeed/" + this.backgroundColor + "Seperator_160X600.png);background-repeat: repeat-x;" +
                                "background-position: top ;width:158px;height:12px;font-size:0px;'></div>";
				// set video title
				videoDivTitleStyle = "position:relative;height: 25px;width: 135px;display:block;overflow:hidden;color:#026799;";

				this.duration = "position:absolute;font-size: 9px;padding-left: 3px;font-weight: bold;";
				this.videoStripSetting.wrapperDuration = "position:relative;top:-25px;";


				if (navigator.appName == "Microsoft Internet Explorer" && BrowserDetect.version != "8") {
					this.wrapperWidth = "158px";
					wrapperFooterWidth = "158px;"

					wrapperHeight += this.videoCount * 116 + 18 + "px";
					// set cube
					this.buildCube = "font-family:verdana;background-color: " + this.backgroundColorCode + ";font-family: Verdana;" +
                            "width: 138px;height: 94px;padding: 2px 10px 2px 10px;font-size: 10px;";

					this.videoStripSetting.buildCubeLast = this.buildCube;
					positionPlay = "position: relative;left: 58px;top: 0px;border: 0px;";
					this.videoStripSetting.durationInline = "position:relative;top:10px;left:65px;";
				}
				else {
					this.wrapperWidth = "158px";
					wrapperFooterWidth = "158px;"
					wrapperHeight += this.videoCount * 110 + 48 + "px";
					positionPlay = "position: relative;left: 61px;top: -2px;border: 0px;";

					// set cube
					this.buildCube = "font-family:verdana;background-color: " + this.backgroundColorCode + ";font-family: Verdana;" +
                            "width: 138px;height: 94px;padding: 2px 10px 2px 10px;font-size: 10px;";

					this.videoStripSetting.buildCubeLast = this.buildCube;
					this.videoStripSetting.durationInline = "position:relative;left:88px;top: -10px;";
				}

				this.videoStripSetting.durationInline += "font-size: 9px;font-family:verdana;";

				// Set Footer
				this.footer = "<div style='clear:both'></div>" + this.seperator +
                            "<div style='background-color: " + this.backgroundColorCode + ";font-size:10px;width:" + wrapperFooterWidth + ";" +
                            "font-family:Verdana;font-weight:bolder;height:18px;line-height:18px;position:relative;z-index:10;'>" +
                            "<a href='http://www.5min.com' target='new' style='text-decoration:none;'><span style='color:" + this.colorText + ";font-family:Verdana;font-weight:bolder;font-size:10px;margin-left:10px;'>By 5min</span> <span style='font-family:Verdana;font-weight:bolder;font-size:10px;color:" + this.footerVideoPediaColor + "'>Life Videopedia</span></a></div>";
				break;

		}


		this.buildWrapper = "width:" + this.wrapperWidth + ";color:" + this.colorText + ";text-align:left;line-height:normal;";

		if (this.videoStripSetting.displayBorder)
			this.buildWrapper += "border:solid 1px " + this.wrapperColor + ";";

		headerStrip = "float:left;background-image: url(" + fivMin_shared + "/Graphics/VideoSeed/" + stripPixel + ");" +
                         "background-repeat: repeat-x;background-position: top right;width:100%;overflow:hidden;height:" + stripPixelHeight + "px;line-height:" + stripPixelLineHeight + ";";

		headerLeftArrow = "float:left;background-image: url(" + fivMin_shared + "/Graphics/VideoSeed/" + arrowHeader + ");background-repeat: no-repeat;" +
                              "background-position: top left;width:" + headerLeftArrowWidth + " ;height:" + stripPixelHeight + "px;";

		headertitle = "<span style='color:" + this.titleColor + ";font-size:" + titleFontWeight + ";padding-left:3px;font-weight:bold;font-family:verdana;float:left;' id='Fivemin_title_" + this.parentDiv + "'>" + this.videoStripSetting.title + "</span>"

		playImageCode = "<img style='cursor:pointer;margin:0;padding:0;background-color:transparent;" + positionPlay + "' height=" + playButtonSize + " width=" + playButtonSize + " src='" + fivMin_shared + "/Graphics/VideoSeed/" + playButtonName + "'/>";
		// set photo size
		photoStyle += "border: 1px solid #000000;height: " + photoHeight + ";width: " + photoWidth + ";margin:0;padding:0;";
	};

	this.BackgroundColors = function() {

		this.wrapperColor = "#999999";

		switch (this.backgroundColor.toLowerCase()) {
			case "grey":
				this.backgroundColorCode = "#F3F3F3";
				this.wrapperColor = "#999999";
				this.videoStripSetting.titleVideoColor = "#026799";
				this.videoStripSetting.leftSeperatorColor = "#F3F3F3";
				//this.videoStripSetting.leftSeperatorColor = "#E2E2E2";
				this.colorText = "#026799";
				this.videoStripSetting.leftLogoColor = "grey";
				this.backgroundColor = "grey";
				break;
			case "black":
				this.backgroundColorCode = "#414141";
				this.wrapperColor = "#000000";
				this.colorText = "#FFFFFF";
				//this.headerColor ="black";
				this.videoStripSetting.titleVideoColor = "#FFFFFF";
				this.videoStripSetting.leftSeperatorColor = "#414141";
				//this.videoStripSetting.leftSeperatorColor = "#000000";
				this.videoStripSetting.leftLogoColor = "black";
				this.backgroundColor = "black";
				break;
			case "white":
				this.backgroundColorCode = "#FFFFFF";
				this.wrapperColor = "#9B9B9B";
				this.backgroundColor = "white";
				this.colorText = "#026799";
				this.videoStripSetting.titleVideoColor = "#026799";
				this.videoStripSetting.leftSeperatorColor = "#FFFFFF";
				//this.videoStripSetting.leftSeperatorColor = "#F3F3F3";
				this.videoStripSetting.leftLogoColor = "white";
				break;

			default:
				this.backgroundColorCode = "#F3F3F3";
				this.wrapperColor = "#999999";
				this.backgroundColor = "grey";
				this.colorText = "#026799";
				this.videoStripSetting.titleVideoColor = "#026799";
				this.videoStripSetting.leftSeperatorColor = "#F3F3F3";
				break;
		}

		if (this.headerColor == "red" || this.headerColor == "green" || this.headerColor == "black")
			this.titleColor = "#FFFFFF";
		else
			this.titleColor = "#000000";




	};

	this.draw = function() {
		if (this.videoStripSetting.videosResults == undefined) return;
		this.initVariables();
		// Init Variables for layout


		this.SetLayoutVars(this.videoStripSetting.videoResultsLenth);
		this.videosStripControl = "<style media='screen' type='text/css'>a.fivemin_ref{text-decoration:none;}a.fivemin_ref:hover{text-decoration:underline;}a.fivemin_ref:visited{color:#551a8b;}</style>\n";
		//Build wrapper

		// if IE6 we used transparent iframe to prevent form elemnt on the litebox
		this.videosStripControl += "<div id='FiveminWrapper_" + this.parentDiv + "' style='" + this.buildWrapper + "'>";




		// Build Header
		if (this.videoStripSetting.displayHeader)
			this.videosStripControl += this.buildHeader();



		// Build dynamic content div

		this.videosStripControl += "<div id='fiveminItems" + this.parentDiv + "' style='background-color:" + this.videoStripSetting.leftSeperatorColor + ";float:left;width:100%;overflow:hidden;'>";

		this.buildCubeBox = (this.videoStripSetting.isUpperTitle) ? this.buildUpperTitleCubeBox : this.buildRightTitleCubeBox;

		// Build video controls
		for (i = 0; i < this.videoStripSetting.videoResultsLenth; i++) {
			// Build dynamic link
			if (this.directUrl)
				this.videoStripSetting.halfLink = "<a href='" + this.directUrl.replace("[VIDEOID]", this.videoStripSetting.videosResults[i].ID) + "' target='" + this.videoStripSetting.ht + "'";
			else {
				//this.videoStripSetting.halfLink = "<a rev='width: " + (this.videoStripSetting.videosResults[i].HasCompanion ? "7" : "4") + "91px; height: 407px; scrolling: no;' rel='lyteframe' href='" + fivMin_synUrl + "/RelatedSense.aspx?videoId=" + this.videoStripSetting.videosResults[i].ID + "&sid=" + sid + this.videoStripSetting.autoStart + "&url=" + this.url + "' title='" + this.videoStripSetting.videosResults[i].Title +"'";
				this.videoStripSetting.halfLink = "<a href='javascript:vsThumbSeed[" + thumbSeedCounter + "].displayVideo(\"" + escape(this.videoStripSetting.videosResults[i].EmbededURL) + "\", \"" + escape(this.videoStripSetting.videosResults[i].Title) + "\", " + this.videoStripSetting.videosResults[i].IsFlagged + ");'";
			}

			this.videosStripControl += this.buildCubeBox(this.videoStripSetting.videosResults[i], i);
		}

		// Check to add logo on verticals strips
		if (this.videoStripSetting.addLogoLeft)
			this.videosStripControl += this.videoStripSetting.addLogoLeft;

		this.videosStripControl += "</div>";

		// Build Footer
		this.videosStripControl += this.buildFooter();

		document.getElementById(this.parentDiv.substring(1)).innerHTML = '';
		document.getElementById(this.parentDiv.substring(1)).innerHTML += this.videosStripControl;



		// Initalize FiveminLiteBox
		fivemin_initLitebox();

	};

	this.buildHeader = function() {

		var headerControl;

		headerControl = "<div>" +
                            "<div style='" + headerStrip + "'><div style='" + headerLeftArrow + "'></div>" + headertitle + " </div>" +
                        "</div><div style='clear:both;'></div>";

		return headerControl;

	};


	this.buildFooter = function() {
		var videosControl = "<div style='clear:both'></div>";

		if (this.footer && this.videoStripSetting.displayFooter)
			videosControl = this.footer;

		videosControl += "</div>";
		return videosControl;
	};

	this.buildUpperTitleCubeBox = function(video, counter) {
		var cubeStyle = (counter == this.videoStripSetting.videoResultsLenth - 1) ? this.videoStripSetting.buildCubeLast : this.buildCube;

		var linkBehavior = "onmouseover='this.style.textDecoration=\"underline\"' onmouseout='this.style.textDecoration=\"none\"'";

		var newDiv = "<div style='" + cubeStyle + "'>" +
                        "<div style='" + videoDivTitleStyle + ";' >" +
                        this.videoStripSetting.halfLink + " style='color: " + this.colorText + ";font-family:verdana;" + this.videoStripSetting.titleLinkStyle + "text-decoration:none;' " + linkBehavior + " class='fivemin_ref' title='" + encode(video.Title) + "'>" + video.WrapTitle + "</a></div>" +
                        this.videoStripSetting.halfLink + " style='text-decoration: none;'>" +
                        "<div><img style='" + photoStyle + "' src='" + video.ThumbURL + "' alt='" + encode(video.Title) + "' title='" + encode(video.Title) + "' /></a></div>" +
                        "<div style='position:absolute;'><div style='" + this.videoStripSetting.wrapperDuration + "'>" +
                        this.videoStripSetting.halfLink + " style='color:" + this.colorText + ";'>" + playImageCode + "</a>" +
                        "<div style='" + this.duration + "'><div style='" + this.videoStripSetting.durationInline + "'>" + video.Duration + "</div></div>" +
                        "</div>" +
                        "</div></div>";
		if (this.layout == "425X400") {
			if (((counter + 1) % 3 == 0)) {
				// Build seperator
				newDiv += "<div style='float:left;background: url(" + fivMin_shared + "/Graphics/VideoSeed/" + this.backgroundColor + "Fivemin425X400_spacer.gif) repeat-x;" +
                                             "width:424px;height:2px;font-size:0px;></div><div style='clear:both;'></div>";
			}
			else {
				newDiv += (counter == this.videoStripSetting.videoResultsLenth - 1) ? '' : this.videoStripSetting.leftSeperator;
				newDiv += (counter == this.videoStripSetting.videoResultsLenth - 1) ? '' : this.seperator;
			}
		}
		else {
			newDiv += (counter == this.videoStripSetting.videoResultsLenth - 1) ? '' : this.videoStripSetting.leftSeperator;
			newDiv += (counter == this.videoStripSetting.videoResultsLenth - 1) ? '' : this.seperator;
		}

		return newDiv;
	};

	this.buildRightTitleCubeBox = function(video, counter) {
		var cubeStyle = (counter == this.videoStripSetting.videoResultsLenth - 1) ? this.videoStripSetting.buildCubeLast : this.buildCube;
		var newDiv = "<div style='" + cubeStyle + "'>" +
                        this.videoStripSetting.halfLink + " style='color:" + this.colorText + ";font-family:verdana;' title='" + encode(video.Title) + "'>" +
                        "<img style='" + photoStyle + "' src='" + video.ThumbURL + "' alt='" + encode(video.Title) + "' title='" + encode(video.Title) + "' /></a>" +
                        "<div style='position: absolute;'>" +
                        this.videoStripSetting.halfLink + " style='color:" + this.colorText + ";'>" + playImageCode + "</a></div>" +
                        "<div style='" + videoDivTitleStyle + "' class='Fivemin_titleLink'>" +
                        this.videoStripSetting.halfLink + " " + this.videoStripSetting.titleLeftStyle + " class='fivemin_ref' title='" + encode(video.Title) + "'>" + video.WrapTitle + "</a>" +
                        "</div>" +
                        "<div style='" + this.duration + "'>" + video.Duration + "</div>" +
                  "</div>";
		newDiv += (counter == this.videoStripSetting.videoResultsLenth - 1) ? '' : this.videoStripSetting.leftSeperator;
		newDiv += (counter == this.videoStripSetting.videoResultsLenth - 1) ? '' : this.seperator;

		return newDiv;
	};

	this.displayVideo = function(embededURL, videoTitle, isFlagged) {
		var strPlayer = "<div style='width:" + (this.videoStripSetting.hasCompanion ? "810" : "407") + "px; height: 407px; scrolling: yes;'>" +
			"<div style='width:480px;height:401px;float:left;border:solid 1px #8E908B;'>" +
			drawPlayer(embededURL +
				"&autoStart=true&cbHtmlID1=fiveMin_displayBanner&cbFailoverUrl1=" +
				encodeURIComponent(fivMin_shared + "/Banners/G_180x150_TS_T_I.htm") +
				"&cbIsFairBalance1=true&cbWidth1=300&cbHeight1=157" +
				(this.cbCount == 2 || this.cbCount == 3 ? "&cbHtmlID2=fiveMinDummy&cbWidth2=728&cbHeight2=90" : "")) +
			"</div>";
		if (this.videoStripSetting.hasCompanion && !isFlagged) {
			strPlayer += "<div id='DisplayCompanion' style='float:left;margin-left:10px;border:solid 1px #8E908B;background-color: #414141;'>" +
                "<div id='fiveMinAdaptvCompanionDiv' style='width:300px;height:250px;'>" +
		        "</div>" +
                "<div id='fiveminSpacer'></div>" +
                "<div id='fiveMin_displayBanner'  style='width:300px;height:157px;'>" +
                "</div></div>";
		}

		// Close wrapper
		strPlayer += "</div>";


		// Insert all to LiteBox
		lb(810, 447, strPlayer, videoTitle);



	};


	drawPlayer = function(embededURL) {

		var width = 480;
		var height = 401;

		var strPlayer = "";

		strPlayer += "<object id='FiveMinEmbed' width='" + width + "' height='" + height + " 'classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'>" +
        "<param name='allowfullscreen' value='true'>" +
        "<param name='allowScriptAccess' value='always'>" +
        "<param name='movie' value='" + embededURL + "'>" +
        "<param name='wmode' value='window'>" +
        "<embed src='" + embededURL + "' type='application/x-shockwave-flash' width='" + width + "' height='" + height + "' allowfullscreen='true' " +
        "allowScriptAccess='always' wmode='window'></embed></object>";

		return strPlayer;

	}






}

var adaptvCompanionAdTag = '<scr' + 'ipt type="text/javascript">' +
                                    'google_ad_client = "pub-9769529020888159";' +
                                    '/* companion failover, WatchPage */' +
                                    'google_ad_slot = "8148616204";' +
                                    'google_ad_width = 300;' +
                                    'google_ad_height = 250;' +
                                    '</scr' + 'ipt>' +
                                    '<scr' + 'ipt type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></scr' + 'ipt>';
                                    
    

                      
