Source for "Videoembed"

By Firtina
Has 5 other scripts.


Add Syntax Highlighting (this will take a few seconds, probably freezing your browser while it works)

// ==UserScript==
// @name          Videoembed
// @description	 Automatically adds embedded videos after links to video pages..
// @include       *
// @exclude        http://glumbert.com/*
// @exclude        http://*.glumbert.com/*
// @exclude        http://metacafe.com/*
// @exclude        http://*.metacafe.com/*
// @exclude        http://video.google.com/*
// @exclude        http://*.tinypic.com/*
// @exclude        http://video.yahoo.com/*
// @exclude        http://*.video.yahoo.com/*
// @exclude        http://*.photobucket.com/*
// @exclude        http://photobucket.com/*
// @exclude        http://ifilm.com/*
// @exclude        http://*.ifilm.com/*
// @exclude        http://bolt.com/*
// @exclude        http://*.bolt.com/*
// @exclude        http://youtube.com/*
// @exclude        http://*.youtube.com/*
// @exclude        http://*.myspace.com/*
// @exclude        http://myspace.com/*
// @exclude        http://*.liveleak.com/*
// @exclude        http://liveleak.com/*
// @exclude        http://revver.com/*
// @exclude        http://*.revver.com/*
// @exclude        http://*.atomfilms.com/*
// @exclude        http://atomfilms.com/*
// @exclude        http://*.addictingclips.com/*
// @exclude        http://addictingclips.com/*
// @exclude        http://*.vimeo.com/*
// @exclude        http://vimeo.com/*
// @exclude        http://*.veoh.com/*
// @exclude        http://veoh.com/*
// @exclude        http://*.guba.com/*
// @exclude        http://guba.com/*
// @exclude        http://gamevideos.com/*
// @exclude        http://*.gamevideos.com/*
// @exclude        http://gametrailers.com/*
// @exclude        http://*.gametrailers.com/*
// @exclude        http://tudou.com/*
// @exclude        http://*.tudou.com/*
// @exclude        http://pikniktube.com/*
// @exclude        http://*.pikniktube.com/*
// @exclude        http://collegehumor.com/*
// @exclude        http://*.collegehumor.com/*
// @exclude        http://*.5min.com/*
// @exclude        http://5min.com/*
// @namespace   http://hergonan.blogspot.com/
// @version        4.06
//by Hergonan (http://hergonan.blogspot.com)
// ==/UserScript==
	  
	 
var optionvalues = new Array();
optionvalues[10] = 0;
var page_links = document.links;
var pushed=new Array();
var zz = 0;

GM_registerMenuCommand("Videoembed options", options);
o = 0;
function addFilter(func, i) {
	i = i || 4;
	if (window.Pagerization) {
		window.Pagerization.addEventListener('addPage', func);
	}
}

function addStyles(css) {
	var head, style;
	head = document.getElementsByTagName('head')[0];
	if (!head) { return; }
	style = document.createElement('style');
	style.type = 'text/css';
	style.innerHTML = css;
	head.appendChild(style);
};

addFilter(function (nodes) {
	optionvalues[10] = 1;
	checklinks();
});

