
function popup(url,name,prop)
{
	Hwnd = window.open(url,name,prop);
	Hwnd.window.focus();
}

var pop;

function CloseWin1()
{
	if (!pop || pop.closed)
	{
		var Clsd = 1;
	}
	else
	{
		pop.close();
	}
}

function doActionZC(id)
{
	CloseWin1();
	
	items = new Array("IASBA's General fund - Annual membership",
					  "IASBA's General fund - Lifetime membership",
					  "IASBA's General fund - Other Amount",
					  "IASBA's General fund - Other Monthly Recurring Amount",
					  'Gaza Humanitarian Aid Project',
					  'Drug Abuse Education & Rehabilitation Program in Egypt',
					  'Drug Abuse Education & Rehabilitation Program in Palestine',
					  'Drug Abuse Education & Rehabilitation Program in Jordan',
					  'Campaign against illiteracy in Palestine',
					  'Campaign against illiteracy in Lebanon',
					  'Campaign against illiteracy in Egypt');

	var prodid = 9999;
	var cpath = 9999;
	
	switch (id)
	{
		case 0: prodid = 180; break;
		case 1: prodid = 181; break;
		case 2: prodid = 182; break;
		case 3: prodid = 183; break;
		case 4: prodid = 184; break;
		case 5: prodid = 185; break;
		case 6: prodid = 186; break;
		case 7: prodid = 187; break;
		case 8: prodid = 188; break;
		case 9: prodid = 189; break;
		case 10: prodid = 190; break;
	}
	if (id >= 0 && id <= 3) cpath = 67;
	if (id >= 4 && id <= 10) cpath = 65;

	if(id == '0')
	{
		amt = 240;
		document.zencart.cart_quantity.value = "1";
	}
	else if(id == '1')
	{
		amt = 2400;
		document.zencart.cart_quantity.value = "1";
	}
	else
	{
		if(document.donateForm.elements["price[]"][id].value == '')
		{
			alert("Amount cannot be empty");
			document.donateForm.elements["price[]"][id].focus();
			return false;
		}
		if(isNaN(document.donateForm.elements["price[]"][id].value))
		{
			alert("Amount cannot be string");
			document.donateForm.elements["price[]"][id].focus();
			return false;
		}

		amt = document.donateForm.elements["price[]"][id].value;
		document.zencart.cart_quantity.value = amt;
	}

	document.zencart.cPath.value = cpath;
	document.zencart.products_id.value = prodid;
	popWindow(document.zencart,prodid);
	
	return 0;
}

function popWindow(frm,target_flag)
{
	features = 'width=800,height=800,toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes';
	pop = window.open('',frm.target,features);
	frm.method = 'POST';
	frm.action = "http://iasba.org/zencart/index.php?main_page=shopping_cart&action=add_product";
	frm.submit();
}
