function dumpProps(obj, parent) {
   for (var i in obj) {
      if (parent) { var msg = parent + "." + i + "\n" + obj[i]; } else { var msg = i + "\n" + obj[i]; }
      if (!confirm(msg)) { return; }
      if (typeof obj[i] == "object") {
         if (parent) { dumpProps(obj[i], parent + "." + i); } else { dumpProps(obj[i], i); }
      }
   }
}

function ajaxadd(productid)
	{
		//invoke the request
		return true;
		var frmref=document.getElementById(("frm_"+productid));
		frmref.action='/modules/addprod.asp';
		var postvars="";
		var tmpname=false;
		for (var i=0;i<frmref.length;i++)
		{
			postvars=postvars+(frmref.elements[i].name);
			postvars=postvars+("=")
//			alert((frmref.elements[i].name.substring(0,3)));
			if ((frmref.elements[i].name.substring(0,3)=="asc") && (frmref.elements[i].name.length<6))
				{
//					alert(frmref.elements[i].checked);
					tmpname=frmref.elements[i].checked;
					if(tmpname) {postvars=postvars+("on");} else {postvars=postvars+("");}
				}
			else
				{postvars=postvars+(frmref.elements[i].value);}
				
			if((i+1)<frmref.length){ postvars=postvars+("&")}
		}
//		alert(postvars);
		if( ajax_RequestString( ajaxadd_callBack , "/modules/ajax_addprod.asp" , postvars , productid ) )
		{
			//get hold of the text box and put a friendly message in it while we are waiting
			var addbutton = document.getElementById("order_"+productid);
			addbutton.src = "/images/highside/loading.gif";
		}
		return false;
	}

	//callback 
function ajaxadd_callBack( sString , statusCode , requestObject )
	{
		var productid=(requestObject.m_userObject);

		//status OK : print the time 
		if( statusCode == ajax_statusCode_ok )
		{
			var addbutton = document.getElementById("order_"+(productid));
			addbutton.src = "/images/structure/icons/add-button2.gif";
//				alert(sString);
			var basketbox = document.getElementById("basketboxcontent");
			basketbox.innerHTML=sString;
			if( ajax_RequestString( ajaxbasket_callBack , "/modules/ajax_basketsummary.asp" , ("productid="+productid) , productid ) )
			{
				//get hold of the text box and put a friendly message in it while we are waiting
				addbutton.src = "/images/highside/loading.gif";
			}
		}
		//error : print an error message, test this by changing the request URL above to garbage
		else
		{
			var addbutton = document.getElementById("order_"+(productid));
			addbutton.src = "/images/highside/loader.gif";
		}
	}
	
function ajaxbasket_callBack( sJSONString  , statusCode , requestObject )
	{
		var productid=(requestObject.m_userObject);
		//status OK : print the time 
		if( statusCode == ajax_statusCode_ok )
		{
			var addbutton = document.getElementById("order_"+(productid));
			
			addbutton.src = "/images/structure/icons/add-button2.gif";
			var basketsummary=eval("("+sJSONString +")");
			var basketitems=document.getElementById("basketitems");
			var baskettotal=document.getElementById("baskettotal");
			var prodname=(basketsummary.prodname);
			var prodcode=(basketsummary.prodcode);
			if (basketsummary.items=="1")
				{basketitems.innerHTML=("<span class='cyan'>Item: 1</span>");}
			else
				{basketitems.innerHTML=("<span class='cyan'>Items: "+(basketsummary.items)+"</span>");}
			baskettotal.innerHTML=("<span class='hotpink'>Total: £"+(basketsummary.price)+"</span>");
			
//			hs.src=("/modules/ajax_product.asp?productid="+productid);
//			hs.htmlExpand(addbutton, { wrapperClassName: 'highslide-white', outlineWhileAnimating: true, objectType: 'ajax' } );
			var notificationtext="";
			notificationtext="<div class='bigbag'>"+prodname+" ("+prodcode+") has been added to your bag.</div>\n<br />\n"
			notificationtext+="<div style='float:left;'><a href='#' onclick='return killNotificationWindow();'>Close</a></div>\n"
			notificationtext+="<div style='float:right;'><a href='/modules/addprod.asp'>View Shopping Bag</a></div>\n"
			var tmpnul=notificationWindow(notificationtext,6000,"showDropMenu(\"BasketSummary\",\"block\");")
		}
		else 
		{
			var addbutton = document.getElementById("order_"+(productid));
			addbutton.src = "/images/highside/loading.gif";
		}
	}