function options(){
	if(o == 1)
	{
		alert("Options already open!");
	}
	else{
		o = 1;
		var elmInsertPoint = document.body;
		var elmD = document.createElement("div");
		elmD.setAttribute('style',"width:50%;position:fixed;color:blue;background:white;border:1px solid yellow;top:25%;left:25%");
		var opts = document.createElement("center");
		opts.innerHTML = "Videoembed Options";
		elmD.appendChild(opts);
		var modelabel = document.createElement("label");
		modelabel.innerHTML = "Videoembed Mode ";
		elmD.appendChild(modelabel);
		var modeselect = document.createElement("select");
		modeselect.name = "modeselect";
		var objopt;
			objopt = document.createElement("option");
			objopt.text = "Auto";
			objopt.value = "0";
			modeselect.options.add(objopt);
			objopt = document.createElement("option");
			objopt.text = "Button";
			objopt.value = "1";
			modeselect.options.add(objopt);
			objopt = document.createElement("option");
			objopt.text = "Google";
			objopt.value = "2";
			modeselect.options.add(objopt);
		if(GM_getValue('googlemode') == 1)
			modeselect.value = "2";
		else
		{
			if(GM_getValue('mode') == 1)
				modeselect.value = "1";
			else
				modeselect.value = "0";
		}
		elmD.appendChild(modeselect);
		elmD.appendChild(document.createElement("hr"));
		var yopts = document.createElement("center");
		yopts.innerHTML = "Youtube Options";
		elmD.appendChild(yopts);
		var colorlabel = document.createElement("label");
		colorlabel.innerHTML = "Color mode ";
		colorselect = document.createElement("select");
		colorselect.name = "colorselect";
		elmD.appendChild(colorlabel);
			objopt = document.createElement("option");
			objopt.text = "Default";
			objopt.value = "";
			colorselect.options.add(objopt);
			objopt = document.createElement("option");
			objopt.text = "Storm(dark gray + light gray)";
			objopt.value = "&color1=0x3a3a3a&color2=0x999999";
			colorselect.options.add(objopt);
			objopt = document.createElement("option");
			objopt.text = "Iceberg(dark blue + light blue)";
			objopt.value = "&color1=0x2b405b&color2=0x6b8ab6";
			colorselect.options.add(objopt);
			objopt = document.createElement("option");
			objopt.text = "Acid(light blue + lighter blue)";
			objopt.value = "&color1=0x006699&color2=0x54abd6";
			colorselect.options.add(objopt);
			objopt = document.createElement("option");
			objopt.text = "Green(dark green + light green)";
			objopt.value = "&color1=0x234900&color2=0x4e9e00";
			colorselect.options.add(objopt);
			objopt = document.createElement("option");
			objopt.text = "Orange(orange + yellow)";
			objopt.value = "&color1=0xe1600f&color2=0xfebd01";
			colorselect.options.add(objopt);
			objopt = document.createElement("option");
			objopt.text = "Pink";
			objopt.value = "&color1=0xcc2550&color2=0xe87a9f";
			colorselect.options.add(objopt);
			objopt = document.createElement("option");
			objopt.text = "Purple";
			objopt.value = "&color1=0x402061&color2=0x9461ca";
			colorselect.options.add(objopt);
			objopt = document.createElement("option");
			objopt.text = "Rubyred";
			objopt.value = "&color1=0x5d1719&color2=0xcd311b";
			colorselect.options.add(objopt);
			objopt = document.createElement("option");
			objopt.text = "Black";
			objopt.value = "&color1=0x000000&color2=0x000000";
			colorselect.options.add(objopt);
		if(GM_getValue('color'))
			colorselect.value = GM_getValue('color');
		elmD.appendChild(colorselect);
		elmD.appendChild(document.createElement("br"));
		var borderlabel = document.createElement("label");
		borderlabel.innerHTML = "Border ";
		elmD.appendChild(borderlabel);
		var borderselect = document.createElement("select");
		borderselect.name = "borderselect";
		objopt = document.createElement("option");
		objopt.text = "No";
		objopt.value = "";
		borderselect.options.add(objopt);
		objopt = document.createElement("option");
		objopt.text = "Yes";
		objopt.value = "&border=1";
		borderselect.options.add(objopt);
		if(GM_getValue('border'))
			borderselect.value = GM_getValue('border');
		elmD.appendChild(borderselect);
		elmD.appendChild(document.createElement("br"));
		sizelabel = document.createElement("label");
		sizelabel.innerHTML = "Size";
		elmD.appendChild(sizelabel);
		sizeselect = document.createElement("select");
		sizeselect.name = "sizeselect";
		objopt = document.createElement("option");
		objopt.text = "424 x 354 (default)"
		objopt.value = "424x354";
		sizeselect.options.add(objopt);
		objopt = document.createElement("option");
		objopt.text = "304 x 255 (small)";
		objopt.value = "304x255";
		sizeselect.options.add(objopt);
		objopt = document.createElement("option");
		objopt.text = "524 x 429 (large)";
		objopt.value = "524x429";
		sizeselect.options.add(objopt);
		elmD.appendChild(sizeselect);
		if(GM_getValue('size1') && GM_getValue('size2'))
			sizeselect.value = GM_getValue('size1')+'x'+GM_getValue('size2');
		elmInsertPoint.insertBefore(elmD, elmInsertPoint.lastChild);
		var savebutton = document.createElement("button");
		elmD.appendChild(document.createElement("hr"));
		infolabel = document.createElement("label");
		infolabel.innerHTML = "If you want to open the config again, right click the Greasemonkey button (on the bottom-right of the browser) and navigate to: Userscript Commands -> Videoembed options.";
		elmD.appendChild(infolabel);
		elmD.appendChild(document.createElement("hr"));
		savebutton.innerHTML = "Save & Reload page";
		savebutton.addEventListener('click',saveopts,false);
		elmD.appendChild(savebutton);
	}
}
function saveopts(){
	GM_setValue('opts',1)
	modeselect = document.getElementsByName("modeselect")[0];
	colorselect = document.getElementsByName("colorselect")[0];
	borderselect = document.getElementsByName("borderselect")[0];
	sizeselect = document.getElementsByName("sizeselect")[0];
	GM_setValue('border',borderselect.value);
	GM_setValue('color',colorselect.value);
	if(modeselect.value == 2)
	{
		GM_setValue('mode',1);
		GM_setValue('googlemode',1);
	}
	else
	{
		GM_setValue('mode',modeselect.value);
		GM_setValue('googlemode',0);
	}
	var sizevalues = sizeselect.value.split('x');
	GM_setValue('size1',sizevalues[0]);
	GM_setValue('size2',sizevalues[1]);
	window.location.reload();
}
function checkupd(){
	var d = new Date();
	if (GM_getValue('lastcheck') == d.getDate()) {
		return
	}
	GM_setValue('lastcheck',d.getDate());
	var elmInsertPoint = document.body;
	var elmD = document.createElement("div");
	elmD.setAttribute('style',"position:fixed;background:white;border:1px solid yellow;bottom:0")
	var elmA = document.createElement("a");
	elmA.setAttribute('style',"color:black")
	elmA.setAttribute("href", "http://userscripts.org/scripts/source/7686.user.js");
	elmA.innerHTML = 'Checking for new version of Videoembed';
	elmD.appendChild(elmA)
	elmInsertPoint.insertBefore(elmD, elmInsertPoint.lastChild);
	GM_xmlhttpRequest({
		method:"GET",
		url:'http://userscripts.org/scripts/source/7686.user.js',
		onload:function(result) {
			if (result.responseText.indexOf('@version        4.06') == -1) {
				elmA.setAttribute('style',"display:none")
				elmA.innerHTML = 'There is a new version of the "videoembed" userscript. Click here to install it'
				elmA.setAttribute('style',"color:blue")
			}
			else
				elmA.setAttribute('style',"display:none")
		}
	});
}
function init(){
	if(GM_getValue('mode') == 1)
	{
		optionvalues[0] = 1;
		addStyles('.vidembedbutton{background:#0f0f0f;color:#f0f0f0;}');
	}
	else
	optionvalues[0] = 0;
	if(GM_getValue('color'))
		optionvalues[1] = GM_getValue('color');
	else
	optionvalues[1] = "";
	if(GM_getValue('border'))
		optionvalues[2] = GM_getValue('border');
	else
		optionvalues[2] = "";
	if(GM_getValue('size1') && GM_getValue('size2'))
		optionvalues[3] = [GM_getValue('size1'),GM_getValue('size2')];
	else
		optionvalues[3] = [425,355];
	if(GM_getValue('googlemode'))
		optionvalues[4] = GM_getValue('googlemode');
	else
		optionvalues[4] = 0;
	
	if(optionvalues[4] == 1)
		googlinit();
}

