			// used for the checkboxes list ,1768,134,707 etc...
			var listOfIds = '';
			function updateListOfIds(checkbox_field)	{
				if (checkbox_field.checked)	{
					// add to the list
					listOfIds += ',' + checkbox_field.id;
				}
				else	{
					// remove from the list
					listOfIds = listOfIds.replace(',' + checkbox_field.id,'');
				}
			}
			// print all selected ads
			function print_selected(strURL)	{
				printWindow = window.open(strURL + '&strListOfIDs=' + listOfIds,'printWindow','top=0,left=0,toolbar=yes,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,width=' + screen.width-20 + ',height=' + screen.height-20);
			}
			// print one - prints only one record
			function print_one(strURL,str_id,str_msg)	{
				if (confirm(str_msg)) {
					printWindow = window.open(strURL + '&strListOfIDs=' + str_id,'printWindow','top=0,left=0,toolbar=yes,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,width=' + screen.width-20 + ',height=' + screen.height-20);
				}
			}

			// select all checkboxes
			function select_all_results()	{
				var elements = document.getElementsByTagName('input');
				for (var i = 0; i < elements.length; i++) {
					if (elements.item(i).type == 'checkbox')	{
						elements.item(i).checked = true;
						listOfIds += ',' + elements.item(i).getAttribute('id');
					}
				}
			}
			// deselect all checkboxes
			function deselect_all_results()	{
				var elements = document.getElementsByTagName('input');
				for (var i = 0; i < elements.length; i++) {
					if (elements.item(i).type == 'checkbox')	{
						elements.item(i).checked = false;
						listOfIds = listOfIds.replace(',' + elements.item(i).getAttribute('id'),'');
					}
				}
			}
			// select all checkboxes, print them & deselect
			function print_all_basket()	{
				select_all_ads();
				print_ads();
				deselect_all_ads();
			}
			function remove_all_basket()	{
				select_all_ads();
				location.href='cookies.asp?action=remove&strListOfIds=' + listOfIds;
			}
			// actually select checkboxes for removal
			function remove_selected_from_suitcase()	{
				var elements = document.getElementsByTagName('input');
				for (var i = 0; i < elements.length; i++) {
					if (elements.item(i).getAttribute('checked'))	{
						// place it in the list
						listOfIds += ',' + elements.item(i).getAttribute('id');
					}
				}
				suitcaseWindow = window.open('cookies.asp?action=remove&strListOfIds=' + listOfIds,'suitcaseWindow','top=0,left=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=1,height=1');
			}
			// showAd - opens a popup with ad details
			function showAd(ad_id,print_ad,show_tell_a_friend_form,show_send_a_message_form)	{
				if (print_ad && !confirm('<%= dic_print_one_ad_confirm %>')) {
				// do nothing;
				}
				else	{
				var LeftPosition = (screen.width) ? (screen.width-750)/2 : 0;
				var TopPosition = (screen.height) ? (screen.height-350)/2 : 0-20;
				adWindow = window.open('ad_focus.asp?ad_id=' + ad_id + '&print_ad=' + print_ad + '&show_tell_a_friend_form=' + show_tell_a_friend_form + '&show_send_a_message_form=' + show_send_a_message_form,'adWindow','top='+TopPosition+',left='+LeftPosition+',toolbar=yes,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,width=760,height=350');
				}
			}
			// open popup - opens a popup window with nothing but scrollbars (used in forms, ad focus etc...)
			function open_pop(strURL,popWindowId,intWidth,intHeight)	{
				var LeftPosition = (screen.width) ? (screen.width-intWidth)/2 : 0;
				var TopPosition = (screen.height) ? (screen.height-intHeight)/2 : 0-20;
				popWindow = window.open(strURL,popWindowId,'top=' + TopPosition + ',left=' + LeftPosition + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=' + intWidth + ',height=' + intHeight + '');
			}

			// add_to_suitcase - ads a list of id's to the suitcase
			function add_to_suitcase(strList)	{
				suitcaseWindow = window.open('cookies.asp?action=add&strListOfIDs=' + strList,'suitcaseWindow','top=0,left=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=1,height=1');
//				suitcaseWindow = window.showModalDialog('cookies.asp?action=add&strListOfIDs=' + strList,,'top=0,left=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=1,height=1');
			// add_to_suitcase - ads a list of id's to the suitcase
			}
			function add_selected_to_suitcase()	{
				suitcaseWindow = window.open('cookies.asp?action=add&strListOfIDs=' + listOfIds,'suitcaseWindow','top=0,left=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=1,height=1');			
			}
			// remove from suitcase
			function remove_from_suitcase(strList)	{
				suitcaseWindow = window.open('cookies.asp?action=remove&strListOfIDs=' + strList,'suitcaseWindow','top=0,left=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=1,height=1');
			}
			// sets the display to any given object
			function setDisplay(object,val) { 
				document.getElementById(object).style.display = val; 
			}
			// sets the display to any given object
			function setAutoDisplay(object_id) { 
				var obj = document.getElementById(object_id);
				if (obj.style.display == 'none')	{
					obj.style.display = 'inline';
				}
				else	{
					obj.style.display = 'none';
				}
			}
		// confirm clicking on a mapping link that requires confirmation
		function confirmLink(linkText)	{
			if (!confirm(linkText))	{
				event.cancelBubble = true;
				return false;
			}
			return true;
		}
