// pkLaunch 0.6rc3 (+enablefullscreencontrols,+save bw,+catch fixes,+fix yahoo url change,+fix mediahash)
// 2005-10-27
// (c) 2005, Pooya Karimian
//  http://www.pooyak.com/p/pklaunch/
//
//  This Greasemonkey script changes all Yahoo Launch videos with 
//  an embed tag in a new window so that they'll be playable with
//  MS Windows Media Player or mplayerplug-in. It is released 
//  under GPL.
//   based on http://www.statway.com/firefox/
//
// ==UserScript==
// @name          pkLaunch
// @namespace     http://www.pooyak.com/p/pklaunch
// @description	  Changes all Yahoo Launch videos with an embed tag in a new window
// @include       http://*launch.yahoo.com/*
// @include       http://*music.yahoo.com/*
// ==/UserScript==

function getTitle(vidnum,win) {
	var titleurl="http://launchtoday.launch.yahoo.com/player/videocontext.asp?cid=1&ps=0&sx=p%2F12.xml&sgmid=2&cntid=1&vid="+vidnum+"&bw=300&uid=42&im=1&bb=Microsoft&bp=Windows%20NT&tw=lmv&env=&cfw=320&vf=2&cf=1&rf=&dwurl=";
	GM_xmlhttpRequest({
		method: 'GET',
		url: titleurl,
		headers: {
			'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey',
		},
		onload: function(responseDetails) {
			if(responseDetails.status==200) {
				var t=responseDetails.responseText;
				var re=/title=\"(.*?)\"/i;
				var m=t.split(re);
				var infohtml='';
				if (m[1]) {
				  infohtml=infohtml+'<b>'+m[1]+'</b>';
				}
				if (m[3] || m[5]) {
 			      infohtml=infohtml+' (';
 				  if (m[3]) {
   			        infohtml=infohtml+m[3];
   			      } 
 				  if (m[5]) {
   			        infohtml=infohtml+' / '+m[5];
   			      }
 			      infohtml=infohtml+')';
   			    }
				win.document.getElementById('info').innerHTML=infohtml;
		    }
		}
	});

}

function clearCookies(){
 var a,b,c,e,f;f=0;
 a=document.cookie.split("; ");
 for(e=0;e<a.length&&a[e];e++){
 	f++;for(b="."+location.host;b;b=b.replace(/^(?:\.|[^\.]+)/,"")){
	 	for(c=location.pathname;c;c=c.replace(/.$/,"")){
	 		document.cookie=(a[e]+"; domain="+b+"; path="+c+"; expires="+new Date((new Date()).getTime()-1e11).toGMTString());
	 	}
	 }
 }
// alert("Expired "+f+" cookies");
}

function setCookies(cookiest){
 var a,b,c,e,f;f=0;
 a=cookiest.split("; ");
 
 for(e=0;e<a.length&&a[e];e++){

 	f++;for(b="."+location.host;b;b=b.replace(/^(?:\.|[^\.]+)/,"")){
//	 	for(c=location.pathname;c;c=c.replace(/.$/,"")){
		c='/';
	 		document.cookie=(a[e]+"; domain="+b+"; path="+c+"; expires="+new Date((new Date()).getTime()+60000).toGMTString());
//	 	}
	 }

 }
// alert("Set "+f+" cookies");
}


function getHash(vidnum,win) {
	var titleurl="http://launchtoday.launch.yahoo.com/player/default.asp?cid=613&vid=19324792&sx=default.xml&ps=&bw=&fs=&tw=calmv&vo=&redirectURL=/musicvideos/";
	setCookies('LYC=l_v=2&l_lv=9&l_l=p2e34hp&l_s=zq40yquvwq3vu3w30suqwsszryzzwwwu&l_lid=1ba4l1m&l_r=8s&l_lc=0_1_64_0_-1&l_gv=ngupt&l_um=0_1_0_0_0&l_mv=310_100; B=9e0q77l1c33ef&b=2; Q=q1=Q0qGuBUAoKBwcA--&q2=Q0pEsg--; F=a=0BzJn5QsvTO3rLVlvWVAcfM4_SKGNXbMaDwbYSG4XHl490MT9VDJwQA9vY9D&b=vXKL; U=mt=YuEA0Z2MhYpEVeygH0pyuUy5Txv4.1ZC7ytO&ux=T/vXDB&un=8h0v1t0p1r28v; todayIntro=1%3B; YMRAD=1201477343*0_0_102_1_0_58_1_0_559_1_0_487_1_0_571_1; C=mg=1; FPB=clud6jt40118pe6c; MVUserInfo3=355_10; l%5FPD3=124; PH=phl=5JD_YwTPsMe2QtHozdftiUKjT7aZpmR9JD0twYWWLV_hdADnCA--; I=ir=f7&in=61d66adc&i1=BhABqH; LYS=l_fh=0&l_vo=myla; HP=1; Y=v=1&n=dg0jitu5o5o3l&l=p2e34hp/o&p=m2h0d1n413000300&r=8s&lg=us&intl=us&np=1; T=z=2wiYDB223YDBfUzqmbHT.GqNDM2BjY3MzBPMjFOTjU-&a=QAE&sk=DAAfFyVJKSVY.I&d=c2wBTXpReEFURXdORGM0TlRZNU9USS0BYQFRQUUBdGlwAU9xVFp1QQF6egEyd2lZREJnV0E-; playerFullVersion=10.0.0.3646; PVL=2157574_2155908_2164174_16215423_22669575_22920551_15726467_2157084_24193964_23759637_2160653_8659755_24566123_2171468_8676023_2144758_2167821_22725021_20835316_23355378_2157673_17042678_2155265_22420117|26_34_34_26_26_26_34_26_26_26_26_33_26_26_33_34_26_26_26_26_26_33_26_26; pmmczSC9D78OQONK1GM2B78CVG78KJ4=2; pmmcBSC9D78OQONK1GM2B78CVG78KJ4=0; PVL=');

	GM_xmlhttpRequest({
		method: 'GET',
		url: titleurl,
		headers: {
			'User-agent': 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)'
			},
		onload: function(responseDetails) {
			if(responseDetails.status==200) {
				var t=responseDetails.responseText;
				var re=/mediaHash\s*=\s*\'(.*?)\'/i;
				var mh=t.match(re);
				win.setHash(mh[1]);
		    }
		}
	});

}

