//general functions
// <input type=button name="CheckAll"   value="Check All" onClick="checkAll(document.myform.list)">
// <input type=button name="UnCheckAll" value="Uncheck All" onClick="uncheckAll(document.myform.list)">
function ajaxUrl(url,propertyId)
{
	var xmlHttp = null;
	try
	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		// Internet Explorer
		try
		{
			xmlHttp=new ActiveXObject('Msxml2.XMLHTTP');
		}
		catch (e)
		{
			try
			{
				xmlHttp=new ActiveXObject('Microsoft.XMLHTTP');
			}
			catch (e)
			{
				alert('Your browser does not support AJAX!');
				return false;
			}
		}
	}
	xmlHttp.open('GET',url,true);//async transfer
	xmlHttp.send(null);

	document.getElementById('buttons_'+propertyId).style.display='none';
	//document.getElementById('buttons_message_'+propertyId).innerHTML='This property has already been posted today.';
	document.getElementById('buttons_message_'+propertyId).style.display='block';
}
function checkAll(field)
{
	var Inputs = field.getElementsByTagName("input");
	for(var iCount = 0; iCount < Inputs.length; ++iCount)
	{
		if(Inputs[iCount].type == 'checkbox')
		{
			Inputs[iCount].checked = true;
		}
	}
}
	
function uncheckAll(field)
{
	var Inputs = field.getElementsByTagName("input");
	for(var iCount = 0; iCount < Inputs.length; ++iCount)
	{
		if(Inputs[iCount].type == 'checkbox')
		{
			Inputs[iCount].checked = false;
		}
	}
}
	
function pop(url,width,height) {
	window.open(url,'_pop1','toolbar=no,menubar=no,location=no,height='+height+',width='+width+',scrollbars=yes').focus();
	return false;
}
function _blank(href) {
	window.open(href);
	return false;
}
function submit(form) {
	form = document.getElementById(form);
	form.submit();
}
function toggleMoreLess(elementID,parent) {
	var div = document.getElementById(elementID);
	div.style.display = ('none'==div.style.display) ? 'block' : 'none';
	parent.innerHTML = ('More �'==parent.innerHTML) ? 'Less �' : 'More �';
	return false;
}
function toggleDiv(elementID) {
	var div = document.getElementById(elementID);
	div.style.display = ('none'==div.style.display) ? 'block' : 'none';
	return false;
}
//item management functions
function removeItemFromList(cookieKey,id,name) {
	var path="/sys/bounceback.php5?removeItemFromList=true&cookieKey="+cookieKey+"&id="+id+"&name="+name;
	//alert(path);
	window.location=path;
	return false;
}
function copyToClipboard(s)
{
	if( window.clipboardData && clipboardData.setData )
	{
		clipboardData.setData("Text", s);
	}
	else
	{
		// You have to sign the code to enable this or allow the action in about:config by changing
		user_pref("signed.applets.codebase_principal_support", true);
		netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
	
		var clip = Components.classes['@mozilla.org/widget/clipboard;[[[[1]]]]'].createInstance(Components.interfaces.nsIClipboard);
		if (!clip) return;
	
		// create a transferable
		var trans = Components.classes['@mozilla.org/widget/transferable;[[[[1]]]]'].createInstance(Components.interfaces.nsITransferable);
		if (!trans) return;
	
		// specify the data we wish to handle. Plaintext in this case.
		trans.addDataFlavor('text/unicode');
	
		// To get the data from the transferable we need two new objects
		var str = new Object();
		var len = new Object();
	
		var str = Components.classes["@mozilla.org/supports-string;[[[[1]]]]"].createInstance(Components.interfaces.nsISupportsString);
	
		var copytext=meintext;
	
		str.data=copytext;
	
		trans.setTransferData("text/unicode",str,copytext.length*[[[[2]]]]);
	
		var clipid=Components.interfaces.nsIClipboard;
	
		if (!clip) return false;
	
		clip.setData(trans,null,clipid.kGlobalClipboard);
	}
}	
	
	