function FAQ(n)
{
	
	var	url = "/faq.html?#" + n;
	
	newwindow=window.open(url,'','height=450,width=450, resizable=no,scrollbars');
	if (window.focus) {newwindow.focus()}
}
function popup_delivery(items,grand_total)
{
	
	var	url = "delivery.asp?items=" + items + "&tot=" + grand_total;
	newwindow=window.open(url,'','height=450,width=450, resizable=no,scrollbars');
	if (window.focus) {newwindow.focus()}
}
function popituphem()
{
	newwindow=window.open('/gallery/hemming.html','','height=350,width=450, resizable=no,scrollbars');
	if (window.focus) {newwindow.focus()}
}

function popitupsmall()
{
	newwindow=window.open('/gallery/sizes_popup.html','','height=350,width=450, resizable=no,scrollbars');
	if (window.focus) {newwindow.focus()}
}

function popitupmeasure()
{
	newwindow=window.open('/gallery/measure.html','','height=450,width=650, resizable=no,scrollbars');
	if (window.focus) {newwindow.focus()}
}

function popup_subscribe()
{
	newwindow=window.open('/subscribe.html','','height=300,width=610, resizable=no,scrollbars');
	newwindow.focus();
}


function is_empty(form)
{
	for (var i=0;i<document.add_to_cart.elements.length;i++)
	{
		//alert (document.add_to_cart.elements[i].name +  "=" +document.add_to_cart.elements[i].value);
		if (form.elements[i].getAttribute('required') == "1")
		{
			if (isEmpty(form.elements[i].value)) 
			{
				var msg = form.elements[i].getAttribute('nick') + "\n\nREQUIRES ENTRY!";
				alert(msg);
				return false;
			}
		}
		if (form.elements[i].getAttribute('is_numeric') == "1")
		{
			if (form.elements[i].value != "")
			{
				if (!isNumeric(form.elements[i].value, form.elements[i].getAttribute('nick') + " must be numeric!"))
				{
					return false;
				}
			}
		}
	}return true;
}

function is_empt(form)
{

	for (var i=0;i<form.elements.length;i++)
	{
		//alert (form.elements[i].name +  "=" +form.elements[i].value);
		if (form.elements[i].getAttribute('required') == "1")
		{
			if (isEmpty(form.elements[i].value)) 
			{
				var msg = form.elements[i].getAttribute('nick') + "\n\nREQUIRES ENTRY!";
				alert(msg);
				return false;
			}
		}
		if (form.elements[i].getAttribute('is_numeric') == "1")
		{
			if (form.elements[i].value != "")
			{
				if (!isNumeric(form.elements[i].value, form.elements[i].getAttribute('nick') + " must be numeric!"))
				{
					return false;
				}
			}
		}
	}return true;
}


function isEmpty (obj) 
{
	if(typeof(obj) == "string")
		var str = obj;
	else
		var str = obj.value;
	
	var tempstr = "";
	
	for (var i=0;i<str.length;i++)
	{
		if(!(str.charCodeAt(i)==32))
		{
			tempstr = tempstr +  str.charAt(i)
			//alert(tempstr);
		}
	}
	var tstPat = /./;
	if (!tstPat.test(tempstr)) 
	{
		return true;
	}
		return false;
}

function isNumeric (obj, ErrorMessage) 
{
	if(typeof(obj) == "string")
		str = obj;
	else
		str = obj.value;

	tstPat = /\D/;
	if (tstPat.test(str) ) 
	{
		alert(ErrorMessage);
		return false;
	}
	return true;

}

function PopUp(url ,page_params ) 
	{
		window.open(url,"plt",page_params);
	}
	
