    ///mark load time to catch session timeout
    var loadtime;
    loadTime = new Date().getTime();

    
    function rentIt(title)
	{
		window.open('rent.aspx?title=' + title, 'rent', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=400,height=400,left = 100,top = 100');
	}
	
	
	
	function openWin(win)
	{
		window.open(win, 'rent', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=300,height=200,left = 437,top = 364');
	}
	
	function rentItGold(title)
	{
		window.open('rent.aspx?title=' + title, 'rent', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=300,height=305,left = 437,top = 364');
	}
	
	function openAvailabilityExplanation(page)
	{
		window.open(page, 'availability', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=300,height=200,left = 437,top = 364');
	}
	
	function swapRatingImageImage(num)
	{
		var i;
		for(i=1;i <= num;i++)
		{
			eval('document.all.ctlRating_imgrating' + i + '.src="images/redStarOn.gif"');
		}
		
		if (num < 5)
		{
			for(i=num + 1;i<=5;i++)
			{
				eval('document.all.ctlRating_imgrating' + i + '.src="images/redStarOff.gif"');
			}
		}
	}
	
	function resetAverageRating(average)
	{		
		var i;
		for(i=1;i<=5;i++)
		{
			if(i<=average)
			{
				eval('document.all.ctlRating_imgrating' + i + '.src="images/redStarOn.gif"');
			}
			else
			{
				eval('document.all.ctlRating_imgrating' + i + '.src="images/redStarOff.gif"');
			}			
		}
	}
	
	function rateIt(titleID,rating)
	{
		window.open('rate.aspx?title=' + titleID + '&rating=' + rating, 'rent', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=250,height=50,left = 437,top = 364');
	}

	function destroyPopup()
	{
		if(window.opener)
		{
			//this is a popup window - destroy!
			window.opener.location = window.location;
			window.close();
		}
	}

function PageQuery(q) 
	{
		if(q.length > 1) this.q = q.substring(1, q.length);
		else this.q = null;
		this.keyValuePairs = new Array();
		if(q) {
				for(var i=0; i < this.q.split("&").length; i++) {
					this.keyValuePairs[i] = this.q.split("&")[i];
					}
			}
		this.getKeyValuePairs = function() { return this.keyValuePairs; }
		this.getValue = function(s) {
				for(var j=0; j < this.keyValuePairs.length; j++) {
					if(this.keyValuePairs[j].split("=")[0] == s)
					return this.keyValuePairs[j].split("=")[1];
					}
					return false;
				}
			this.getParameters = function() {
				var a = new Array(this.getLength());
				for(var j=0; j < this.keyValuePairs.length; j++) {
				a[j] = this.keyValuePairs[j].split("=")[0];
				}
			return a;
			}
			this.getLength = function() { return this.keyValuePairs.length; } 
	}

function submitFreeTrial()
{
	document.all.hasPosted.value = '1';
	document.all.mainForm.submit();
}

//this code is to trigger the "rent it" code from a url request
var page = new PageQuery(window.location.search);
if (page.getValue('rentitid')) rentIt(page.getValue('rentitid'));

//this code will break out of a frame if any page is loaded in one
function frameBreakout()
{
	if (top.location !=  location)
	{
		top.location.href = location.href;
	}
}

frameBreakout();

