function recalc_pr(ap, cp)
{
	var	a	=	document.forms[0].adults.value;
	var	c	=	document.forms[0].children.value;

	var	tot	=	(a*ap)+(c*cp);

	var pr	=	document.getElementById('bval');
	
	pr.innerHTML	=	tot;
}

function recalc_h()
{
	var	f	=	document.forms[0];
	var	tot	=	0;
	for(var i=0;i<f.length;i++)
		tot=tot+1;

	var pr	=	document.getElementById('bval');
	
	pr.innerHTML	=	tot;
}

function ch_status(bid, stid)
{
	action('status');
	document.forms[0].book_id.value	=	bid;
	document.forms[0].status_id.value	=	stid;
	document.forms[0].submit();
}

function action(act)
{
	document.forms[0].action.value	=	act;
}

function sh(id)
{
	document.all[id].style.display=document.all[id].style.display=='block'?'none':'block';
}

var addthis_config =
	{ 
		services_expanded:'twitter,facebook,livejournal'
	}

function ctags(name)
{
	if (document.forms[0].tags.value.indexOf(name)>=0)
	{
		document.forms[0].tags.value = (', '+document.forms[0].tags.value).replace(', '+name, '');
		if (document.forms[0].tags.value.indexOf(', ')==0)
			document.forms[0].tags.value = document.forms[0].tags.value.substring(2);
	}
	else
	document.forms[0].tags.value=document.forms[0].tags.value+(document.forms[0].tags.value?", ":'')+name;
}

function	enablexbed(name)
{
	//alert(document.all[name]);
	if (document.all[name])
	{
		if (!document.all[name].disabled)
			document.all[name].checked = false;
		
		document.all[name].disabled = !document.all[name].disabled;
	}
}

	function sendit(pid, pqid)
	{
		document.location.href= 'poll.php?pq='+pqid+'#pll'+pid;
	}

function createRequestObject()
{
	if (window.XMLHttpRequest) {
		try {
			return new XMLHttpRequest();
		} catch (e){}
	} else if (window.ActiveXObject) {
		try {
			return new ActiveXObject('Msxml2.XMLHTTP');
		} catch (e){
		  try {
			  return new ActiveXObject('Microsoft.XMLHTTP');
		  } catch (e){}
		}
	}
	return null;
}