function notify(productid,prodcode,rangeid,pageno)
	{
		//invoke the request
		var postvars="";
		postvars=postvars+("productid="+productid)
		postvars=postvars+("&")
		postvars=postvars+("prodcode="+prodcode)
		postvars=postvars+("&")
		postvars=postvars+("rangeid="+rangeid)
		postvars=postvars+("&")
		postvars=postvars+("pageno="+pageno)
		
//			alert("/modules/ajax_notifyform.asp?"+postvars);
		if( ajax_RequestString( notify_callBack , "/modules/ajax_notifyform.asp" , postvars , productid ) )
		{
			//get hold of the text box and put a friendly message in it while we are waiting
			var addbutton = document.getElementById("order_"+productid);
			addbutton.src = "/images/highside/loading.gif";
		}
		return false;
	}
	
function notify_callBack( sString , statusCode , requestObject )
	{
		var productid=(requestObject.m_userObject);
//alert("productid="+productid);
		//status OK : print the time 
		if( statusCode == ajax_statusCode_ok )
		{
			var addbutton = document.getElementById("order_"+(productid));
			addbutton.src = "/images/structure/icons/notify.gif";
//				alert(sString);
			var notificationtext="";
			notificationtext="<div>"+sString+"</div>"
			var tmpnul=notificationWindow(notificationtext,0,"")

		}
		//error : print an error message, test this by changing the request URL above to garbage
		else
		{
			var addbutton = document.getElementById("order_"+(productid));
			addbutton.src = "/images/highside/loader.gif";
		}
	}


function notifysend(productid)
	{
		//invoke the request
		var frmref=document.getElementById(("notify_"+productid));
		var postvars="";
		for (var i=0;i<frmref.length;i++)
		{
			postvars=postvars+(frmref.elements[i].name);
			postvars=postvars+("=")
			postvars=postvars+(frmref.elements[i].value);
			if((i+1)<frmref.length){ postvars=postvars+("&")}
		}
		killNotificationWindow();
		
//			alert("/modules/ajax_notifyform.asp?"+postvars);
		if( ajax_RequestString( notifysent_callBack , "/modules/ajax_notify.asp" , postvars , productid ) )
		{
			//get hold of the text box and put a friendly message in it while we are waiting
			var addbutton = document.getElementById("order_"+productid);
			addbutton.src = "/images/highside/loading.gif";
		}
		return false;
	}
	
function notifysent_callBack( sString , statusCode , requestObject )
	{
		var productid=(requestObject.m_userObject);
//alert("productid="+productid);
		//status OK : print the time 
		if( statusCode == ajax_statusCode_ok )
		{
			var addbutton = document.getElementById("order_"+(productid));
			addbutton.src = "/images/structure/icons/notify.gif";
//				alert(sString);
			var notificationtext="";
			notificationtext="<div>Thank you, we will notify you when this product is available.</div>\n<br />\n"
			notificationtext+="<div style='float:right;'><a href='#' onclick='return killNotificationWindow();'>Close</a></div>\n"
			var tmpnul=notificationWindow(notificationtext,6000,"")

		}
		//error : print an error message, test this by changing the request URL above to garbage
		else
		{
			var addbutton = document.getElementById("order_"+(productid));
			addbutton.src = "/images/highside/loader.gif";
		}
	}


