function swapImage() 
{ 
	var i,theObj,j=0,swapArray=new Array,oldArray=document.swapImgData;
	for (i=0; i < (swapImage.arguments.length-2); i+=3) 
	{
		theObj = eval(swapImage.arguments[(navigator.appName == 'Netscape')?i:i+1])
		if (theObj != null) 
		{
			swapArray[j++] = theObj;
			swapArray[j++] = (oldArray==null || oldArray[j-1]!=theObj)?theObj.src:oldArray[j];
			theObj.src = swapImage.arguments[i+2];
		} 
	}
	document.swapImgData = swapArray; //used for restore
	//alert(swapArray);
}

//preload
arImageSrc = new Array (

)

arImageList = new Array ();
for (counter in arImageSrc) {
	arImageList[counter] = new Image();
	arImageList[counter].src = arImageSrc[counter];
}

function popup(url, w, h, scroll) 
{
	detailWindow=window.open(url,'detailWin','width=' + w + ',height=' + h + 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1');
	detailWindow.focus();
}	



function confirmSubmit()
{
	var agree=confirm("Are you sure you want to delete this?");
	if (agree)
	{
		return true;
	}
	else
		return false;
}

function ajaxthis(url, postdata, changearray)
{
	//get with ajax the info for that sec
	var xmlHttpReq = false;
    var self = this;
    // Mozilla/Safari
    if (window.XMLHttpRequest) 
    {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) 
    {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', url, true);
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
             var myArray = self.xmlHttpReq.responseText.split('``');
             
             for (var j=0; j<myArray.length; j++)
             {
             	document.getElementById(changearray[j]).innerHTML = myArray[j];
             }
             
           if (document.recalc) document.recalc();//for ie only from ie7
        }
    }
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.send(postdata);	
}

function storeAddress() 
{
  // Prepare query string and send AJAX request
 var pars = 'address=' + escape(document.getElementById('address').value);
 // Update user interface
 document.getElementById('response').innerHTML = 'Adding email address...';
 var myAjax = ajaxthis('mailinglist.php', pars, ['response']);
}