var NVF_UPDATEINTERVAL;
var NVFARRAY;
var inter;

function googlinit(){
	NVF_UPDATEINTERVAL = 15;
	NVFARRAY = [];
}
function clri(){
	for (var vd=0; vd < NVFARRAY.length; vd++)
	{
		NVFARRAY.splice(vd,1);
	}
	clearInterval(inter);
	inter = false;
}

var maxparts = 10;

function updv(){
	for (var vd=0; vd < NVFARRAY.length; vd++)
	{
		if(NVFARRAY[vd][5]<maxparts){
			sps[NVFARRAY[vd][0]].width = NVFARRAY[vd][3];
			sps[NVFARRAY[vd][0]].height = (NVFARRAY[vd][4]/maxparts) * NVFARRAY[vd][5];
			NVFARRAY[vd][5]++;
		}
		else{
			sps[NVFARRAY[vd][0]].width = 0;
			sps[NVFARRAY[vd][0]].height = 0;
			vspans[NVFARRAY[vd][0]].innerHTML = '<embed bgcolor="#000000" width="'+NVFARRAY[vd][3]+'" height="'+NVFARRAY[vd][4]+'" ' + NVFARRAY[vd][1] + '></embed><br>';
			NVFARRAY.splice(vd,1);
		}
	}
	if(NVFARRAY.length == 0){
		clri();
	}
}
function embed(idn,e,lnk,spw,sph){
	embs[idn].innerHTML = '';
	if(optionvalues[4] == 1){
		lnk.parentNode.insertBefore(brs[idn],lnk.nextSibling);
		unembs[idn].innerHTML += '<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAABGdBTUEAAK%2FINwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAADKSURBVHjahFG7EcIwDI1l%2FWzcULFCCtahpuGo4ZiAgShZgT04VghtjBKHBI4DdLbOlp6enmW32p6qf4a29%2BtFuXgk3xsRhRBUowV3xwuWXOe7HIswABAzIYpGDTowlWorFVUmcc6BZ1USkaldIUgpWdQBIwIiOYA2v2hC9HXdVFXzKbm5L82DbeP%2F9q5CVoTz9TafxUFm%2B2yTs608gIIys4kWixVAn3Nvc2JJcRZHmX2xIfLI2jPFmPNYNp0MYTMbQJvD%2Bfe3PAQYAAu1L6fh%2FGDIAAAAAElFTkSuQmCC">'
		NVFARRAY.push([idn,e,lnk,spw,sph,0]);
		if(!inter){
			inter = setInterval(updv, NVF_UPDATEINTERVAL);
		}
	}
	else{
		unembs[idn].innerHTML = '(Unembed)';	
		sps[idn].innerHTML = '<br><embed bgcolor="#000000" width="'+spw+'" height="'+sph+'" ' + e + '></embed><br>';
	}
}

