(function($){
	
	$.extend({
		
		tlavideo: {
			
			/* Content begins here */
			
			
			tglLoginBg: function(e,focus) {
				var inputs = "";
				if (document.forms.TheLoginForm) {
					inputs = $("input:text,input:password",document.forms.TheLoginForm);
				} else if (document.forms['affliate-login-form']) {
					inputs = $("input:text,input:password",document.forms['affliate-login-form']);
				}
				if (!inputs.length) return false;
				inputs.filter("[name=email]").css("background","#fff url(../images/header/header-bg_login_email.gif) no-repeat 4px 4px");
				inputs.filter("[name=password]").css("background","#fff url(../images/header/header-bg_login_password.gif) no-repeat 4px 4px");
				inputs.filter("[name=store_name]").css("background","#fff url(../images/header/header-bg_login_store-name.gif) no-repeat 4px 4px");
				inputs.filter("[name=affl_password]").css("background","#fff url(../images/header/header-bg_login_password.gif) no-repeat 4px 4px");
				inputs.each(function(i) {
					if ($(this).val().length) $(this).css("background","#FFF");
				});
				if (e && focus) {
					$(e).css("background","#FFF");
				}
			},
			
			updateVMB: function() {
				var objMinute = $("#vodMinuteBalance");
				if (!objMinute.length) return false;
				$.ajax({
					type: "GET",
					data: {ts:new Date().getTime()},
					url: "../ajax/ajax_getVodMinutes.cfm",
					dataType: "xml",
					complete: function(xml) {
						var minutes = $("minutes",xml.responseXML).text();
						if (minutes == "error") return false;
						objMinute.text(minutes+((minutes!=1)?" Minutes ":" Minute ")+"Available");
					}
				});
			},
			
			tglInfoTabs: function(e) {
				var objTab = $(e);
				var objTabContent = $("#"+objTab.attr("id").replace(/-tab/,""));
				objTab.addClass("current");
				objTabContent.show();
				objTab.siblings().each(function(i) {
					var thisContent = $("#"+$(this).attr("id").replace(/-tab/,""));
					$(this).removeClass("current");
					thisContent.hide();
				});
				return false;
			},
			
			/* Content ends here */
			
			// user reviews functionality
			// added 11.12.07
			// msb
			
			userReviews: function() {
			
				$(".userReview").click( function() {
					$(this.parentNode).hide();
				});
				
				var $theSubmit = $("#reviewForm input[@type = 'submit']");
				var $theAlias = $("#reviewForm input[@name = 'alias']");
				var $theReviewTitle = $("#reviewForm input[@name = 'title']");
				var $theReview = $("#reviewForm textarea[@name = 'review']");
				var $theFormView = $("#reviewForm input[@name = 'view']");
			
				$theSubmit.click( function() {

					if ($theAlias.val().length <= 0) {
						$theAlias.prev().html("<strong>Your Alias:</strong> <span class='ajaxFormRequired'>(required)</span>"); }
					else if ($theReviewTitle.val().length <= 0) {
						$theReviewTitle.prev().html("<strong>Title of Your Review:</strong> <span class='ajaxFormRequired'>(required)</span>"); }
					else if ($theReview.val().length <= 0) {
						$theReview.prev().html("<strong>Your Review:</strong> <span class='ajaxFormRequired'>(required)</span>"); }
					else {
						$theReview
						.add($theAlias)
						.add($theSubmit)
						.add($theReviewTitle)
						.attr("disabled", "disabled");
						$theSubmit.val("Saving...");
						
						var $vars = $("#userReviewForm").attr("action");
						$vars = $vars.split("?");
						$vars = $vars[1];
						
						var thisData = {
							alias: $theAlias.val(),
							title: $theReviewTitle.val(),
							review: $theReview.val(),
							view: $theFormView.val()
						};
						$.ajax({
							type: "POST",
							url: "/ajax/ajax_userReviews.cfm?" + $vars,
							data: thisData,
							error: function(msg) {
								alert("Error: " + msg.responseText);
							},
							success: function(msg) {
								$(".userReviewTitle").html("Thank you for your submission!").css("text-transform", "uppercase");
								$("#reviewForm")
									.before("<div style=\"font:11px verdana,arial;text-align:justify;margin:10px 0;padding-bottom: 10px;border-bottom:1px dashed #bebebe\">Your submission will be reviewed by our editors and, if accepted, will be posted on our web site shortly. We reserve the right to reject submissions that we deem offensive or obscene. Once posted, we are unable to remove or edit submissions, under any circumstances.<p /></div>");
								$("#reviewForm").hide();
							}
						});			
					}
					
					$(".ajaxFormRequired").css({ color: "red", "font-weight": "bold" });					
					return false;				
				});

			}			
			
		},
		
		
/* Copyright (c) 2006 Mathias Bank (http://www.mathias-bank.de)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 * 
 * Thanks to Hinnerk Ruemenapf - http://hinnerk.ruemenapf.de/ for bug reporting and fixing.
 */		
		
		 getURLParam: function(strParamName){
			  var strReturn = "";
			  var strHref = window.location.href;
			  var bFound=false;
			  
			  var cmpstring = strParamName + "=";
			  var cmplen = cmpstring.length;
		
			  if ( strHref.indexOf("?") > -1 ){
			    var strQueryString = strHref.substr(strHref.indexOf("?")+1);
			    var aQueryString = strQueryString.split("&");
			    for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
			      if (aQueryString[iParam].substr(0,cmplen)==cmpstring){
			        var aParam = aQueryString[iParam].split("=");
			        strReturn = aParam[1];
			        bFound=true;
			        break;
			      }
			      
			    }
			  }
			  if (bFound==false) return null;
			  return strReturn;
			}
		
	});
	
	$(function() {
		/* onloads begin here */
		
		if (document.forms.TheLoginForm) {
			$("input:text,input:password",document.forms.TheLoginForm).focus(function() {
				$.tlavideo.tglLoginBg(this,true);
			}).blur(function() {
				$.tlavideo.tglLoginBg(this,false);
			}).change(function() {
				$.tlavideo.tglLoginBg(this,false);
			});
		} else if (document.forms['affliate-login-form']) {
			$("input:text,input:password",document.forms['affliate-login-form']).focus(function() {
				$.tlavideo.tglLoginBg(this,true);
			}).blur(function() {
				$.tlavideo.tglLoginBg(this,false);
			}).change(function() {
				$.tlavideo.tglLoginBg(this,false);
			});
		}
		
		$.tlavideo.tglLoginBg();
		$.tlavideo.updateVMB();
		$.tlavideo.userReviews();
		
		if ($("#vodMinuteBalance").length) window.setInterval($.tlavideo.updateVMB,60000);
		
		/* onloads end here */
	});

})(jQuery);