var as = window._content.document.getElementsByTagName('a');
for (var i = as.length - 1; i >= 0; i--) {
	var hr = as[i].getAttribute('href');
	if (hr) {
		var ms = hr.match(/[V|v]ideos?[\/|\(]\D?(\d{8}|\d{7})/);
		if (!ms) {
			ms = hr.match(/vid=\D?(\d{8}|\d{7})/);
		}
		var vidnum=null;
		if (ms) {
			vidnum=ms[1];
		} else {
			var oc = as[i].getAttribute('onclick');
			if (oc) ms = oc.match(/ideos?\((\d{8}|\d{7})/);
			if (ms){
				vidnum=ms[1];
			}
		}
		if(vidnum) {
			as[i].href = '#'+vidnum;
			as[i]._vidnum=vidnum;
			as[i].onclick=function() {
//				var dataurl='data:text/html;charset=utf-8,%3C!DOCTYPE%20HTML%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20HTML%204.01%20Transitional%2F%2FEN%22%0D%0A%20%20%20%22http%3A%2F%2Fwww.w3.org%2FTR%2Fhtml4%2Floose.dtd%22%3E%0D%0A%3Chtml%20lang%3D%22en%22%3E%0D%0A%3Chead%3E%0D%0A%20%3Ctitle%3EYahoo!%20Music%3C%2Ftitle%3E%0D%0A%20%3Cstyle%20type%3D%22text%2Fcss%22%3E%0D%0A%20%20%20body%20%7B%0D%0A%20%20%20%20margin%3A%200%200%200%200%3B%0D%0A%20%20%20%20padding%3A%205px%205px%205px%205px%3B%0D%0A%09color%3A%20%2308F%3B%0D%0A%09font-family%3A%20Georgia%2C%20Helvetica%2C%20Arial%3B%0D%0A%09font-size%3A%2012px%3B%0D%0A%20%20%20%7D%0D%0A%20%20%20a%3Alink%20%7B%0D%0A%09color%3A%20%2308F%3B%0D%0A%20%20%20%7D%0D%0A%20%20%20a%3Avisited%20%7B%0D%0A%09color%3A%20%2308F%3B%0D%0A%20%20%20%7D%0D%0A%20%20%20a%3Aactive%20%7B%0D%0A%09color%3A%20%2308F%3B%0D%0A%20%20%20%7D%0D%0A%20%20%20a%3Ahover%20%7B%0D%0A%09color%3A%20%2308F%3B%0D%0A%20%20%20%7D%0D%0A%20%20%20%23content%20%7B%0D%0A%20%20%20%7D%0D%0A%20%20%20%23player%20%7B%0D%0A%20%20%20%7D%0D%0A%20%20%20%23info%20%7B%0D%0A%20%20%20%20color%3A%20%23000%3B%0D%0A%20%20%20%7D%0D%0A%20%3C%2Fstyle%3E%0D%0A%3C%2Fhead%3E%0D%0A%3Cbody%20%3E%0D%0A%20%3Cdiv%20id%3D%22content%22%3E%0D%0A%20%3C%2Fdiv%3E%0D%0A%20%3Cform%20name%3D%22pklaunch_frm%22%3E%0D%0A%20%3Cdiv%20id%3D%22controlbar%22%3E%0D%0A%20%20%3Cspan%20id%3D%22info%22%3E%3C%2Fspan%3E%3Cbr%3E%0D%0A%20%20Bandwidth%3A%0D%0A%20%20%3Cselect%20id%3D%22bwsel%22%20onchange%3D%22setBw()%3B%22%3E%0D%0A%20%20%20%20%3Coption%3E768%3C%2Foption%3E%0D%0A%20%20%20%20%3Coption%3E512%3C%2Foption%3E%0D%0A%20%20%20%20%3Coption%3E300%3C%2Foption%3E%0D%0A%20%20%20%20%3Coption%3E128%3C%2Foption%3E%0D%0A%20%20%20%20%3Coption%3E56%3C%2Foption%3E%0D%0A%20%20%3C%2Fselect%3E%20%7C%0D%0A%20%20%3Ca%20href%3D%22http%3A%2F%2Fmusic.yahoo.com%2F%22%20target%3D%22_blank%22%3EYahoo!%20Music%3C%2Fa%3E%20%7C%0D%0A%20%20%3Ca%20href%3D%22http%3A%2F%2Fwww.pooyak.com%2Fp%2Fpklaunch%2F%3Fv%3D0.6rc2%22%20target%3D%22_blank%22%3EpkLaunch%20v0.6rc2%3C%2Fa%3E%0D%0A%20%3C%2Fdiv%3E%0D%0A%20%3C%2Fform%3E%0D%0A%20%3Cscript%20type%3D%22text%2Fjavascript%22%3E%0D%0A%20%2F**%0D%0A%20%20*%20Read%20the%20JavaScript%20cookies%20tutorial%20at%3A%0D%0A%20%20*%20%20%20http%3A%2F%2Fwww.netspade.com%2Farticles%2Fjavascript%2Fcookies.xml%0D%0A%20*%2F%0D%0A%20%2F**%0D%0A%20%20*%20Sets%20a%20Cookie%20with%20the%20given%20name%20and%20value.%0D%0A%20%20*%0D%0A%20%20*%20name%20%20%20%20%20%20%20Name%20of%20the%20cookie%0D%0A%20%20*%20value%20%20%20%20%20%20Value%20of%20the%20cookie%0D%0A%20%20*%20%5Bexpires%5D%20%20Expiration%20date%20of%20the%20cookie%20(default%3A%20end%20of%20current%20session)%0D%0A%20%20*%20%5Bpath%5D%20%20%20%20%20Path%20where%20the%20cookie%20is%20valid%20(default%3A%20path%20of%20calling%20document)%0D%0A%20%20*%20%5Bdomain%5D%20%20%20Domain%20where%20the%20cookie%20is%20valid%0D%0A%20%20*%20%20%20%20%20%20%20%20%20%20%20%20%20%20(default%3A%20domain%20of%20calling%20document)%0D%0A%20%20*%20%5Bsecure%5D%20%20%20Boolean%20value%20indicating%20if%20the%20cookie%20transmission%20requires%20a%0D%0A%20%20*%20%20%20%20%20%20%20%20%20%20%20%20%20%20secure%20transmission%0D%0A%20%20*%2F%0D%0A%20function%20setCookie(name%2C%20value%2C%20expires%2C%20path%2C%20domain%2C%20secure)%0D%0A%20%7B%0D%0A%20%20%20%20%20document.cookie%3D%20name%20%2B%20%22%3D%22%20%2B%20escape(value)%20%2B%0D%0A%20%20%20%20%20%20%20%20%20((expires)%20%3F%20%22%3B%20expires%3D%22%20%2B%20expires.toGMTString()%20%3A%20%22%22)%20%2B%0D%0A%20%20%20%20%20%20%20%20%20((path)%20%3F%20%22%3B%20path%3D%22%20%2B%20path%20%3A%20%22%22)%20%2B%0D%0A%20%20%20%20%20%20%20%20%20((domain)%20%3F%20%22%3B%20domain%3D%22%20%2B%20domain%20%3A%20%22%22)%20%2B%0D%0A%20%20%20%20%20%20%20%20%20((secure)%20%3F%20%22%3B%20secure%22%20%3A%20%22%22)%3B%0D%0A%20%7D%0D%0A%0D%0A%20%2F**%0D%0A%20%20*%20Gets%20the%20value%20of%20the%20specified%20cookie.%0D%0A%20%20*%0D%0A%20%20*%20name%20%20Name%20of%20the%20desired%20cookie.%0D%0A%20%20*%0D%0A%20%20*%20Returns%20a%20string%20containing%20value%20of%20specified%20cookie%2C%0D%0A%20%20*%20%20%20or%20null%20if%20cookie%20does%20not%20exist.%0D%0A%20%20*%2F%0D%0A%20function%20getCookie(name)%0D%0A%20%7B%0D%0A%20%20%20%20%20var%20dc%20%3D%20document.cookie%3B%0D%0A%20%20%20%20%20var%20prefix%20%3D%20name%20%2B%20%22%3D%22%3B%0D%0A%20%20%20%20%20var%20begin%20%3D%20dc.indexOf(%22%3B%20%22%20%2B%20prefix)%3B%0D%0A%20%20%20%20%20if%20(begin%20%3D%3D%20-1)%0D%0A%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20begin%20%3D%20dc.indexOf(prefix)%3B%0D%0A%20%20%20%20%20%20%20%20%20if%20(begin%20!%3D%200)%20return%20null%3B%0D%0A%20%20%20%20%20%7D%0D%0A%20%20%20%20%20else%0D%0A%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20begin%20%2B%3D%202%3B%0D%0A%20%20%20%20%20%7D%0D%0A%20%20%20%20%20var%20end%20%3D%20document.cookie.indexOf(%22%3B%22%2C%20begin)%3B%0D%0A%20%20%20%20%20if%20(end%20%3D%3D%20-1)%0D%0A%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20end%20%3D%20dc.length%3B%0D%0A%20%20%20%20%20%7D%0D%0A%20%20%20%20%20return%20unescape(dc.substring(begin%20%2B%20prefix.length%2C%20end))%3B%0D%0A%20%7D%0D%0A%0D%0A%20%2F**%0D%0A%20%20*%20Deletes%20the%20specified%20cookie.%0D%0A%20%20*%0D%0A%20%20*%20name%20%20%20%20%20%20name%20of%20the%20cookie%0D%0A%20%20*%20%5Bpath%5D%20%20%20%20path%20of%20the%20cookie%20(must%20be%20same%20as%20path%20used%20to%20create%20cookie)%0D%0A%20%20*%20%5Bdomain%5D%20%20domain%20of%20the%20cookie%20(must%20be%20same%20as%20domain%20used%20to%20create%20cookie)%0D%0A%20%20*%2F%0D%0A%20function%20deleteCookie(name%2C%20path%2C%20domain)%0D%0A%20%7B%0D%0A%20%20%20%20%20if%20(getCookie(name))%0D%0A%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20document.cookie%20%3D%20name%20%2B%20%22%3D%22%20%2B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20((path)%20%3F%20%22%3B%20path%3D%22%20%2B%20path%20%3A%20%22%22)%20%2B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20((domain)%20%3F%20%22%3B%20domain%3D%22%20%2B%20domain%20%3A%20%22%22)%20%2B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%22%3B%20expires%3DThu%2C%2001-Jan-70%2000%3A00%3A01%20GMT%22%3B%0D%0A%20%20%20%20%20%7D%0D%0A%20%7D%0D%0A%0D%0A%0D%0A%20%20%20var%20bw%3DgetCookie(%22pklaunch_bw%22)%3B%0D%0A%20%20%20if%20(bw%3D%3Dnull)%20%7B%0D%0A%20%20%20%20%20bw%3D768%3B%0D%0A%20%20%20%7D%0D%0A%20%20%20var%20bwsel%3Ddocument.forms%5B\'pklaunch_frm\'%5D.bwsel%3B%0D%0A%20%20%20for%20(i%3D0%3Bi%3Cbwsel.options.length%3Bi%2B%2B)%20%7B%0D%0A%20%20%20%20%20if%20(bwsel.options%5Bi%5D.value%3D%3Dbw)%20%7B%0D%0A%20%20%20%20%20%09bwsel.selectedIndex%3Di%3B%0D%0A%20%20%20%20%20%7D%0D%0A%20%20%20%7D%0D%0A%20%20%20var%20vidnum%3D'+this._vidnum+'%3B%0D%0A%20%20%20var%20confirmResize%3D0%3B%0D%0A%0D%0A%20%20%20function%20setBw()%20%7B%0D%0A%20%20%20%20%20bw%3Ddocument.getElementById(%22bwsel%22).value%3B%0D%0A%20%20%20%20%20setCookie(%22pklaunch_bw%22%2Cbw%2Cnew%20Date(%22January%201%2C%202010%2001%3A00%3A00%22)%2C%22%2F%22)%3B%0D%0A%20%20%20%20%20setPlayer()%3B%0D%0A%20%20%20%7D%0D%0A%20%20%20function%20setVideo(vn)%20%7B%0D%0A%20%20%20%09%20vidnum%3Dvn%3B%0D%0A%20%20%20%09%20setPlayer()%3B%0D%0A%20%20%20%7D%0D%0A%20%20%20function%20setPlayer()%20%7B%0D%0A%20%20%20%20%20var%20ton%3Dwindow.onresize%3B%0D%0A%20%20%20%20%20window.onresize%3Dnull%3B%0D%0A%0D%0A%09%20var%20wmvurl%3D\'http%3A%2F%2Flaunchtoday.launch.yahoo.com%2Fplayer%2Fmedialog.asp%3Fvid%3D\'%2Bvidnum%2B\'%26bw%3D\'%2Bbw%2B\'%26mf%3D1%26pid%3D4%26ps%3D0%26p1%3D2%26p2%3D19%26p3%3D2%26rpid%3D35%26pv%3D10%26bp%3DWindows%252520NT%26csid%3D396500550%26uid%3D1453478966%26pguid%3DEyn8J0.fyfuV36ip45Kw3A%26etid%3D0%26uguid%3D9e0q77l1c33ef%26fcv%3D%26mh%3Daba6583190e94c71e691cc1146bce30c%7C%7C1130426089275%26z%3Dms.asx\'%3B%0D%0A%20%20%20%20%20%2F%2Fdocument.getElementById(\'content\').innerHTML%3D\'%3Cembed%20src%3D%22%22%20id%3D%22player%22%20autostart%3D%221%22%20%20displaysize%3D%224%22%20%20enablefullscreencontrols%3D%221%22%3E%3C%2Fembed%3E\'%3B%0D%0A%20%20%20%20%20document.getElementById(\'content\').innerHTML%3D\'%3Cembed%20src%3D%22\'%2Bwmvurl%2B\'%22%20id%3D%22player%22%20autostart%3D%221%22%20%20displaysize%3D%224%22%20%20enablefullscreencontrols%3D%221%22%3E%3C%2Fembed%3E\'%3B%0D%0A%20%20%20%20%20document.getElementById(\'player\').width%3Dwindow.innerWidth-10%3B%0D%0A%20%20%20%20%20document.getElementById(\'player\').height%3Dwindow.innerHeight-document.getElementById(\'controlbar\').clientHeight-10%3B%0D%0A%20%20%20%20%20window.onresize%3Dton%3B%0D%0A%20%20%20%7D%0D%0A%20%20%20setPlayer()%3B%0D%0A%20%20%20window.onresize%3Dfunction()%20%7B%0D%0A%20%20%20%20%20if%20((confirmResize%3D%3D1)%20%26%26%20(!confirm(\'Resizing%20needs%20restarting%20clip.%20Continue%3F\')))%20%7B%0D%0A%20%20%20%20%20%20%20return%3B%0D%0A%20%20%20%20%20%7D%0D%0A%20%20%20%20%20setPlayer()%3B%0D%0A%20%20%20%7D%3B%0D%0A%20%20%20window.setTimeout(\'confirmResize%3D1%3B\'%2C20000)%3B%0D%0A%0D%0A%20%3C%2Fscript%3E%0D%0A%3C%2Fbody%3E%0D%0A%3C%2Fhtml%3E%0D%0A';
				var dataurl='data:text/html;charset=utf-8,%3C!DOCTYPE%20HTML%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20HTML%204.01%20Transitional%2F%2FEN%22%0D%0A%20%20%20%22http%3A%2F%2Fwww.w3.org%2FTR%2Fhtml4%2Floose.dtd%22%3E%0D%0A%3Chtml%20lang%3D%22en%22%3E%0D%0A%3Chead%3E%0D%0A%20%3Ctitle%3EYahoo!%20Music%3C%2Ftitle%3E%0D%0A%20%3Cstyle%20type%3D%22text%2Fcss%22%3E%0D%0A%20%20%20body%20%7B%0D%0A%20%20%20%20margin%3A%200%200%200%200%3B%0D%0A%20%20%20%20padding%3A%205px%205px%205px%205px%3B%0D%0A%09color%3A%20%2308F%3B%0D%0A%09font-family%3A%20Georgia%2C%20Helvetica%2C%20Arial%3B%0D%0A%09font-size%3A%2012px%3B%0D%0A%20%20%20%7D%0D%0A%20%20%20a%3Alink%20%7B%0D%0A%09color%3A%20%2308F%3B%0D%0A%20%20%20%7D%0D%0A%20%20%20a%3Avisited%20%7B%0D%0A%09color%3A%20%2308F%3B%0D%0A%20%20%20%7D%0D%0A%20%20%20a%3Aactive%20%7B%0D%0A%09color%3A%20%2308F%3B%0D%0A%20%20%20%7D%0D%0A%20%20%20a%3Ahover%20%7B%0D%0A%09color%3A%20%2308F%3B%0D%0A%20%20%20%7D%0D%0A%20%20%20%23content%20%7B%0D%0A%20%20%20%7D%0D%0A%20%20%20%23player%20%7B%0D%0A%20%20%20%7D%0D%0A%20%20%20%23info%20%7B%0D%0A%20%20%20%20color%3A%20%23000%3B%0D%0A%20%20%20%7D%0D%0A%20%3C%2Fstyle%3E%0D%0A%3C%2Fhead%3E%0D%0A%3Cbody%20%3E%0D%0A%20%3Cdiv%20id%3D%22content%22%3E%0D%0A%20%3C%2Fdiv%3E%0D%0A%20%3Cform%20name%3D%22pklaunch_frm%22%3E%0D%0A%20%3Cdiv%20id%3D%22controlbar%22%3E%0D%0A%20%20%3Cspan%20id%3D%22info%22%3E%3C%2Fspan%3E%3Cbr%3E%0D%0A%20%20Bandwidth%3A%0D%0A%20%20%3Cselect%20id%3D%22bwsel%22%20onchange%3D%22setBw()%3B%22%3E%0D%0A%20%20%20%20%3Coption%3E768%3C%2Foption%3E%0D%0A%20%20%20%20%3Coption%3E512%3C%2Foption%3E%0D%0A%20%20%20%20%3Coption%3E300%3C%2Foption%3E%0D%0A%20%20%20%20%3Coption%3E128%3C%2Foption%3E%0D%0A%20%20%20%20%3Coption%3E56%3C%2Foption%3E%0D%0A%20%20%3C%2Fselect%3E%20%7C%0D%0A%20%20%3Ca%20href%3D%22http%3A%2F%2Fmusic.yahoo.com%2F%22%20target%3D%22_blank%22%3EYahoo!%20Music%3C%2Fa%3E%20%7C%0D%0A%20%20%3Ca%20href%3D%22http%3A%2F%2Fwww.pooyak.com%2Fp%2Fpklaunch%2F%3Fv%3D0.6rc3%22%20target%3D%22_blank%22%3EpkLaunch%20v0.6rc3%3C%2Fa%3E%0D%0A%20%3C%2Fdiv%3E%0D%0A%20%3C%2Fform%3E%0D%0A%20%3Cscript%20type%3D%22text%2Fjavascript%22%3E%0D%0A%20%2F**%0D%0A%20%20*%20Read%20the%20JavaScript%20cookies%20tutorial%20at%3A%0D%0A%20%20*%20%20%20http%3A%2F%2Fwww.netspade.com%2Farticles%2Fjavascript%2Fcookies.xml%0D%0A%20*%2F%0D%0A%20%2F**%0D%0A%20%20*%20Sets%20a%20Cookie%20with%20the%20given%20name%20and%20value.%0D%0A%20%20*%0D%0A%20%20*%20name%20%20%20%20%20%20%20Name%20of%20the%20cookie%0D%0A%20%20*%20value%20%20%20%20%20%20Value%20of%20the%20cookie%0D%0A%20%20*%20%5Bexpires%5D%20%20Expiration%20date%20of%20the%20cookie%20(default%3A%20end%20of%20current%20session)%0D%0A%20%20*%20%5Bpath%5D%20%20%20%20%20Path%20where%20the%20cookie%20is%20valid%20(default%3A%20path%20of%20calling%20document)%0D%0A%20%20*%20%5Bdomain%5D%20%20%20Domain%20where%20the%20cookie%20is%20valid%0D%0A%20%20*%20%20%20%20%20%20%20%20%20%20%20%20%20%20(default%3A%20domain%20of%20calling%20document)%0D%0A%20%20*%20%5Bsecure%5D%20%20%20Boolean%20value%20indicating%20if%20the%20cookie%20transmission%20requires%20a%0D%0A%20%20*%20%20%20%20%20%20%20%20%20%20%20%20%20%20secure%20transmission%0D%0A%20%20*%2F%0D%0A%20function%20setCookie(name%2C%20value%2C%20expires%2C%20path%2C%20domain%2C%20secure)%0D%0A%20%7B%0D%0A%20%20%20%20%20document.cookie%3D%20name%20%2B%20%22%3D%22%20%2B%20escape(value)%20%2B%0D%0A%20%20%20%20%20%20%20%20%20((expires)%20%3F%20%22%3B%20expires%3D%22%20%2B%20expires.toGMTString()%20%3A%20%22%22)%20%2B%0D%0A%20%20%20%20%20%20%20%20%20((path)%20%3F%20%22%3B%20path%3D%22%20%2B%20path%20%3A%20%22%22)%20%2B%0D%0A%20%20%20%20%20%20%20%20%20((domain)%20%3F%20%22%3B%20domain%3D%22%20%2B%20domain%20%3A%20%22%22)%20%2B%0D%0A%20%20%20%20%20%20%20%20%20((secure)%20%3F%20%22%3B%20secure%22%20%3A%20%22%22)%3B%0D%0A%20%7D%0D%0A%0D%0A%20%2F**%0D%0A%20%20*%20Gets%20the%20value%20of%20the%20specified%20cookie.%0D%0A%20%20*%0D%0A%20%20*%20name%20%20Name%20of%20the%20desired%20cookie.%0D%0A%20%20*%0D%0A%20%20*%20Returns%20a%20string%20containing%20value%20of%20specified%20cookie%2C%0D%0A%20%20*%20%20%20or%20null%20if%20cookie%20does%20not%20exist.%0D%0A%20%20*%2F%0D%0A%20function%20getCookie(name)%0D%0A%20%7B%0D%0A%20%20%20%20%20var%20dc%20%3D%20document.cookie%3B%0D%0A%20%20%20%20%20var%20prefix%20%3D%20name%20%2B%20%22%3D%22%3B%0D%0A%20%20%20%20%20var%20begin%20%3D%20dc.indexOf(%22%3B%20%22%20%2B%20prefix)%3B%0D%0A%20%20%20%20%20if%20(begin%20%3D%3D%20-1)%0D%0A%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20begin%20%3D%20dc.indexOf(prefix)%3B%0D%0A%20%20%20%20%20%20%20%20%20if%20(begin%20!%3D%200)%20return%20null%3B%0D%0A%20%20%20%20%20%7D%0D%0A%20%20%20%20%20else%0D%0A%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20begin%20%2B%3D%202%3B%0D%0A%20%20%20%20%20%7D%0D%0A%20%20%20%20%20var%20end%20%3D%20document.cookie.indexOf(%22%3B%22%2C%20begin)%3B%0D%0A%20%20%20%20%20if%20(end%20%3D%3D%20-1)%0D%0A%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20end%20%3D%20dc.length%3B%0D%0A%20%20%20%20%20%7D%0D%0A%20%20%20%20%20return%20unescape(dc.substring(begin%20%2B%20prefix.length%2C%20end))%3B%0D%0A%20%7D%0D%0A%0D%0A%20%2F**%0D%0A%20%20*%20Deletes%20the%20specified%20cookie.%0D%0A%20%20*%0D%0A%20%20*%20name%20%20%20%20%20%20name%20of%20the%20cookie%0D%0A%20%20*%20%5Bpath%5D%20%20%20%20path%20of%20the%20cookie%20(must%20be%20same%20as%20path%20used%20to%20create%20cookie)%0D%0A%20%20*%20%5Bdomain%5D%20%20domain%20of%20the%20cookie%20(must%20be%20same%20as%20domain%20used%20to%20create%20cookie)%0D%0A%20%20*%2F%0D%0A%20function%20deleteCookie(name%2C%20path%2C%20domain)%0D%0A%20%7B%0D%0A%20%20%20%20%20if%20(getCookie(name))%0D%0A%20%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%20document.cookie%20%3D%20name%20%2B%20%22%3D%22%20%2B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20((path)%20%3F%20%22%3B%20path%3D%22%20%2B%20path%20%3A%20%22%22)%20%2B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20((domain)%20%3F%20%22%3B%20domain%3D%22%20%2B%20domain%20%3A%20%22%22)%20%2B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%22%3B%20expires%3DThu%2C%2001-Jan-70%2000%3A00%3A01%20GMT%22%3B%0D%0A%20%20%20%20%20%7D%0D%0A%20%7D%0D%0A%0D%0A%0D%0A%20%20%20var%20bw%3DgetCookie(%22pklaunch_bw%22)%3B%0D%0A%20%20%20var%20mh%3B%0D%0A%20%20%20if%20(bw%3D%3Dnull)%20%7B%0D%0A%20%20%20%20%20bw%3D768%3B%0D%0A%20%20%20%7D%0D%0A%20%20%20var%20bwsel%3Ddocument.forms%5B\'pklaunch_frm\'%5D.bwsel%3B%0D%0A%20%20%20for%20(i%3D0%3Bi%3Cbwsel.options.length%3Bi%2B%2B)%20%7B%0D%0A%20%20%20%20%20if%20(bwsel.options%5Bi%5D.value%3D%3Dbw)%20%7B%0D%0A%20%20%20%20%20%09bwsel.selectedIndex%3Di%3B%0D%0A%20%20%20%20%20%7D%0D%0A%20%20%20%7D%0D%0A%20%20%20var%20vidnum%3D'+this._vidnum+'%3B%0D%0A%20%20%20var%20confirmResize%3D0%3B%0D%0A%0D%0A%20%20%20function%20setBw()%20%7B%0D%0A%20%20%20%20%20bw%3Ddocument.getElementById(%22bwsel%22).value%3B%0D%0A%20%20%20%20%20setCookie(%22pklaunch_bw%22%2Cbw%2Cnew%20Date(%22January%201%2C%202010%2001%3A00%3A00%22)%2C%22%2F%22)%3B%0D%0A%20%20%20%20%20setPlayer()%3B%0D%0A%20%20%20%7D%0D%0A%20%20%20function%20setVideo(vn)%20%7B%0D%0A%20%20%20%09%20vidnum%3Dvn%3B%0D%0A%20%20%20%09%20setPlayer()%3B%0D%0A%20%20%20%7D%0D%0A%20%20%20function%20setHash(vmh)%20%7B%0D%0A%20%20%20%09%20mh%3Dvmh%3B%0D%0A%20%20%20%09%20setPlayer()%3B%0D%0A%20%20%20%7D%0D%0A%20%20%20function%20setPlayer()%20%7B%0D%0A%20%20%20%20%20var%20ton%3Dwindow.onresize%3B%0D%0A%20%20%20%20%20window.onresize%3Dnull%3B%0D%0A%0D%0A%09%20var%20wmvurl%3D\'http%3A%2F%2Flaunchtoday.launch.yahoo.com%2Fplayer%2Fmedialog.asp%3Fvid%3D\'%2Bvidnum%2B\'%26bw%3D\'%2Bbw%2B\'%26mf%3D1%26pid%3D4%26ps%3D0%26p1%3D2%26p2%3D19%26p3%3D2%26rpid%3D35%26pv%3D10%26bp%3DWindows%252520NT%26csid%3D396500550%26uid%3D1453478966%26pguid%3DEyn8J0.fyfuV36ip45Kw3A%26etid%3D0%26uguid%3D9e0q77l1c33ef%26fcv%3D%26mh%3D\'%2Bmh%3B%0D%0A%2F%2F%09%20var%20wmvurl%3D\'http%3A%2F%2Flaunchtoday.launch.yahoo.com%2Fplayer%2Fmedialog.asp%3Fvid%3D\'%2Bvidnum%2B\'%26bw%3D\'%2Bbw%2B\'%26mf%3D1%26pid%3D4%26ps%3D0%26p1%3D2%26p2%3D19%26p3%3D2%26rpid%3D35%26pv%3D10%26bp%3DWindows%252520NT%26csid%3D396500550%26uid%3D1453478966%26pguid%3DEyn8J0.fyfuV36ip45Kw3A%26etid%3D0%26uguid%3D9e0q77l1c33ef%26fcv%3D%26mh%3D416634cf1041e3e30f72fa8e626d2835%7C%7C1130505853373%26z%3Dms.asx\'%3B%0D%0A%2F%2F%20%20%20%20%20var%20wmvurl%3D\'http%3A%2F%2Flaunchtoday.launch.yahoo.com%2Fplayer%2Fmedialog.asp%3Fvid%3D\'%2Bvidnum%2B\'%26bw%3D\'%2Bbw%2B\'%26mf%3D1%26pid%3D4%26ps%3D0%26p1%3D2%26p2%3D18%26p3%3D2%26rpid%3D35%26pv%3D10%26bp%3DWindows%252520NT%26csid%3D396500550%26uid%3D1887827005%26pguid%3DRIICVUxc6ByOLsuSvXvA3g%26etid%3D0%26uguid%3D9e0q77l1c33ef%26fcv%3D%26mh%3D416634cf1041e3e30f72fa8e626d2835%7C%7C1130505853373%26z%3Dms.asx\'%3B%0D%0A%20%20%20%20%20%2F%2Fdocument.getElementById(\'content\').innerHTML%3D\'%3Cembed%20src%3D%22%22%20id%3D%22player%22%20autostart%3D%221%22%20%20displaysize%3D%224%22%20%20enablefullscreencontrols%3D%221%22%3E%3C%2Fembed%3E\'%3B%0D%0A%20%20%20%20%20document.getElementById(\'content\').innerHTML%3D\'%3Cembed%20src%3D%22\'%2Bwmvurl%2B\'%22%20id%3D%22player%22%20autostart%3D%221%22%20%20displaysize%3D%224%22%20%20enablefullscreencontrols%3D%221%22%3E%3C%2Fembed%3E\'%3B%0D%0A%20%20%20%20%20document.getElementById(\'player\').width%3Dwindow.innerWidth-10%3B%0D%0A%20%20%20%20%20document.getElementById(\'player\').height%3Dwindow.innerHeight-document.getElementById(\'controlbar\').clientHeight-10%3B%0D%0A%20%20%20%20%20window.onresize%3Dton%3B%0D%0A%20%20%20%7D%0D%0A%2F%2F%20%20%20setPlayer()%3B%0D%0A%20%20%20window.onresize%3Dfunction()%20%7B%0D%0A%20%20%20%20%20if%20((confirmResize%3D%3D1)%20%26%26%20(!confirm(\'Resizing%20needs%20restarting%20clip.%20Continue%3F\')))%20%7B%0D%0A%20%20%20%20%20%20%20return%3B%0D%0A%20%20%20%20%20%7D%0D%0A%20%20%20%20%20setPlayer()%3B%0D%0A%20%20%20%7D%3B%0D%0A%20%20%20window.setTimeout(\'confirmResize%3D1%3B\'%2C20000)%3B%0D%0A%20%20%20var%20d%3Dnew%20Date()%3B%0D%0A%20%20%20alert(d.hashCode())%3B%0D%0A%20%3C%2Fscript%3E%0D%0A%3C%2Fbody%3E%0D%0A%3C%2Fhtml%3E%0D%0A';
				
				var newdoc=window.open(dataurl,"_blank","resizable,width=400,height=400");
				getTitle(this._vidnum,newdoc);
				getHash(this._vidnum,newdoc);
			};

		}

	}
}

