//********************** JAVA SCRIPT LIBRARY ************************************************
//******  Author : Luis Alberto Navarro Dominguez    ****************************************
//******    Date : 02-05-07                          ****************************************
//****** Project : AppixSoft | Sites 				 ****************************************
//******  Legend :                           Ex:                                *************
//******           Global Variables -->           "global_Variable" or "global" *************
//******            Local Variables -->           "_localVariable" or "_local"  *************
//******                  Functions -->           "functionName"                *************
//******                    Objects -->           "ObjectName"                  *************
//******       Non-Object Parameter -->           "prmName"                     *************


//**** Str      <--     String
//**** Char     <--     Character
//**** Nbr      <--     Number

//**** Img      <--     Image
//**** Btn      <--     Button
//**** Obj      <--     Object

//**** Del      <--     Delete
//**** Val      <--     Value
//**** Prm      <--     Parameter
//**** Pos      <--     Position
//**** Sel      <--     Selected
//**** Len      <--     Length
//**** Rep      <--     Repeated
//**** Req      <--     Required
//**** Rec      <--     Record
//**** Fld      <--     Field
	   

//*******************************************************************************************
//*************************                   ***********************************************
//*************************     FUNCTIONS     ***********************************************
//*************************                   ***********************************************
//*******************************************************************************************

//************************ PRODUCT ZOOM IN **************************************************
function zoomIn(prmSecondaryFolder, prmFileName)
{
	w_PopUp = openPopUpWindow(w_PopUp, "s_zoomin.asp?mFolder=product&sFolder=" + prmSecondaryFolder + "&fName=" + prmFileName, 785, 500, 1, 1, 1);
}

function addToCart(prmProductID)
{
	with (document.ProductForm)
	{
		AddItem.value = elements["ProductID"+prmProductID].value;
		VARquantity.value = elements["ProductID"+prmProductID+"Quantity"].value;
		if (elements["ProductID"+prmProductID+"Price"])
		{			
			for (var i=0; i<elements["ProductID"+prmProductID+"Price"].length; i++)
			{
				if (elements["ProductID"+prmProductID+"Price"][i].checked)
				{
					VARcost.value = elements["ProductID"+prmProductID+"Price"][i].value;
					break;
				}
			}
		}
		action = "https://www.cartmanager.net/cgi-bin/cart.cgi"; 
		submit();
	}
}

function addToPaypalCart(prmProductID)
{
	var _formObj;
	
	if (document.ProductForm)
		_formObj = document.ProductForm;
	else
		_formObj = document.ProductInformation;
	
	with (_formObj)
	{
		elements["item_name"].value = elements["Item"+prmProductID+"Name"].value;
		elements["item_number"].value = elements["Item"+prmProductID+"SKU"].value;
		elements["item_description"].value = elements["Item"+prmProductID+"Description"].value;
		elements["amount"].value = elements["Item"+prmProductID+"Price"].value;
		elements["quantity"].value = elements["Item"+prmProductID+"Quantity"].value;
		if (elements["Item"+prmProductID+"ShippingMethod"])
		{
			elements["shipping"].value = elements["Item"+prmProductID+"ShippingMethod"].value;
			elements["shipping2"].value = elements["Item"+prmProductID+"ShippingMethod"].value;
			elements["on0"].value = "Shipping Method";
			elements["os0"].value = elements["Item"+prmProductID+"ShippingMethod"].options[elements["Item"+prmProductID+"ShippingMethod"].selectedIndex].text;
		}
		else
		{
			elements["shipping"].value = 0;
			elements["shipping2"].value = 0;
			elements["on0"].value = "";
			elements["os0"].value = "";
		}
		action = "https://www.paypal.com/cgi-bin/webscr"; 
		submit();
	}
}