var articleInterval = new Array();
var articleIntervalCount = new Array();
var odBannerPos = 0;

function rotateArticle(seq) {
	var rowCount = 0;
	var curRow = 1;
	// figure out how many rows this SEQ has and set the display style
	while (document.getElementById("seq" + seq + "_row" + curRow)) {
		if (curRow == 1) {
			document.getElementById("seq" + seq + "_row" + curRow).style.display = "block";
		} else {
			document.getElementById("seq" + seq + "_row" + curRow).style.display = "none";
		}
		rowCount++;
		curRow++;
	}
	// set the rotation interval for this sequence
	articleInterval[seq] = window.setInterval("switchArticle(" + seq + "," + rowCount + ",'next')", 5000);
	articleIntervalCount[seq] = 0;
}

function switchArticle(seq,rowCount,action) {
	var curVisible = 0;
	var nextVisible = 0;
	// figure out which row is currently visible
	for (i=1; i <= rowCount; i++) {
		if (document.getElementById("seq" + seq + "_row" + i).style.display == "block") {
			curVisible = i;
			break;
		}
	}
	// based on current visible article, find the next article in the list to show
	if (action == 'next') {
		if (curVisible < rowCount) {
			nextVisible = curVisible + 1;
		} else if (curVisible == rowCount) {
			nextVisible = 1;
		}
	} else {
		if (curVisible <= rowCount && curVisible > 1) {
			nextVisible = curVisible - 1;
		} else if (curVisible == 1) {
			nextVisible = rowCount;
		}
	}
	// switch the display parameter on current and next visible articles
	document.getElementById("seq" + seq + "_row" + curVisible).style.display = "none";
	document.getElementById("seq" + seq + "_row" + nextVisible).style.display = "block";
	articleIntervalCount[seq]++;
	if (articleIntervalCount[seq] > 9) {
		skipArticle(seq,rowCount,'stop');
	}
}

