// Webflicker
// version 0.1b2
// 2007-12-08
// Copyright (c) 2007, Joel Rein (Jivlain)
// Contact: jivlain@gmail.com
//
// Released under the GPL (v2) license
// http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// ==UserScript==
// @name           Webflicker
// @namespace      http://jivlain.wordpress.com
// @description    Making the Webflicks site more usable
// @include        http://webflicks.com.au/*
// ==/UserScript==

/* VERSION HISTORY
 VERSION    DATE        AUTHOR				DESCRIPTION
 0.1b1		19/11/07	Jivlain				Initial version
 0.1b2		08/12/07	Jivlain				Removed modifications from pages that did not fot well with them
*/

/* CREDITS
 * Joel Rein (http://jivlain.wordpress.com)
*/

function inURL(str)
{
	return location.href.indexOf(str)>=0;
}

function webflicker()
{
	if(document.body.innerHTML.indexOf("loginRequiredPage.php")>0){
		if(inURL("homeNewUser")||inURL("homeExistingUser"))
			window.location="http://webflicks.com.au/user/loginRequiredPage.php";
	}
	else if(!inURL("reportDamagedDescription")){
		var str='<div style="position:absolute;top:2px;left:2px;width:15%;"><b>';
		str+='<a href="http://jivlain.wordpress.com/scripts/webflicker">Webflicker 0.1b2</a></b><br />';
		str+='<b>DVDs</b><br />';
		str+='<a href="http://webflicks.com.au/user/rentShipped.php">Current rentals</a><br />';
		str+='<a href="http://webflicks.com.au/user/rentList.php">Selections</a><br />';
		str+='<a href="http://webflicks.com.au/user/rentHistory.php">History</a><br />';
		str+='<b>Account</b><br />';
		str+='<a href="http://webflicks.com.au/user/accountBillingHistory.php">Billing</a><br />';
		str+='<a href="http://webflicks.com.au/user/accountServiceStatus.php">Service</a><br />';
		str+='</div>';
		document.body.innerHTML+=str;
	}
}
webflicker();
