<!--

    
function ZoomPict(imgname)
    {

       var w = window.open("", "bigimg","toolbar=no,scrollbars=yes,width=425,height=300");
       var d = w.document;
       d.write('<HTML><HEAD><TITLE>::::: click image to close :::::</TITLE></HEAD>');
       d.write('<BODY  bgcolor="#000000" onblur=self.close() border=0>');
       d.write('<table border="0" align="center" cellpadding="5">');
       d.write('<tr bgcolor="#ffffff"> ');
       d.write('<td><center><a href="javascript:self.close()"><IMG SRC="'+imgname+'" border=0></A></center></td>');
       d.write('</tr>');
       d.write('</table>');
       d.write('</BODY></HTML>');
       d.close();

    }

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// AJAX FUNCTIONS
function getXMLHTTP()
 {
 	try {
		request_o = new ActiveXObject("Microsoft.XMLHTTP");
	} catch(ex) {
		//either this is not IE, or it is a version of IE which does not support XMLHTTP
		var notIECompatibleXMLHTTP=true;
	}
	if (notIECompatibleXMLHTTP==true) {
		try {
			request_o = new XMLHttpRequest();
		} catch(ex) {
			//we can't use AJAX because this browser is not compatible.
			request_o = false;
		}
	}

	return request_o;
}

var responseObjectId = null;		// the id of the object to receive the response data
var useCustomFn = false;			// use a custom function to process the results - calling page must have function: processResults(response)
function sendAjaxRequest(url,objId,customFn) {
		responseObjectId = objId;
		useCustomFn = customFn;
		
		if (document.getElementById(responseObjectId)) {
			http = getXMLHTTP();
			if (http) {
				http.open('get',  url);
				http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	
				/* Define a function to call once a response has been received. This will be our
					handleProductCategories function that we define below. */
				http.onreadystatechange = receiveAjaxResponse;
				/* Send the data. We use something other than null when we are sending using the POST
					method. */
				http.send(null);
			} else {
				alert("xmlHTTP cannot be created");
			}
		} else {
			alert("responseObject not found");
		}
}

function receiveAjaxResponse() {
	if (http.readyState == 4){ //Finished loading the response
		/* We have got the response from the server-side script,
			let's see just what it was. using the responseText property of
			the XMLHttpRequest object. */
		var response = http.responseText;
		/* And now we want to change the product_categories <div> content.
			we do this using an ability to get/change the content of a page element
			that we can find: innerHTML. */
			//alert(response);
		if (!useCustomFn) {
			//document.getElementById(responseObjectId).innerText = response;
			alert(response);
		} else {
			processResults(response);		// this function must exist in the calling page
		}
	}
}

function numericOnly(myfield, e, dec)
{
	var key;
	var keychar;

	if (window.event)
 		key = window.event.keyCode;
	else if (e)
 		key = e.which;
	else
 		return true;

	keychar = String.fromCharCode(key);
	// control keys
	if ((key==null) || (key==0) || (key==8) ||  (key==9) || (key==13) || (key==27) )
 		return true;
	// numbers
	else if ((("0123456789").indexOf(keychar) > -1))
 		return true;
	// decimal point jump
	else if (dec && (keychar == "."))
 	{
 		myfield.form.elements[dec].focus();
 		return false;
 	}
	else
 		return false;
}
//-
function addToCart(id,t,n,p,s,d)
{
	sendAjaxRequest('../shopping/addToCart.php?id='+id+'&t='+t+'&n='+n+'&p='+p+'&s='+s+'&d='+d,'divResponse',false);
}

function addToCart2(id,t,n,p,s,d)
{
	sendAjaxRequest('shopping/addToCart.php?id='+id+'&t='+t+'&n='+n+'&p='+p+'&s='+s+'&d='+d,'divResponse',false);
}

-->