function skipArticle(seq,rowCount,action) {
	if (action == 'next' || action == 'prev') {
		window.clearInterval(articleInterval[seq]);
		switchArticle(seq,rowCount,action);
		document.images['stopArticle' + seq].src = '../images/icon_play.gif';
		//articleInterval[seq] = window.setInterval("switchArticle(" + seq + "," + rowCount + ",'next')", 5000);
		articleInterval[seq] = 0;
	} else if (action == 'stop') {
		if (articleInterval[seq]) {
			window.clearInterval(articleInterval[seq]);
			articleInterval[seq] = 0;
			document.images['stopArticle' + seq].src = '../images/icon_play.gif';
		} else {
			articleInterval[seq] = window.setInterval("switchArticle(" + seq + "," + rowCount + ",'next')", 5000);
			articleIntervalCount[seq] = 0;
			document.images['stopArticle' + seq].src = '../images/icon_pause.gif';
		}
	}
	return false;
}

function tglDVDinfo(tgl) {
	var myTab = "info";
	switch(tgl) {
		case 1:
			myTab = "keyword";
			break;
		case 2:
			myTab = "review";
			break;
		case 3:
			myTab = "gallery";
			break;
		case 4:
			myTab = "scene";
			break;
	}
	var tabRef = {
		info: document.getElementById("product-info-tab"),
		keyword: document.getElementById("keywords-tab"),
		review: document.getElementById("user-reviews-tab"),
		gallery: document.getElementById("image-gallery-tab"),
		scene: document.getElementById("scenes-tab")
	}
	var contentRef = {
		info: document.getElementById("product-info"),
		keyword: document.getElementById("thekeywords"),
		review: document.getElementById("user-reviews"),
		gallery: document.getElementById("image-gallery"),
		scene: document.getElementById("scenes")
	}
	// reset tab-state and denote current
	if (tabRef.info) { tabRef.info.parentNode.className = ""; }
	if (tabRef.keyword) { tabRef.keyword.parentNode.className = ""; }
	if (tabRef.review) { tabRef.review.parentNode.className = ""; }
	if (tabRef.gallery) { tabRef.gallery.parentNode.className = ""; }
	if (tabRef.scene) { tabRef.scene.parentNode.className = ""; }
	tabRef[myTab].parentNode.className = "current";
	// reset content and show current
	if (contentRef.info) { contentRef.info.style.display = "none"; }
	if (contentRef.keyword) { contentRef.keyword.style.display = "none"; }
	if (contentRef.review) { contentRef.review.style.display = "none"; }
	if (contentRef.gallery) { contentRef.gallery.style.display = "none"; }
	if (contentRef.scene) { contentRef.scene.style.display = "none"; }
	contentRef[myTab].style.display = "block";
}

function tglHistory(tgl) {
	var myTab = "download";
	switch(tgl) {
		case 1:
			myTab = "rental";
			break;
		case 2:
			myTab = "ppm";
			break;
	}
	var tabRef = {
		download: document.getElementById("download-tab"),
		rental: document.getElementById("rental-tab"),
		ppm: document.getElementById("ppm-tab")
	}
	var contentRef = {
		download: document.getElementById("download-history"),
		rental: document.getElementById("rental-history"),
		ppm: document.getElementById("ppm-history")
	}
	// reset tab-state and denote current
	if (tabRef.download) { tabRef.download.parentNode.className = ""; }
	if (tabRef.rental) { tabRef.rental.parentNode.className = ""; }
	if (tabRef.ppm) { tabRef.ppm.parentNode.className = ""; }
	tabRef[myTab].parentNode.className = "current";
	// reset content and show current
	if (contentRef.download) { contentRef.download.style.display = "none"; }
	if (contentRef.rental) { contentRef.rental.style.display = "none"; }
	if (contentRef.ppm) { contentRef.ppm.style.display = "none"; }
	contentRef[myTab].style.display = "block";
}

function ondemandBannerSkip(d) {
	if (odBanner.length > 1) {
		var objBanner = $("#header-banner h2:eq(0) img:eq(0)");
		var objBannerLink = objBanner.parent();
		var i = 0;
		if (d) {
			if (eval(odBannerPos+1) == odBanner.length) {
				odBannerPos = 0;
			} else {
				odBannerPos++;
			}
		} else {
			if (odBannerPos == 0) {
				odBannerPos = eval(odBanner.length - 1);
			} else {
				odBannerPos--;
			}
		}
		objBanner.attr("src",(d)?odBanner[odBannerPos].imgpath:odBanner[odBannerPos].imgpath);
		objBannerLink.attr("href",odBanner[odBannerPos].link);
	}
}