function unembed(idn){
	unembs[idn].innerHTML = '';
	if(optionvalues[4] == 1){
		brs[idn].parentNode.removeChild(brs[idn]);
		embs[idn].innerHTML += '<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAABGdBTUEAAK%2FINwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAADCSURBVHjalJFdCsIwDIDTOkEfxGMIehtBvIF4Em%2Fgg1cQ9CDCXoSdY6sbdbVJZ9fpuuFgM5CmbX76pWGb3aWAPyQol%2FNp3RtY2LLb%2FRV4l5Ox0Gn7rrJ8KIoxxiP1CRICIfmEXGmYTu6daF9JxMIjIVH%2FK9hA0pogFkvgvOpsPoucFekKyBYzVrGJpJTyGMDqvZQSyDZLiO05yGcO%2BoU%2FGHEiugf3EKk76E%2BlWzhxNstkHTgOAp9wOEYl4GjIF78FGABBZFEyfagcmwAAAABJRU5ErkJggg%3D%3D">'
		
		clri();
		vspans[idn].innerHTML = '';
		sps[idn].width = 0;
		sps[idn].height = 0;
	}
	else{
		sps[idn].innerHTML = '';
		embs[idn].innerHTML = '(Embed)';
	}
}

var embs = [];
var unembs = [];
var sps = [];
var brs = [];
var vspans = [];
function spanK(e,lnk,spw,sph){
	zz+= 1;
	if(optionvalues[0] == 1){
		embs[zz] = document.createElement("label");
		embs[zz].setAttribute('class','vidembedbutton');
		embs[zz].addEventListener('click',(function(zz,e,lnk,spw,sph){return function(){embed(zz,e,lnk,spw,sph);};})(zz,e,lnk,spw,sph),false);
		unembs[zz] = document.createElement("label");
		unembs[zz].setAttribute('class','vidembedbutton');
		unembs[zz].addEventListener('click',(function(zz){return function(){unembed(zz);};})(zz),false);
		if(optionvalues[4] == 1){
			embs[zz].innerHTML += '<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAABGdBTUEAAK%2FINwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAADCSURBVHjalJFdCsIwDIDTOkEfxGMIehtBvIF4Em%2Fgg1cQ9CDCXoSdY6sbdbVJZ9fpuuFgM5CmbX76pWGb3aWAPyQol%2FNp3RtY2LLb%2FRV4l5Ox0Gn7rrJ8KIoxxiP1CRICIfmEXGmYTu6daF9JxMIjIVH%2FK9hA0pogFkvgvOpsPoucFekKyBYzVrGJpJTyGMDqvZQSyDZLiO05yGcO%2BoU%2FGHEiugf3EKk76E%2BlWzhxNstkHTgOAp9wOEYl4GjIF78FGABBZFEyfagcmwAAAABJRU5ErkJggg%3D%3D">'
			brs[zz] = document.createElement("br");
			sps[zz] = document.createElement("embed");
			sps[zz].setAttribute("type","application/x-shockwave-flash");
			sps[zz].setAttribute("bgcolor","#000000");
			sps[zz].setAttribute("height",0);
			sps[zz].setAttribute("width",0);
			vspans[zz] = document.createElement("span");
			lnk.parentNode.insertBefore(vspans[zz],lnk.nextSibling);
		}
		else
		{
			sps[zz] = document.createElement("span");
			embs[zz].innerHTML = '(Embed)';
		}
		lnk.parentNode.insertBefore(sps[zz],lnk.nextSibling);
		lnk.parentNode.insertBefore(embs[zz],lnk);
		lnk.parentNode.insertBefore(unembs[zz],lnk);
	}
	else{
		var span = document.createElement("span");
		span.innerHTML = '<br><embed width="'+spw+'" height="'+sph+'" ' + e + '></embed><br>';
		lnk.parentNode.insertBefore(span,lnk.nextSibling);
	}
}
function checklinks(){
	for (var i=0; i<page_links.length; i++){
	if((pushed.indexOf(page_links[i].href)==-1) || (optionvalues[0] == 1 && optionvalues[10]==0))
	{
		if(page_links[i].href.match("http://(www\.|)glumbert\.com/media/"))
		{
			pushed.push(page_links[i].href);
			argus=page_links[i].href.substring(page_links[i].href.indexOf('/media/')+7).split('/');
			name = argus[0]
			spanK('allowfullscreen="true" type="application/x-shockwave-flash" src="http://www.glumbert.com/embed/'+name+'"',page_links[i],496,372);
		}
		if(page_links[i].href.match("http://(www\.|)metacafe\.com/watch/"))
		{
			pushed.push(page_links[i].href);
			argus=page_links[i].href.substring(page_links[i].href.indexOf('/watch/')+7).split('/');
			
			id=argus[0]
			if(argus[1])
				rest=argus[1]
			else
				rest=''
			spanK('allowfullscreen="true" src="http://www.metacafe.com/fplayer/'+id+'/'+rest+'.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"',page_links[i],400,345);
		}
		if(page_links[i].hostname.match("video\.google\.") && page_links[i].href.match("/videoplay"))
		{
			pushed.push(page_links[i].href);
			argus=page_links[i].href.substring(page_links[i].href.indexOf('docid=')+6).split('&');
			var src = 'http://video.google.com/googleplayer.swf?docId=' + argus[0] + '&hl=en'
			spanK('allowfullscreen="true" id="VideoPlayback" type="application/x-shockwave-flash" src="'+src+'" flashvars="&subtitle=on"',page_links[i],400,326);	
		}
		if(page_links[i].href.match('http://video\.animeepisodes\.net/video')) 
		{
			pushed.push(page_links[i].href);
			argus=page_links[i].href.substring(page_links[i].href.indexOf('/video/')+7).split('/');
			src = argus[0]
			src = src.substring(0,src.indexOf('.htm'))
			src = 'http://video.animeepisodes.net/vidiac.swf" FlashVars="video=' + src
			spanK('allowfullscreen="true" src="' + src + '" quality="high" name="ePlayer" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"',page_links[i],428,352);
		}
		if(page_links[i].href.match("http://video\.tinypic\.com/player.php?") && page_links[i].href.match("v="))
		{
			pushed.push(page_links[i].href);
			argus=page_links[i].href.substring(page_links[i].href.indexOf('v=')+2).split('&');
			src = 'http://tinypic.com/player.swf?file=' + argus[0]
			spanK('allowfullscreen="true" type="application/x-shockwave-flash" src="'+src+'"',page_links[i],440,380);
		}
		if(page_links[i].href.match("http://(ca\.|sg\.|ph\.|malaysia\.|uk\.|fr\.|it\.|au\.|tw\.|telemundo\.|staging\.|de\.|)video.yahoo.com/video/play") && page_links[i].href.match("vid="))
		{
			pushed.push(page_links[i].href);
			id=page_links[i].href.substring(page_links[i].href.indexOf('vid=')+4).split('&')[0].split('.')[1];
			if(!id)
			id=page_links[i].href.substring(page_links[i].href.indexOf('vid=')+4).split('&')[0];
			spanK('allowfullscreen="true" src="http://us.i1.yimg.com/cosmos.bcst.yahoo.com/player/media/swf/FLVVideoSolo.swf" flashvars="id=' + id + '" type="application/x-shockwave-flash"',page_links[i],440,380);
		}
		if(page_links[i].href.match("http://(video\.|)photobucket\.com/mediadetail"))
		{
			pushed.push(page_links[i].href);
			argus=page_links[i].href.substring(page_links[i].href.indexOf('?')+1).split('&');
			for(x=0;x<argus.length;x++) {
				if(!argus[x].indexOf('media=') && argus[x].match('swf')) {
					var span = document.createElement("span");
					lol = argus[x].substring(argus[x].indexOf('video')+1)
					bleh=lol.substring(lol.indexOf('vid')).split('.');
					id = bleh[0].substring(3)
					spanK('allowfullscreen="true" type="application/x-shockwave-flash" src="http://s' + id + '.photobucket.com' + unescape(argus[x].substring(6)) + page_links[i],430,389);
				}
			}
		}
		
		if(page_links[i].href.match("http://(www\.|stage\.|partners\.|)(ifilm\.|spike\.)com/"))
		{
			pushed.push(page_links[i].href);
			
			argus=page_links[i].href.substring(page_links[i].href.indexOf('/')+1).split('/');
			for(x=0;x<argus.length;x++) {
				if(!argus[x].indexOf('video')) {
					y = x + 1
					lol = argus[y]
					spanK('allowfullscreen="true" src="http://www.spike.com/efp" quality="high" name="efp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="flvbaseclip=' + lol + '&"',page_links[i],448,365);
				}
			}
		}
		if(page_links[i].hostname.match("(www\.|)bolt\.com") && page_links[i].href.match("/video/"))
		{
			pushed.push(page_links[i].href);
			argus=page_links[i].href.substring(page_links[i].href.indexOf('/')+1).split('/');
			x = argus.length
			x = x - 1
			lol = argus[x]
			if(lol.match("[0-9]") && !lol.match("[a-zA-Z]"))
			{
				var span = document.createElement("span");
				spanK('src="allowfullscreen="true" http://www.bolt.com/video/flv_player_branded.swf?contentId='+lol+'&contentType=2" loop="false" quality="high" name="video_play_500" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"',page_links[i],365,340);
			}
			if(!lol) {
				x = x - 1
				lol = argus[x]
				if(lol.match("[0-9]") && !lol.match("[a-zA-Z]"))
				{
					var span = document.createElement("span");
					spanK('allowfullscreen="true" src="http://www.bolt.com/video/flv_player_branded.swf?contentId='+lol+'&contentType=2" loop="false" quality="high" name="video_play_500" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" ',page_links[i],365,340);
				}
			}
		}
		if(page_links[i].href.match('http://(pop\.|m\.|www\.|nz\.|uk\.|kr\.|nl\.|mx\.|fr\.|it\.|pl\.|ie\.|tw\.|au\.|hk\.|ru\.|jp\.|ca\.|es\.|de\.|br\.|)youtube\.com/(watch|)'))
		{
			pushed.push(page_links[i].href);
			argus=page_links[i].href.substring(page_links[i].href.indexOf('?')+1).split('&');
			for(x=0;x<argus.length;x++)
				if(!argus[x].indexOf('v='))
					spanK(' allowfullscreen="true" src="http://www.youtube.com/v/'+argus[x].substring(2)+''+optionvalues[1]+''+optionvalues[2]+'" type="application/x-shockwave-flash" ',page_links[i],optionvalues[3][0],optionvalues[3][1]);
		}
		if(page_links[i].href.match("http://(www\.|)youtube\.com/view_play_list"))
		{
			pushed.push(page_links[i].href);
			argus=page_links[i].href.substring(page_links[i].href.indexOf('?')+1).split('&');
			for(x=0;x<argus.length;x++) {
				if(!argus[x].indexOf('p='))
				{
					link = argus[x].substring(2)
					spanK('allowfullscreen="true" src="http://www.youtube.com/p/'+link+'" type="application/x-shockwave-flash"',page_links[i],425,355);
				}
			}
		}
		if(page_links[i].href.match("http://vids\.myspace\.com/index\.cfm"))
		{
			pushed.push(page_links[i].href);
			argus=page_links[i].href.substring(page_links[i].href.indexOf('?')+1).split('&');
			for(x=0;x<argus.length;x++)
			{
				if(!argus[x].indexOf('videoid=') || !argus[x].indexOf('videoID='))
				{
					mys = argus[x].substring(8)
					spanK('allowfullscreen="true" src="http://lads.myspace.com/videos/vplayer.swf" flashvars="m=' + mys + '&type=video" type="application/x-shockwave-flash" ',page_links[i],430,346);
				}
			}
		}
		if(page_links[i].href.match("http://(www\.|)liveleak\.com/view"))
		{
			pushed.push(page_links[i].href);
			argus=page_links[i].href.substring(page_links[i].href.indexOf('?')+1).split('&');
			for(x=0;x<argus.length;x++) {
				if(!argus[x].indexOf('i=')) {
					spanK('allowfullscreen="true" src="http://www.liveleak.com/player.swf?autostart=false&token=' + argus[x].substring(2) + '" quality="high"',page_links[i],450,370);
				}
			}
		}
		if(page_links[i].href.match("http://(rl01\.|one\.|)revver\.com/watch"))
		{
			pushed.push(page_links[i].href);
			var span = document.createElement("span");
			argus=page_links[i].href.substring(page_links[i].href.indexOf('/')+1).split('/');
			for(x=0;x<argus.length;x++) {
				if(!argus[x].indexOf('watch')) {
					y = x + 1
					lol = argus[y]
					spanK('allowfullscreen="true" type="application/x-shockwave-flash" src="http://flash.revver.com/player/1.0/player.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" scale="noScale" salign="TL" flashvars="mediaId=' + lol + '&affiliateId=0"',page_links[i],480,392);
				}
			}
		}
		if(page_links[i].href.match("http://(www\.|)atomfilms\.com/film/"))
		{
			pushed.push(page_links[i].href);
			var span = document.createElement("span");
			argus=page_links[i].href.substring(page_links[i].href.indexOf('film/')+1).split('/');
			for(x=0;x<argus.length;x++) {
				if(argus[x].match('\.jsp')){
					var link = argus[x].substring(0,argus[x].indexOf('\.jsp'))
					spanK('allowfullscreen="true" src="http://www.atomfilms.com:80/a/autoplayer/shareEmbed.swf?keyword='+link+'"',page_links[i],426,350);
				}
			}
		}
		if(page_links[i].href.match("http://(www\.|upload\.|)addictingclips\.com/Clip"))
		{
			pushed.push(page_links[i].href);
			argus=page_links[i].href.substring(page_links[i].href.indexOf('?')+1).split('&');
			for(x=0;x<argus.length;x++) {
				if(!argus[x].indexOf('key=')) {
					spanK('allowfullscreen="true" src="http://uploads.atomfilms.com/player.swf?key='+argus[x].substring(4)+'"',page_links[i],430,354);
				}
			}
		}
		if(page_links[i].href.match("http://(www\.|)vimeo\.com/"))
		{
			pushed.push(page_links[i].href);
			if(page_links[i].href.match('clip:'))
			{
				argus=page_links[i].href.substring(page_links[i].href.indexOf('clip:')+5);
				spanK('allowfullscreen="true" src="http://www.vimeo.com/moogaloop.swf?clip_id='+argus+'" quality="best" scale="exactfit" type="application/x-shockwave-flash"',page_links[i],400,300);
			}
			
			if(page_links[i].href.match('clip='))
			{
				argus=page_links[i].href.substring(page_links[i].href.indexOf('clip=')+5);
				spanK('allowfullscreen="true" src="http://www.vimeo.com/moogaloop.swf?clip_id='+argus+'" quality="best" scale="exactfit" type="application/x-shockwave-flash"',page_links[i],400,300);
			}
			if(page_links[i].href.match("[0-9]{6}"))
			{
				argus=page_links[i].href.substring(page_links[i].href.indexOf('\.com/')+5);
				if(argus.indexOf('?')!=-1){
                                          argus=argus.substring(0,argus.indexOf('?'));
                                }
				spanK('allowfullscreen="true" src="http://www.vimeo.com/moogaloop.swf?clip_id='+argus+'" quality="best" scale="exactfit" type="application/x-shockwave-flash"',page_links[i],400,300);
			}
		}
		if(page_links[i].href.match("http://(www\.|)veoh\.com/videos/"))
		{
			pushed.push(page_links[i].href);
			argus=page_links[i].href.substring(page_links[i].href.indexOf('/')+1).split('/');
			for(x=0;x<argus.length;x++) {
				if(!argus[x].indexOf('videos')) {
					y = x + 1
					if(argus[y]){
						link = argus[y]
						if(link.indexOf('?') != '-1')
							link = link.substring(0,link.indexOf('?'))
						spanK('allowfullscreen="true" src="http://www.veoh.com/videodetails.swf?permalinkId='+link+'&id=1&player=videodetails&videoAutoPlay=0" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"',page_links[i],540,438);
					}
				}
			}
		}
		if(page_links[i].href.match("http://(producers\.|www\.|fearnet\.|my\.|)guba\.com/watch/"))
		{
			pushed.push(page_links[i].href);
			argus=page_links[i].href.substring(page_links[i].href.indexOf('/')+1).split('/');
			for(x=0;x<argus.length;x++) {
				if(!argus[x].indexOf('watch')) {
					y = x + 1
					link = argus[y]
					if(link.indexOf('?') != '-1')
						link = link.substring(0,link.indexOf('?'))
					href = page_links[i].href
					href = href.substring(href.indexOf('http://')+7)
					href = href.substring(0,href.indexOf('/')).split('\.')
					spanK('allowfullscreen="true" src="http://'+href[0]+'.guba.com/f/root.swf?video_url=http://free.guba.com/uploaditem/'+link+'/flash.flv&isEmbeddedPlayer=true" quality="high" menu="false" name="root" id="root" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"',page_links[i],375,360);
				}
			}
		}
		if(page_links[i].href.match("http://(www\.|)gamevideos\.com/video/id"))
		{
				pushed.push(page_links[i].href);
				argus=page_links[i].href.substring(page_links[i].href.indexOf('/')+1).split('/');
				for(x=0;x<argus.length;x++) {
					if(!argus[x].indexOf('video')) {
						y = x + 2
						if(argus[y]){
							link = argus[y]
							if(link.indexOf('?') != '-1')
								link = link.substring(0,link.indexOf('?'))
							spanK('allowfullscreen="true" src="http://www.gamevideos.com:80/swf/gamevideos11.swf?embedded=1&fullscreen=1&autoplay=0&src=http://www.gamevideos.com:80/video/videoListXML%3Fid%3D'+link+'%26ordinal%3D1175513941657%26adPlay%3Dfalse" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" play="true" loop="true" scale="showall" wmode="window" devicefont="false" id="gamevideos6" name="gamevideos6" menu="true" allowscriptaccess="sameDomain" align="middle" ',page_links[i],420,405);
						}
					}
				}
		}
		if(page_links[i].href.match("http://(www\.|moses\.|)gametrailers\.com/umwatcher"))
		{
				pushed.push(page_links[i].href);
				argus=page_links[i].href.substring(page_links[i].href.indexOf('?')+1).split('&');
				for(x=0;x<argus.length;x++) {
					if(!argus[x].indexOf('id=')) {
						spanK('allowfullscreen="true" src="http://www.gametrailers.com/remote_wrap.php?umid='+argus[x].substring(3)+'" swLiveConnect="true" name="gtembed" align="middle" allowScriptAccess="sameDomain" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" >',page_links[i],480,409);
					}
				}
		}
		if(page_links[i].href.match("http://(www\.|)pikniktube\.com/video"))
		{
				pushed.push(page_links[i].href);
				argus=page_links[i].href.substring(page_links[i].href.indexOf('?')+1).split('&');
				for(x=0;x<argus.length;x++) {
					if(!argus[x].indexOf('Video=')) {
						link = argus[x].substring(6)
						spanK(' src="http://www.pikniktube.com/player/videoplayer2.swf" type="application/x-shockwave-flash" allowFullScreen="true" flashvars ="linktarget=_blank&embedded=1&xmlsrc=http://www.pikniktube.com/getxmle.asp?q='+link+'&a=1&c=0"',page_links[i],340,320);
					}
				}
		}
		if(page_links[i].href.match("http://(www\.|)tudou\.com/programs/view"))
		{
				pushed.push(page_links[i].href);
				argus=page_links[i].href.substring(page_links[i].href.indexOf('?')+1).split('&');
				for(x=0;x<argus.length;x++) {
					if(!argus[x].indexOf('itemID=')) {
						spanK(' src="http://www.tudou.com/v/'+argus[x].substring(7)+'" type="application/x-shockwave-flash" allowFullScreen="true" allowScriptAccess="always"',page_links[i],400,300);
					}
				}
				argus=page_links[i].href.substring(page_links[i].href.indexOf('/view/')+6).split('/');
				if(argus[0]) {
					spanK(' src="http://www.tudou.com/v/'+argus[0]+'" type="application/x-shockwave-flash" allowFullScreen="true" allowScriptAccess="always"',page_links[i],400,300);
				}	
		}
		if(page_links[i].href.match("http://(www\.|)tudou\.com/playlist/"))
		{
				pushed.push(page_links[i].href);
				argus=page_links[i].href.substring(page_links[i].href.indexOf('playlist/')+1).split('/');
				for(x=0;x<argus.length;x++) {
					if(!argus[x].indexOf('id')) {
						y = x + 1
						link = argus[y]
						spanK('allowfullscreen="true" src="http://www.tudou.com/player/playlist.swf?lid='+link+'" type="application/x-shockwave-flash"',page_links[i],488,423);
					}
				}
		}
		if(page_links[i].href.match("http://(www\.|)collegehumor.com/video"))
		{
			pushed.push(page_links[i].href);
			if(page_links[i].href.match('video:'))
				argus=page_links[i].href.substring(page_links[i].href.indexOf('video:')+6)
			
			if(page_links[i].href.match('video='))
				argus=page_links[i].href.substring(page_links[i].href.indexOf('video=')+6)
			spanK('src="http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id='+argus+'&fullscreen=1" allowfullscreen="true" quality="best" scale="exactfit" type="application/x-shockwave-flash"',page_links[i],480,360);
		}
		if(page_links[i].href.match("http://(www\.|)5min.com/(v|V)ideo"))
		{
			pushed.push(page_links[i].href);
			argus=page_links[i].href.substring(page_links[i].href.indexOf('ideo/')+5).split('\-');
			argus=argus[argus.length-1];
			spanK('allowfullscreen="true" src="http://www.5min.com/Embeded/'+argus+'/" allowScriptAccess="always" allowfullscreen="true" type="application/x-shockwave-flash"',page_links[i],425,355);
		}
	}
	}
}

(function() {
	if(GM_getValue('opts') == 1)
	{
		checkupd();
		init();
		checklinks();
	}
	else
		options();
})();