// cast upper

// version 0.7
// ד' בטבת התש"ע

//  21/12/2009

// contact: http://hatul.info/contact

// Released under the GPL license

// http://www.gnu.org/copyleft/gpl.html

//

// --------------------------------------------------------------------

//

// This is a Greasemonkey user script.

//

// To install, you need Greasemonkey: http://greasemonkey.mozdev.org/

// Then restart Firefox and revisit this script.

// Under Tools, there will be a new menu item to "Install User Script".

// Accept the default configuration and install.

//

// To uninstall, go to Tools/Manage User Scripts,

// select "cast upper", and click Uninstall.

//

// --------------------------------------------------------------------

//

// ==UserScript==

// @name           cast upper

// @namespace     http://amiad.blogli.co.il

// @description    Fix cast up video (sport 5, shesh.co.il, 103FM, 23TV)

// @include       http://switch*.castup.net/customers/*

// @exclude	  http://switch*.castup.net/*flv*

// ==/UserScript==



var url=unescape(window.location.href);

url=url.toLowerCase();

var istart=url.indexOf("clipurl");

var iend=url.length;

istart+=8;

url=url.substring(istart, iend);
url=url.replace("gmpl.aspx","gmp2.asp");



//fix tv23.co.il

if(unescape(window.location.href).indexOf("Customers/TV23")!=-1){

  var showName=url.substring(url.indexOf("ar=")+3);

  url="http://switch3.castup.net/cunet/gm.asp?cucontentlinktype=1&ai=594&ar="+showName+"&ak=null";

}

window.location.href=url;