function viewGallery(gid) {
	myURL = "../viewGallery.cfm?gid=" + gid;
	myNewWindow = "view_gallery";
	myWindowProperties = "width=380,height=500,toolbar=no,status=no,scrollbars=no,location=no,menubar=no,directories=no";
	window.open(myURL,myNewWindow,myWindowProperties);
}
//the following dsp_gallery function has been deprecated and is not recommended, please use viewGallery() instead
function dsp_gallery(gid) {
	viewGallery(gid);
}

// legacy functions
function replaceText(el, text) {
	if (el != null) {
		clearText(el);
		var newNode = document.createTextNode(text);
		el.appendChild(newNode);
	}
}

function clearText(el) {
	if (el != null) {
		if (el.childNodes) {
			childLength = el.childNodes.length;
			for (var i = 0; i < childLength; i++) {
				el.removeChild(el.firstChild);
			}
		}
	}
}

function getText(el) {
	var text = "";
	if (el != null) {
		if (el.childNodes) {
			for (var i = 0; i < el.childNodes.length; i++) {
				var childNode = el.childNodes[i];
				if (childNode.nodeValue != null) {
					text = text + childNode.nodeValue;
				}
			}
		}
	}
	return text;
}

function RTrim(str) {
	while(str.charAt((str.length -1))==" "){
		str = str.substring(0,str.length-1);
	}
	return str;
}

function LTrim(str){
	while(str.charAt(0)==" "){
		str = str.replace(str.charAt(0),"");
	}
	return str;
}

function Trim(str){
	str = LTrim(str);
	return RTrim(str);
}

function addLoadEvent(func) {
   var oldonload = window.onload;
   if (typeof window.onload != 'function') {
       window.onload = func;
   }
   else {
       window.onload = function() {
           oldonload();
           func();
       }
   }
}




function VODFavorite() {

    this.add = function(curuserID, prodID) {
    	// alert(curuserID + " : " + prodID);
		$.ajax({
			type: "GET",
			url: "../ajax/ajax_VODFavorite.cfm",
			data: {a:"add",cid:curuserID,pid:prodID,ts:new Date().getTime()},
			complete: function(request) {
				var vodFaveLink = new VODFavorite;
				vodFaveLink.get(curuserID, prodID);
			}
		});
    }
    
    this.get = function(curuserID, prodID) {
        // Make sure the passed var is a number
		$.ajax({
			type: "GET",
			url: "../ajax/ajax_VODFavorite.cfm",
			data: {a:"view",cid:curuserID,pid:prodID,ts:new Date().getTime()},
			complete: function(request) {
				var XMLTableOutput = $(request.responseXML);
				var listFave = XMLTableOutput.find("favelist");
				var custid = XMLTableOutput.find("custid:eq(0)").text();
				var prodid = XMLTableOutput.find("prodid:eq(0)").text();
				var isfave = XMLTableOutput.find("isfave:eq(0)").text();
				// if not already a fave, show "add" link. If already a link, display "watch" message
				$('#vodFavoriteText').empty()
				if (isfave != 0) {
					$('#vodFavoriteText').append('<a href="javascript:void(0);"><img src="../images/btns/remove.gif" border="0" alt="" /></a>');
				} else {
					$('#vodFavoriteText').append('<a href="javascript:void(0);"><img src="../images/btns/favorites.gif" border="0" alt="" /></a>');
				}
				var vodFaveLink = new VODFavorite;
				if (isfave != 0) {
					$('#vodFavoriteText a:last-child').click(function() {
						vodFaveLink.remove(custid,prodid);
					});
				} else {
					$('#vodFavoriteText a:last-child').click(function() {
						vodFaveLink.add(custid,prodid);
					});
				}
			}
		});
    }

	this.remove = function(curuserID, prodID) {
		$.ajax({
			type: "GET",
			url: "../ajax/ajax_VODFavorite.cfm",
			data: {a:"remove",cid:curuserID,pid:prodID,ts:new Date().getTime()},
			complete: function(request) {
				var vodFaveLink = new VODFavorite;
				vodFaveLink.get(curuserID, prodID);
			}
		});	
	}
	
}