function ajaxwishlist(productid)
	{
		//invoke the request
		var frmref=document.getElementById(("frm_"+productid));
		var postvars="";
		var tmpname=false;
		for (var i=0;i<frmref.length;i++)
		{
			postvars=postvars+(frmref.elements[i].name);
			postvars=postvars+("=")
//			alert((frmref.elements[i].name.substring(0,3)));
			if ((frmref.elements[i].name.substring(0,3)=="asc") && (frmref.elements[i].name.length<6))
				{
//					alert(frmref.elements[i].checked);
					tmpname=frmref.elements[i].checked;
					if(tmpname) {postvars=postvars+("on");} else {postvars=postvars+("");}
				}
			else
				{postvars=postvars+(frmref.elements[i].value);}
				
			if((i+1)<frmref.length){ postvars=postvars+("&")}
		}
//		alert(postvars);
		if( ajax_RequestString( ajaxwishlist_callBack , "/modules/ajax_addwishlist.asp" , postvars , productid ) )
		{
			//get hold of the text box and put a friendly message in it while we are waiting
			var wishlistbutton = document.getElementById("wishlist_"+productid);
			wishlistbutton.src = "/images/highside/loading.gif";
		}
		return false;
	}

	//callback 
function ajaxwishlist_callBack( sJSONString , statusCode , requestObject )
	{
		var productid=(requestObject.m_userObject);

		//status OK : print the time 
		if( statusCode == ajax_statusCode_ok )
		{
			var wishlistbutton = document.getElementById("wishlist_"+(productid));
			wishlistbutton.src = "/images/structure/icons/wishlist.gif";

			var basketsummary=eval("("+sJSONString +")");
			var prodname=(basketsummary.prodname);
			var prodcode=(basketsummary.prodcode);

//			hs.src=("/modules/ajax_product.asp?productid="+productid);
//			hs.htmlExpand(addbutton, { wrapperClassName: 'highslide-white', outlineWhileAnimating: true, objectType: 'ajax' } );
			var notificationtext="";
			notificationtext="<div class='bigstar'>"+prodname+" ("+prodcode+") has been added to your wishlist.</div>\n<br />\n"
			notificationtext+="<div style='float:left;'><a href='#' onclick='return killNotificationWindow();'>Close</a></div>\n"
			notificationtext+="<div style='float:right;'><a href='/modules/wishlist.asp'>View Wishlist</a></div>\n"
			var tmpnul=notificationWindow(notificationtext,6000,"")

		}
		//error : print an error message, test this by changing the request URL above to garbage
		else
		{
			var wishlistbutton = document.getElementById("wishlist_"+(productid));
			wishlistbutton.src = "/images/highside/loader.gif";
		}
	}
	
	
function ajaxwishlistsignup(productid)
	{
		//invoke the request
		var frmref=document.getElementById(("frm_"+productid));
		var postvars="";
		for (var i=0;i<frmref.length;i++)
		{
			postvars=postvars+(frmref.elements[i].name);
			postvars=postvars+("=")
//			alert((frmref.elements[i].name.substring(0,3)));
			if ((frmref.elements[i].name.substring(0,3)=="asc") && (frmref.elements[i].name.length<6))
				{
//					alert(frmref.elements[i].checked);
					tmpname=frmref.elements[i].checked;
					if(tmpname) {postvars=postvars+("on");} else {postvars=postvars+("");}
				}
			else
				{postvars=postvars+(frmref.elements[i].value);}
				
			if((i+1)<frmref.length){ postvars=postvars+("&")}
		}
		
//			alert("/modules/ajax_notifyform.asp?"+postvars);
		if( ajax_RequestString( ajaxwishlistsignup_callBack , "/modules/ajax_wishlistform.asp" , postvars , productid ) )
		{
			//get hold of the text box and put a friendly message in it while we are waiting
			var wishlistbutton = document.getElementById("wishlist_"+productid);
			wishlistbutton.src = "/images/highside/loading.gif";
		}
		return false;
	}
	
function ajaxwishlistsignup_callBack( sString , statusCode , requestObject )
	{
		var productid=(requestObject.m_userObject);
//alert("productid="+productid);
		//status OK : print the time 
		if( statusCode == ajax_statusCode_ok )
		{
			var wishlistbutton = document.getElementById("wishlist_"+(productid));
			wishlistbutton.src = "/images/structure/icons/wishlist.gif";
//				alert(sString);
			var notificationtext="";
			notificationtext="<div>"+sString+"</div>"
			var tmpnul=notificationWindow(notificationtext,0,"")

		}
		//error : print an error message, test this by changing the request URL above to garbage
		else
		{
			var wishlistbutton = document.getElementById("wishlist_"+(productid));
			wishlistbutton.src = "/images/highside/loader.gif";
		}
	}
