DBM.module.Video = {

	modulePath: "",

	moduleUrl: "http://www.dagbladet.no/api/kommentar/gallery/",
	reqUrl: "tv.no",
	catId: 0,


	videoinfo_init: function (mmId){
		if ( YAHOO.util.Connect.isCallInProgress(DBM.module.Common.currentRequest) ) {
			setTimeout("DBM.module.Video.videoinfo_init('" + mmId + "')", 300);
		}
		else {
			DBM.module.Common.currentTarget = "videoinfo";
			DBM.module.Common.currentLoadingTarget = "videoinfo";
			DBM.module.Common.currentCallback = this.callbackPlayer;
			DBM.util.createDiv(DBM.module.Common.currentLoadingTarget, DBM.module.Common.defaultLoadingHTML);
			DBM.module.Common.currentRequestUrl = DBM.module.Video.moduleUrl + "?op=VideoPlayerInfo&mmid="+mmId+"&requrl="+this.reqUrl;
			DBM.module.Common.currentRequest = YAHOO.util.Connect.asyncRequest('GET', DBM.module.Common.currentRequestUrl, DBM.module.Common.currentCallback);
		}
	},

	expandcollapse: function (postid){
		whichpost = document.getElementById(postid);
		if (whichpost.className=="postshown") { whichpost.className="posthidden"; }
		else { whichpost.className="postshown"; }
	},

	fbs_click: function (u,t) {

		t=document.title;
		window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent('http://go.dagbladet.no/ego.cgi/facebook/http://www.dagbladet.no/tv/index.html?clipid='+u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
		return false;
	},

	callbackPlayer: {
		  success: function(o) {
			//DBM.util.createDiv(DBM.module.Common.currentTarget, o.responseText);


			xmlDocument = o.responseXML;

			var returns = xmlDocument.getElementsByTagName('mm_id').item(0).firstChild.data;



				if (returns != undefined){


					var mmid = xmlDocument.getElementsByTagName('mm_id').item(0).firstChild.data;
					var caption = xmlDocument.getElementsByTagName('caption').item(0).firstChild.data;
					
					var string = "", i = 0, c = c1 = c2 = 0;
	 
				    while ( i < caption.length ) {
				        c = caption.charCodeAt(i);
				        if (c < 128) {
				            string += String.fromCharCode(c);
				            i++;
				        } else if((c > 191) && (c < 224)) {
				            c2 = caption.charCodeAt(i+1);
				            string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
				            i += 2;
				        } else {
				            c2 = caption.charCodeAt(i+1);
				            c3 = caption.charCodeAt(i+2);
				            string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
				            i += 3;
				        }
				    }
				    caption = string;
					
					
					var lsRegExp = /\+/g;
					caption = unescape(String(caption).replace(lsRegExp, " "));
					var description = xmlDocument.getElementsByTagName('description').item(0).firstChild.data
					description = unescape(description);
					var lsRegExp = /\+/g;
  					description = unescape(String(description).replace(lsRegExp, " "));

					var duration = xmlDocument.getElementsByTagName('duration').item(0).firstChild.data;
					var viewedtimes = xmlDocument.getElementsByTagName('viewedtimes').item(0).firstChild.data;
					var uploadedtime = xmlDocument.getElementsByTagName('uploadedtime').item(0).firstChild.data;
					var rating = xmlDocument.getElementsByTagName('rating').item(0).firstChild.data;
					var votes = xmlDocument.getElementsByTagName('votes').item(0).firstChild.data;

					var contentid = xmlDocument.getElementsByTagName('contentid').item(0).firstChild.data;
					var nrvotes = xmlDocument.getElementsByTagName('nrvotes').item(0).firstChild.data;
					var visbraing = xmlDocument.getElementsByTagName('visbraing').item(0).firstChild.data;
					var opphav = xmlDocument.getElementsByTagName('origin').item(0).firstChild.data;


					var comments = xmlDocument.getElementsByTagName('comments').item(0).firstChild.data;
					//var comments = 'feil';
					var category = xmlDocument.getElementsByTagName('category').item(0).firstChild.data;
					var ownername = xmlDocument.getElementsByTagName('ownername').item(0).firstChild.data;

					if (xmlDocument.getElementsByTagName('article').item(0).firstChild.data != undefined){
						var article = xmlDocument.getElementsByTagName('article').item(0).firstChild.data;
					}
					else {
						var article =  "";
					}
					var requrl = xmlDocument.getElementsByTagName('requrl').item(0).firstChild.data;
					var ownerid = xmlDocument.getElementsByTagName('ownerid').item(0).firstChild.data;
					var photo = xmlDocument.getElementsByTagName('photo').item(0).firstChild.data;
					if (photo == 1){
						var photoUrl = xmlDocument.getElementsByTagName('photoUrl').item(0).firstChild.data;
					}

					var html = "";

					// 14.1.2009 Blir det feil med denne alltid på?
					if (1){
					//if (requrl == "tv"){
						
						//ny 14.1.2009
						
						

						DBM.util.createDiv("playertitle", caption);
						//html = html +"<h1 id='videoplayercaption'>"+caption+"</h1>";

						if (ownername != "DagbladetTV"){
							html = html + "<p>"+description.substring(0, 100)+"...</p>";
						}
						else {

								html = html + "<span id='videoplayerdescription'>"+description+"</span>";

						}
						//html = html + "<p><a href=\"#comments\" onClick=\"javascript:SkjulVisInnhold('videodrawer')\">"+comments+" kommentarer</a>";
						
						if (opphav != "0"){
												
							html = html + "<p>Kilde: " + opphav + " ";
						
						}
						
						
						html = html + "<p>";
						if (article != 0){
							html = html + " <a href=\"http://go.dagbladet.no/ego.cgi/vhoyre/"+article+"\">Les artikkelen</a>";
						}

						document.getElementById('fb_desc').content = caption;
						//document.getElementById('fb_thumb').href = 'http://blink.dagbladet.no/video/thumb.php?v=' + mmid ;
						document.getElementById('fb_thumb').href = 'http://gfx.dagbladet.no/video/splash/ani_'+mmid+'_240.jpg' ;
						html = html + '<meta name="title" content="'+ caption +'" /><meta name="description" content="Se denne! " />';
						//html = html + '<link rel="image_src" href="http://blink.dagbladet.no/video/thumb.php?v='+ mmid +'" />';
						html = html + '<link rel="image_src" href="http://gfx.dagbladet.no/video/splash/ani_'+mmid+'_240.jpg" />';
						html = html + '<style> html .fb_share_link { padding:2px 0 0 20px; height:16px; background:url(http://static.ak.facebook.com/images/share/facebook_share_icon.gif?11:26981) no-repeat top left; }</style>';
						html = html +' <a href="#" onclick=" return DBM.module.Video.fbs_click('+ mmid +',\''+ caption +'\')" target="_blank" class="fb_share_link">Del på facebook</a></p>';
					}
					else {

						html = html +"<form><input type='hidden' id='videoplayercaption' value='"+caption+"'><input type='hidden' id='videoplayerdescription' value='"+description+"'></form>";
					}



					if (ownerid != 0){
						
						html = html + "<p>Lagt til "+uploadedtime+" av <a href=\"http://blink.dagbladet.no/profil/?op=ViewProfile&userId="+ownerid+"\">"+ownername+"</a> - <a href =\"http://blink.dagbladet.no/video/index.php5?op=VideosUserIndex&uid="+ownerid+"\">FLERE FRA DENNE BRUKEREN<br></a>";
						html = html + "Varighet: "+duration+", Vist: "+viewedtimes+" ganger  - <a id=\"linky\" title=\"Denne tjenesten tilbys av Dagbladet.no. <br> Musikken er gjengitt med tillatelse fra TONO/NCB. <br> Det kan opprettes en privat lenke til materialet fra <br> norske, private, ikke-kommersielle websider, <br> forutsatt at den lenkende webside legger ut <br>denne teksten sammen med lenken.\" href=\"http://go.dagbladet.no/ego.cgi/vhoyre/http://www.tono.no\">Tono</a>/<a id=\"linky2\" title=\"Denne tjenesten tilbys av Dagbladet.no. <br> Musikken er gjengitt med tillatelse fra TONO/NCB. <br> Det kan opprettes en privat lenke til materialet fra <br> norske, private, ikke-kommersielle websider, <br> forutsatt at den lenkende webside legger ut <br>denne teksten sammen med lenken.\" href=\"http://go.dagbladet.no/ego.cgi/vhoyre/http://www.ncb.dk\">NCB</a></p>";

					}
					
					else {				
						
						
						html = html + "<p>Lagt til "+uploadedtime+" av <a href=\"http://go.dagbladet.no/ego.cgi/vhoyre/http://www.dagbladet.no/tv/\">"+ownername+"</a> - <a id=\"linky\" title=\"Denne tjenesten tilbys av Dagbladet.no. <br> Musikken er gjengitt med tillatelse fra TONO/NCB. <br> Det kan opprettes en privat lenke til materialet fra <br> norske, private, ikke-kommersielle websider, <br> forutsatt at den lenkende webside legger ut <br>denne teksten sammen med lenken.\" href=\"http://go.dagbladet.no/ego.cgi/vhoyre/http://www.tono.no\">Tono</a>/<a id=\"linky2\" title=\"Denne tjenesten tilbys av Dagbladet.no. <br> Musikken er gjengitt med tillatelse fra TONO/NCB. <br> Det kan opprettes en privat lenke til materialet fra <br> norske, private, ikke-kommersielle websider, <br> forutsatt at den lenkende webside legger ut <br>denne teksten sammen med lenken.\" href=\"http://go.dagbladet.no/ego.cgi/vhoyre/http://www.ncb.dk\">NCB</a><br>";
						html = html + "Varighet: "+duration+", Vist: "+viewedtimes+" ganger</p>";
					}

					visbraing = 'yes';

					// hack for å fjerne braing på utvalgte
					if (mmid == 24137 || mmid == 23853 || mmid == 23742 || mmid == 23743 || mmid == 23759) {
						visbraing = 'no';
					}

					if(visbraing == 'yes'){


						html = html + "<p class='braing'><span id='contentvotecount' class='anbefalinger-count'> <a style='float:right;' href='javascript:showPanel();' onclick='javascript:showPanel();'>    Tips en venn </a>   "+ nrvotes +"</span> anbefalinger &nbsp;&#124;&nbsp;<a href='#' class='anbefal' onclick='javascript:DBM.module.Contents.addContentVote(\"addvote_form\",true);return false;'>Anbefal</a>  </p> ";

						html = html + "<div class='collapse' style='margin-top:0;' id='vote_error'></div>";
						html = html + "<form id='addvote_form' name='addvote_form' action='' method='POST'>";
						html = html + "<input type='hidden' name='op' value='AddContentVote'>";
						html = html + "<input type='hidden' name='contentid' id='contentid' value='"+contentid+"'>";
						html = html + "</form>";
					}

					html = html + "<form name=\"urlForm\" id=\"urlForm\">";

					html = html + "<table>";
					html = html + "<tbody><tr>";
					
					html = html + '<input type="hidden" id="hiddenclipid" value="' + mmid+ '">'
					//html = html + '<input type="hidden" id="videoplayercaption" value="' + caption + '">'

					// fjerna 02.10.07
					//html = html + "<input name=\"video_link\" value=\"http://www.dagbladet.no/tv/index.html?clipid="+mmid+"\" onclick=\"javascript:document.urlForm.video_link.focus();document.urlForm.video_link.select();\" readonly=\"true\" type=\"text\"></td>";
					html = html + "<td>Legg på din side: ";

					//html = html + "<input name=\"embed_code\" value=\"<iframe src='http://www.dagbladet.no/tv/videospiller/player_v2_embed.php?id="+mmid+"' width='960' height='540' frameborder='0' scrolling='no'></iframe>\" onclick=\"javascript:document.urlForm.embed_code.focus();document.urlForm.embed_code.select();\" readonly=\"true\" type=\"text\"></td>";
					html = html + '<input name=\'embed_code\' value=\'<iframe src="http://www.dagbladet.no/tv/videospiller/player_v2_embed.php?id='+mmid+'&w=512&h=288&autoplay=0&playerBorder=0" width="512" height="288" frameborder="0" marginheight="0" marginwidth="0" scrolling="no"></iframe> \' onclick="javascript:document.urlForm.embed_code.focus();document.urlForm.embed_code.select();" readonly="true" type="text"></td>';
					html = html + "<td><a href='http://www.dagbladet.no/tv/index.html?clipid="+mmid+"'>Permalink</a>";

					html = html + "</tr>";
					html = html + "</tbody></table>";
					html = html + "</form>";

					var tags = xmlDocument.getElementsByTagName('tag');
					html = html + "<p class=\"tags\"><b>Tags: </b>";
					for (i = 0; i <= (tags.length-1); i++) {

						html = html + "<a href=\"http://go.dagbladet.no/ego.cgi/vhoyre/http://www.dagbladet.no/tv/tags.html?tag="+escape(tags.item(i).firstChild.data)+"&offset=0\">"+tags.item(i).firstChild.data+"</a> ";

//					FJERNET 2.10.2007
//						if (tags.item(i).firstChild.data == "spill"){
//							document.getElementById("infobottom").innerHTML = '<a href="http://go.dagbladet.no/ego.cgi/vhoyre/http://www.dagbladet.no/tv/tags.html?tag=spill&offset=0">Se flere spillvideoer her</a>';
//						}
					}


					if (requrl == "tv"){
						var element = document.getElementById('contentvotecount');
						if (element){
							element.innerHTML = nrvotes;
							document.getElementById('contentid').value = contentid;
						}
					}




					html = html + "</p>";

//					FJERNET 2.10.2007

//					if (category != 0){
//						document.getElementById("category_label").innerHTML = category+":";
//					}
//					else {
//						document.getElementById("category_label").innerHTML = "";
//					}


//					if (ownername != "DagbladetTV"){
//						document.getElementById("tab03focus").innerHTML = "Flere fra " +ownername;
//						document.getElementById("tab03ready").innerHTML = "Flere fra " +ownername;
//					}

					DBM.util.createDiv("videoinfo", html);

				}

		  	DBM.module.Common.defaultCallback.success(o);

		  },
		  failure: function(o) {
		  	DBM.module.Common.defaultCallback.failure(o);

		  },
		  timeout: DBM.module.Common.timeout
	},

	videoinfo_initByViews: function (mmId) {

		if ( YAHOO.util.Connect.isCallInProgress(DBM.module.Common.currentRequest) ) {
			setTimeout("DBM.module.Video.videoinfo_initByViews('" + mmId + "')", 300);
		}
		else {
			DBM.module.Common.currentTarget = "content01";
			DBM.module.Common.currentLoadingTarget = "content01";
			DBM.module.Common.currentCallback = this.callbackByViews;
			DBM.util.createDiv(DBM.module.Common.currentLoadingTarget, DBM.module.Common.defaultLoadingHTML);
			DBM.module.Common.currentRequestUrl = DBM.module.Video.moduleUrl + "?op=VideoCategoryInfo&sort=views&mmid="+mmId+"&catid="+this.catId;
			DBM.module.Common.currentRequest = YAHOO.util.Connect.asyncRequest('GET', DBM.module.Common.currentRequestUrl, DBM.module.Common.currentCallback);
		}

	},

	videoinfo_initByRating: function (mmId) {

		if ( YAHOO.util.Connect.isCallInProgress(DBM.module.Common.currentRequest) ) {
			setTimeout("DBM.module.Video.videoinfo_initByRating('" + mmId + "')", 300);
		}
		else {
			DBM.module.Common.currentTarget = "content02";
			DBM.module.Common.currentLoadingTarget = "content02";
			DBM.module.Common.currentCallback = this.callbackByRating;
			DBM.util.createDiv(DBM.module.Common.currentLoadingTarget, DBM.module.Common.defaultLoadingHTML);
			DBM.module.Common.currentRequestUrl = DBM.module.Video.moduleUrl + "?op=VideoCategoryInfo&sort=rating&mmid="+mmId+"&catid="+this.catId;
			DBM.module.Common.currentRequest = YAHOO.util.Connect.asyncRequest('GET', DBM.module.Common.currentRequestUrl, DBM.module.Common.currentCallback);
		}

	},

	videoinfo_initByUpload: function (mmId) {

		if ( YAHOO.util.Connect.isCallInProgress(DBM.module.Common.currentRequest) ) {
			setTimeout("DBM.module.Video.videoinfo_initByUpload('" + mmId + "')", 300);
		}
		else {
			DBM.module.Common.currentTarget = "content03";
			DBM.module.Common.currentLoadingTarget = "content03";
			DBM.module.Common.currentCallback = this.callbackByUpload;
			DBM.util.createDiv(DBM.module.Common.currentLoadingTarget, DBM.module.Common.defaultLoadingHTML);
			DBM.module.Common.currentRequestUrl = DBM.module.Video.moduleUrl + "?op=VideoCategoryInfo&sort=upload&mmid="+mmId+"&catid="+this.catId;
			DBM.module.Common.currentRequest = YAHOO.util.Connect.asyncRequest('GET', DBM.module.Common.currentRequestUrl, DBM.module.Common.currentCallback);
		}

	},

	callbackByViews: {
		  success: function(o) {
			//DBM.util.createDiv(DBM.module.Common.currentTarget, o.responseText);

			xmlDocument = o.responseXML;

			var html = "<a name=\"domtab1\" id=\"domtab1\"></a><table class=\"listing\">";

			var objs = xmlDocument.getElementsByTagName('obj');

			for (i = 0; i <= (objs.length-1); i++) {

				var mmid = xmlDocument.getElementsByTagName('mm_id').item(i).firstChild.data;
				var caption = xmlDocument.getElementsByTagName('caption').item(i).firstChild.data;
				var duration = xmlDocument.getElementsByTagName('duration').item(i).firstChild.data;
				var viewedtimes = xmlDocument.getElementsByTagName('viewedtimes').item(i).firstChild.data;
				var uploadedtime = xmlDocument.getElementsByTagName('uploadedtime').item(i).firstChild.data;
				var rating = xmlDocument.getElementsByTagName('rating').item(i).firstChild.data;
				var votes = xmlDocument.getElementsByTagName('votes').item(i).firstChild.data;

				//html = html + "<tr><td><a href=\"http://go.dagbladet.no/ego.cgi/vhoyre/http://www.dagbladet.no/tv/index.html?type=fbig&clipid="+mmid+"\" title=\"Klikk for å se videoen\" class=\"bgrfix\"><img src=\"http://dagbladet.xstream.dk/api/GetThumbnail.php?ClipId="+mmid+"\" class=\"thumb\" title=\"Klikk for å se videoen\" alt=\"Klikk for å se videoen\" /><h2>"+caption+"</h2><ul><li>Varighet: "+duration+", lagt til: "+uploadedtime+"</li><li>Vist: "+viewedtimes+" ganger</li></ul><img src=\"http://gfx.dagbladet.no/rating/"+rating+".png\" class=\"rating\" alt=\""+rating+" av 5 stjerner - "+votes+" stemmer\" title=\""+rating+" av 5 stjerner - "+votes+" stemmer\" /></a></td></tr>";
				html = html + "<tr><td><a href=\"http://go.dagbladet.no/ego.cgi/vhoyre/http://www.dagbladet.no/tv/index.html?type=fbig&clipid="+mmid+"\" title=\"Klikk for å se videoen\" class=\"bgrfix\"><img src=\"http://dagbladet.xstream.dk/api/GetThumbnail.php?ClipId="+mmid+"\" class=\"thumb\" title=\"Klikk for å se videoen\" alt=\"Klikk for å se videoen\" /><h2>"+caption+"</h2><ul><li>Varighet: "+duration+", lagt til: "+uploadedtime+"</li><li>Vist: "+viewedtimes+" ganger</li></ul><img src=\"http://gfx.dagbladet.no/kommentarer/hand.gif\" border=\"0\" alt=\""+votes+" stemmer\" title=\""+votes+" stemmer\" /> "+votes+" anbefalinger</a></td></tr>";
			}

			html = html + "</table>";

			//DBM.util.createDiv(DBM.module.Common.currentTarget, html);
			DBM.util.createDiv("content01", html);


		  	DBM.module.Common.defaultCallback.success(o);
		  },
		  failure: function(o) {
		  	DBM.module.Common.defaultCallback.failure(o);
		  },
		  timeout: DBM.module.Common.timeout
	},

	callbackByRating: {
		  success: function(o) {
			//DBM.util.createDiv(DBM.module.Common.currentTarget, o.responseText);



			xmlDocument = o.responseXML;

			var html = "<a name=\"domtab2\" id=\"domtab2\"></a><table class=\"listing\">";

			var objs = xmlDocument.getElementsByTagName('obj');

			for (i = 0; i <= (objs.length-1); i++) {

				var mmid = xmlDocument.getElementsByTagName('mm_id').item(i).firstChild.data;
				var caption = xmlDocument.getElementsByTagName('caption').item(i).firstChild.data;
				var duration = xmlDocument.getElementsByTagName('duration').item(i).firstChild.data;
				var viewedtimes = xmlDocument.getElementsByTagName('viewedtimes').item(i).firstChild.data;
				var uploadedtime = xmlDocument.getElementsByTagName('uploadedtime').item(i).firstChild.data;
				var rating = xmlDocument.getElementsByTagName('rating').item(i).firstChild.data;
				var votes = xmlDocument.getElementsByTagName('votes').item(i).firstChild.data;

				//html = html + "<tr><td><a href=\"http://go.dagbladet.no/ego.cgi/vhoyre/http://www.dagbladet.no/tv/index.html?type=fbig&clipid="+mmid+"\" title=\"Klikk for å se videoen\" class=\"bgrfix\"><img src=\"http://dagbladet.xstream.dk/api/GetThumbnail.php?ClipId="+mmid+"\" class=\"thumb\" title=\"Klikk for å se videoen\" alt=\"Klikk for å se videoen\" /><h2>"+caption+"</h2><ul><li>Varighet: "+duration+", lagt til: "+uploadedtime+"</li><li>Vist: "+viewedtimes+" ganger</li></ul><img src=\"http://gfx.dagbladet.no/rating/"+rating+".png\" class=\"rating\" alt=\""+rating+" av 5 stjerner - "+votes+" stemmer\" title=\""+rating+" av 5 stjerner - "+votes+" stemmer\" /></a></td></tr>";
				html = html + "<tr><td><a href=\"http://go.dagbladet.no/ego.cgi/vhoyre/http://www.dagbladet.no/tv/index.html?type=fbig&clipid="+mmid+"\" title=\"Klikk for å se videoen\" class=\"bgrfix\"><img src=\"http://dagbladet.xstream.dk/api/GetThumbnail.php?ClipId="+mmid+"\" class=\"thumb\" title=\"Klikk for å se videoen\" alt=\"Klikk for å se videoen\" /><h2>"+caption+"</h2><ul><li>Varighet: "+duration+", lagt til: "+uploadedtime+"</li><li>Vist: "+viewedtimes+" ganger</li></ul><img src=\"http://gfx.dagbladet.no/kommentarer/hand.gif\" border=\"0\" alt=\""+votes+" stemmer\" title=\""+votes+" stemmer\" /> "+votes+" anbefalinger</a></td></tr>";
			}

			html = html + "</table>";

			//DBM.util.createDiv(DBM.module.Common.currentTarget, html);
			DBM.util.createDiv("content02", html);

		  	DBM.module.Common.defaultCallback.success(o);
		  },
		  failure: function(o) {
		  	DBM.module.Common.defaultCallback.failure(o);
		  },
		  timeout: DBM.module.Common.timeout
	},

	callbackByUpload: {
		  success: function(o) {
			//DBM.util.createDiv(DBM.module.Common.currentTarget, o.responseText);


			xmlDocument = o.responseXML;

			var html = "<a name=\"domtab3\" id=\"domtab3\"></a><table class=\"listing\">";

			var objs = xmlDocument.getElementsByTagName('obj');


			for (i = 0; i <= (objs.length-1); i++) {

				var mmid = xmlDocument.getElementsByTagName('mm_id').item(i).firstChild.data;
				var caption = xmlDocument.getElementsByTagName('caption').item(i).firstChild.data;
				var duration = xmlDocument.getElementsByTagName('duration').item(i).firstChild.data;
				var viewedtimes = xmlDocument.getElementsByTagName('viewedtimes').item(i).firstChild.data;
				var uploadedtime = xmlDocument.getElementsByTagName('uploadedtime').item(i).firstChild.data;
				var rating = xmlDocument.getElementsByTagName('rating').item(i).firstChild.data;
				var votes = xmlDocument.getElementsByTagName('votes').item(i).firstChild.data;

				//html = html + "<tr><td><a href=\"http://go.dagbladet.no/ego.cgi/vhoyre/http://www.dagbladet.no/tv/index.html?type=fbig&clipid="+mmid+"\" title=\"Klikk for å se videoen\" class=\"bgrfix\"><img src=\"http://dagbladet.xstream.dk/api/GetThumbnail.php?ClipId="+mmid+"\" class=\"thumb\" title=\"Klikk for å se videoen\" alt=\"Klikk for å se videoen\" /><h2>"+caption+"</h2><ul><li>Varighet: "+duration+", lagt til: "+uploadedtime+"</li><li>Vist: "+viewedtimes+" ganger</li></ul><img src=\"http://gfx.dagbladet.no/rating/"+rating+".png\" class=\"rating\" alt=\""+rating+" av 5 stjerner - "+votes+" stemmer\" title=\""+rating+" av 5 stjerner - "+votes+" stemmer\" /></a></td></tr>";
				html = html + "<tr><td><a href=\"http://go.dagbladet.no/ego.cgi/vhoyre/http://www.dagbladet.no/tv/index.html?type=fbig&clipid="+mmid+"\" title=\"Klikk for å se videoen\" class=\"bgrfix\"><img src=\"http://dagbladet.xstream.dk/api/GetThumbnail.php?ClipId="+mmid+"\" class=\"thumb\" title=\"Klikk for å se videoen\" alt=\"Klikk for å se videoen\" /><h2>"+caption+"</h2><ul><li>Varighet: "+duration+", lagt til: "+uploadedtime+"</li><li>Vist: "+viewedtimes+" ganger</li></ul><img src=\"http://gfx.dagbladet.no/kommentarer/hand.gif\" border=\"0\" alt=\""+votes+" stemmer\" title=\""+votes+" stemmer\" /> "+votes+" anbefalinger</a></td></tr>";
			}

			html = html + "</table>";


			//DBM.util.createDiv(DBM.module.Common.currentTarget, html);
			DBM.util.createDiv("content03", html);

		  	DBM.module.Common.defaultCallback.success(o);
		  },
		  failure: function(o) {
		  	DBM.module.Common.defaultCallback.failure(o);
		  },
		  timeout: DBM.module.Common.timeout
	},

	initVideoPlayer: function(mmId, moduleUrl, reqUrl, catId) {

		if (moduleUrl != undefined) {
			this.moduleUrl = moduleUrl;
		}

		if (reqUrl != undefined) {
			this.reqUrl = reqUrl;
		}

		if (catId != undefined) {
			this.catId = catId;
		}

		this.videoinfo_init(mmId);

		// FJERNET 2.10.2007 Se også lengre oppe samme tag.
		//this.videoinfo_initByUpload(mmId);
		//this.videoinfo_initByViews(mmId);
		//this.videoinfo_initByRating(mmId);

	}
}