function PPMOverlay() {

	var self = this;
	
	
	
	// a fail-safe to keep a user from clicking rapidly and launching
	// numerous overlays.
	var toggled = 0;	
	
	
	
	// init();
	// Check to see if an item with the class .PPMoverlayImage exists
	// (this class will only exist on VOD scene images where PPM
	// isn't available, and the user doesn't have an active rental.)
	// Assign click functions to all such links.
	// Create our overlays.
	this.init = function() {
		
		var overlayClass = $(".PPMoverlayLink");
		if (overlayClass.length) {
			this.create();
	
			// on click, toggle between 
			// showing/hiding our overlay.
			$(".PPMoverlayLink")
				.click( function(e) {
				
					// capture event, fix it for IE
					var event = self.fixEvent(e);
					
					var pdOffset = $("#info-cont").offset();
					var pdHeight = $("#info-cont").outerHeight();
					var ovOffset = $("#PPMoverlay").offset();
					var ovHeight = $("#PPMoverlay").outerHeight();
					
					var newTop = (event.pageY-pdOffset.top)-(ovHeight/2);
					if (newTop < 1) { newTop = 1; }
					else if ((event.pageY-pdOffset.top)+(ovHeight/2) > pdHeight) {
						newTop = pdHeight-ovHeight; 
					}

					if (toggled == 0) {
						$("#PPMoverlay").css("top", newTop);						
						$("#PPMoverlay").fadeIn("normal");
						toggled = 1;
					} else {
						$("#PPMoverlay").hide();
						toggled = 0;
					}
					
					return false;
				});
			$("#scenes-tab")
				.click( function() {
					if (toggled == 1) {
						$("#PPMoverlay").show();
					}
				});
			$("#product-info-tab")
				.add("#user-reviews-tab")
				.click( function() {
					if (toggled == 1) {
						$("#PPMoverlay").hide();
					}
				});
				
		}
	}; // end init();
	
	
	// fixEvent();
	// apparently IE doesn't have a pageX or pageY
	// return proper values in this
	this.fixEvent = function(e) {
		if ( e.pageX == null && e.clientX != null ) {
      		var e = document.documentElement, b = document.body;
      		e.pageX = e.clientX + (e && e.scrollLeft || b.scrollLeft || 0);
      		e.pageY = e.clientY + (e && e.scrollTop || b.scrollTop || 0);
   		}
   		return e;
	} // end fixEvent();

	// create();
	// Specify the error message.
	// Generate our overlays.
	// Determine the size and placement of our target div ("#scenes")
	// Center the overlays in the div.	
	this.create = function() {
	
		var parentDiv = $("#info-cont");
		var error = "<p>Sorry, this title is not available for Pay-Per-Minute.<br /> " +
					"To purchase a rental of this title, click the link above.</p>" +
					"<p style='text-align: right'><img src='../images/icon_close.gif' /></p>";
		
		$("<div id='PPMoverlay'>" + error + "</div>")
			.prependTo(parentDiv);
			
		var overlayValues = {
			position: "absolute",
			left: 0,
			top: 0,
			height: "45px",
			"z-index": "5000",
			opacity: "0.9",
			"-moz-opacity": "0.9",
			filter: "alpha(opacity=90)"
		}	
		$("#PPMoverlay")
			.css(overlayValues);
		$("#PPMoverlay")
			.click( function() {
				if (toggled == 1) {
					$(this).hide();
					toggled = 0;
				}
				return false;
			})
			.css("display", "none");

		
	}; // end create();
	
}


// TLA Star Rating UI
// coded by: msb
// final draft date: [unknown]


