function ProductPageHelper(AjaxRoot, ProductID, ProductLineID, ManufacturerID, CategoryID)
{
	this.AjaxRoot		= AjaxRoot;
	this.ProductID 		= ProductID;
	this.ProductLineID 	= ProductLineID;
	this.ManufacturerID = ManufacturerID;
	this.CategoryID 	= CategoryID;

	this.ShowFilteringIcon = function(Target)
	{
		var element = document.getElementById(Target);
		element.innerHTML = '<img src="/shared/images/icons/working_16x12.gif" width="16" height="12" border="0" alt="" /> Filtering ...<br /><br />';
	}

	this.FilterOrderingControl = function()
	{
		var FormID			= "oc_filter";
		var ElementID 		= "ordering_control_list";		
		var ajaxv2 			= new Ajaxv2();
		var container 		= document.getElementById(FormID);	
		var FormValues		= ajaxv2.GetFormValues(container);
		var Parameters 		= "action=FilterApplicationListing&product_id="+this.ProductID+"&manufacturer_id="+this.ManufacturerID+"&"+FormValues
		var objAjaxv2 		= new Ajaxv2(this.AjaxRoot+"/product_page_helper.php", this, this.GenericCallBack, "POST", Parameters, GlobalAjaxContextHandler);
		objAjaxv2.EventData	= ElementID;
		objAjaxv2.GetPost(true);
		this.ShowFilteringIcon(ElementID);	
	}
	
	this.GetOrderingControlFilterModels = function()
	{
		var Make = document.getElementById("oc_filter_make_id");
		var MakeID = Make.options[Make.selectedIndex].value;
		
		var ElementID 		= "OCFilterModel";
		var Parameters 		= "action=RefreshModelDropdown&product_id="+this.ProductID+"&manufacturer_id="+this.ManufacturerID+"&make_id="+MakeID;
		var objAjaxv2 		= new Ajaxv2(this.AjaxRoot+"/product_page_helper.php", this, this.GenericCallBack, "POST", Parameters, GlobalAjaxContextHandler);
		objAjaxv2.EventData	= ElementID;
		objAjaxv2.GetPost(true);
	}
	
	this.AddToCart = function(ProductApplicationID)
	{
		document.add_to_cart_form.product_application_id.value = ProductApplicationID;
		document.add_to_cart_form.submit();
	}
	
	this.onApplicationHover = function(ApplicationID) 
	{
		// clear out any results
		document.getElementById("add_to_list_result").innerHTML = "";
		document.getElementById("add_to_list_result").style.display= "none";
	    // remove the links for all the applications
	    var container 	= document.getElementById("application_order_list");
	    var divs 		= container.getElementsByTagName("div");
	    var i 			= 0;
	    while(i<divs.length)
	    {
	        divs[i].innerHTML = "";
	        i++;
	    }
	    // show the links for only the selected application
	    var linkHTML    = '<a href="javascript: void(0);" onclick="document.getElementById(\'add_to_list_result\').style.display=\'block\'; GlobalMyAccountHelper.AddToWishList('+ApplicationID+'); return false;"><img src="/shared/images/icons/famfamfam/star.png" width="16" height="16" border="0" alt="Add to Wish List" title="Add to Wish List" style="vertical-align: middle;" /> Add to Wish List</a>&nbsp;<a href="javascript: void(0);" onclick="document.getElementById(\'add_to_list_result\').style.display=\'block\'; GlobalMyAccountHelper.AddToPriceWatch('+ApplicationID+'); return false;"><img src="/shared/images/icons/famfamfam/eye.png" width="16" height="16" border="0" alt="Add to Price Watch" title="Add to Price Watch" style="vertical-align: middle;" /> Add to Price Watch</a>';
	    var divID       = "link"+ApplicationID;
	    document.getElementById(divID).innerHTML = linkHTML;
	}	
	
	this.ShowRestOfDescription = function()
	{
		this.ShowElement("rest_of_description");
		this.HideElement("more_info_link");
	}
	
	this.HideRestOfDescription = function()
	{
		this.HideElement("rest_of_description");
		this.ShowElement("more_info_link");
	}

	this.Popup = function(url)
	{
		var newwin = window.open(url, null, "location=no, menubar=no, status=no, toolbar=no, scrollbars=no");
	}
	
	this.SelectProductVideo = function()
	{
		var file 			= document.VIDEOFORM.Video[document.VIDEOFORM.Video.selectedIndex].value;
		var ElementID 		= "ProductVideo";
		var Parameters 		= "action=PlaySelectedVideo&product_id="+this.ProductID+"&manufacturer_id="+this.ManufacturerID+"&file_name="+file;
		var objAjaxv2 		= new Ajaxv2(this.AjaxRoot+"/product_page_helper.php", this, this.GenericCallBack, "POST", Parameters, GlobalAjaxContextHandler);
		objAjaxv2.EventData	= ElementID;
		objAjaxv2.GetPost(true);
	}
	
	this.SelectApplication = function(Url)
	{
		window.location = Url;	
	}
	
	this.ShowElement = function(ElementID, displayMode)
	{
		if(displayMode == undefined)
			displayMode = 'inline';	
		
		document.getElementById(ElementID).style.display = displayMode;	
	}
	
	this.HideElement = function(ElementID)
	{
		document.getElementById(ElementID).style.display = 'none';
	}
	
	/*** BEGIN CallBack Methods ***/
	this.GenericCallBack = function(Success, ResponseObject, EventData)
	{
		if(Success)
		{
			var element;
			var event_array = Array();
			try
			{
				eval("var obj= "+ResponseObject.responseText);
				
				if(EventData.constructor != Array)
					event_array.push(EventData);
				else
					event_array = EventData;
					
				for(var c=0; c<event_array.length; c++)
				{
					element = document.getElementById(event_array[c]);
					if(obj.Response != "")
						element.innerHTML = obj.Response;
				}				
				
				if(obj.Javascript != null)			
					window.eval(obj.Javascript);
			}
			catch(ex)
			{
				alert('Exception caught in ProductPageHelper '+ex.toString());	
			}				
		}
	}	
	/*** END CallBack Methods ***/
}