function clearInputText(thisfield, defaulttext) 
{
	if (thisfield.value == defaulttext) 
	{
		thisfield.value = "";
	}
}

function recallInputText(thisfield, defaulttext) 
{
	if (thisfield.value == "") 
	{
		thisfield.value = defaulttext;
	}
}

function clearInputImage(thisfield, src) 
{
	thisfield.style.backgroundImage= 'url('+ src +')'
}

function recallInputImage(thisfield, src) 
{
	if (thisfield.value == "") 
	{
		thisfield.style.backgroundImage= 'url('+ src +')'
	}
}

function submitPoll(poll_index)
{
	$.ajax({
		type: "POST",
		url: "/ajax4api.php",
		data: $("#poll_form_" + poll_index).serialize() + '&action=submitPoll&poll_index=' + poll_index,
		success: function(msg)
		{
			$("#poll_answers_" + poll_index).slideUp("slow");
		 	$("#poll_results_" + poll_index).html(msg).slideDown("slow");
		}
	});


}

function getPollResults(poll_index)
{
	$("#poll_answers_" + poll_index).slideUp("slow");
	$("#poll_results_" + poll_index).slideDown("slow");
}

function returnToPoll(poll_index)
{
	$("#poll_results_" + poll_index).slideUp("slow");
	$("#poll_answers_" + poll_index).slideDown("slow");
}

function getPollArchive(poll_zone)
{
	
}

function bookmarkUs(url, title)
{
	if (window.sidebar) // firefox
	    window.sidebar.addPanel(title, url, "");
	else if(window.opera && window.print){ // opera
	    var elem = document.createElement('a');
	    elem.setAttribute('href',url);
	    elem.setAttribute('title',title);
	    elem.setAttribute('rel','sidebar');
	    elem.click();
	}
	else if(document.all)// ie
	    window.external.AddFavorite(url, title);
}