function tlaRating() {

	// configurable user variables
	// sets the name of the containers that display
	// either a rating interface or the average 
	// rating for current product.	
	var userCont = ".user-rating";
	var avgCont = ".average-rating";
	
	// script variables.
	var self = this;
	var logged;
	
	if (typeof(window["globalProductID"]) != "undefined") {
		var productID = globalProductID;
	}
	
	var rater = 1;
	var finalRating = 0;
	
	var userSaved;
	
	// init function
	this.activate = function() {
		if (logged == undefined && typeof(window["globalProductID"]) != "undefined") {
			logged = $.ajax({
				type: "GET",
				url: "../ajax/ajax_UserRatings.cfm",
				data: { method: "getLoginStatus" },
				complete: function(request) {
					return request.responseText;
				}
			});
		}
		
		if ($("span", userCont).length) { 
			rater = 1;
			$("span", userCont).each( function() {
				self.build(1, this);
				rater++;	
			});
		}
		if ($("span", avgCont).length) {
			rater = 1;
			$("span", avgCont).each( function() {
				self.build(2, this);
				rater++;	
			});
		}
	};
	
	// if javascript is enabled, overwrite the
	// degradable rating interface with swanky
	// ajax-powered interface.
	this.build = function(set, cont) {
		if (userSaved <= 0 || !userSaved ) {
			$("label", userCont).html("Rate this:");
		} else {
			$("label", userCont).html("Your rating:");
		}
		if (set == 1) { var type = "user"; } else { var type = "avg"; }

		$(cont).empty();
		
		if (!logged && set == 1) {
			$(cont.parentNode).html("Please log in to rate this item.");
		} else {
			for (var i = 1; i <= 8; i++) {
				if (i%2) { starHalf = "lstar"; }
				else { starHalf = "rstar"; }
				if (i < 3) { ender = " Star' />"; }
				else { ender = " Stars' />"; }
				$(cont).append("<img border='0' src='../images/elements/" + starHalf + "_" + set + ".gif' class='stars off' name='star" + set + "_" + i + "' alt='" + type + rater + ": star" + set + "_" + i + "' title='" + i/2 + ender);
			}
			if (set == 1) {
				$(cont).prepend("<img border='0' src='../images/elements/0stars.gif' class='zerostars off' alt='0 stars' title='Cancel rating'>");
				$(".zerostars").hover( function() { $(this).addClass("on"); $(this).removeClass("off"); },
										function() { $(this).addClass("off"); $(this).removeClass("on"); })
								.css("cursor", "pointer")
								.click( function() { userSaved = 0; self.setUserRating(0); });
				$("img[ @alt *= '" + type + rater + ":']", cont).each( function() {
					$(this).css("cursor", "pointer");
					var starAlt = $(this).attr("alt");
					var starBuild = starAlt.substring(4, 5);
					var set = starAlt.substring(starAlt.length-2, starAlt.length-3);
					var rating = starAlt.substring((starAlt.length-1), starAlt.length);
					
					$(this).mouseover( function() { self.emptyStars(starBuild); self.lightStars(set, rating, starBuild); });
					$(this).mouseout( function() { self.emptyStars(starBuild); self.lightStars(set, userSaved, starBuild); });
					$(this).click( function() { userSaved = rating; self.setUserRating(rating); });
				});
				self.getUserRating(rater);
			} else {
				self.getAvgRating(rater); }
		}
		
	};

	// these functions handle the highlighting/mouseover actions of the stars
	
	this.emptyStars = function(rater) {
		$("img[ @alt *= 'user" + rater + "' ]").removeClass("on").addClass("off").end();
	};
	
	this.lightStars = function(set, rating, build) {
		for (var i = 1; i <= rating; i++) {
			if (set == 1) { var tempStar = "user" + build + ": star" + set + "_" + i; }
			else { var tempStar = "avg" + build + ": star" + set + "_" + i; }
			$("img[ @alt = " + tempStar + " ]").removeClass("off").addClass("on").end();
		}
	};
	
	this.setUserRating = function(rating) {
		$("span", userCont).html("Saving...");
		finalRating = rating;
		$.ajax({
			type: "GET",
			cache: false,
			url: "../ajax/ajax_UserRatings.cfm?output=true&random=" + (Math.random() * Date.parse(new Date())),
			data: { method: "setUserRating", id: productID, rating: finalRating },
			complete: function() {
				self.activate();
			}
			
		});
	};
	
	this.getAvgRating = function(build) {
		$.ajax({
			type: "GET",
			dataType: "html",
			cache: false,
			url: "../ajax/ajax_UserRatings.cfm?output=true&random=" + (Math.random() * Date.parse(new Date())),
			data: { method: "getAvgRating", id: productID },
			complete: function(request) {
				var int = Math.round(request.responseText);
				self.lightStars(2, int, build);
			}
		});
	};
	
	this.getUserRating = function(build) {
		if (userSaved != undefined) {
			self.lightStars(1, userSaved, build);
		} else {
			$.ajax({
				type: "GET",
				dataType: "html",
				cache: false,
				url: "../ajax/ajax_UserRatings.cfm?output=true&random=" + (Math.random() * Date.parse(new Date())),
				data: { method: "getUserRating", id: productID },
				complete: function(request) {
					var int = Math.round(request.responseText);
					userSaved = int;
					self.lightStars(1, int, build);
				}
			});
		}
	};
	
};



$(document).ready(function() {
	
	var newOverlay = new PPMOverlay;
	newOverlay.init();
	var wee = new tlaRating();
	wee.activate();	

}); 