/* Copyright (c) 2008 WildFireWeb Inc.* wildfireweb.com* All rights reserved* This copyright notice MUST stay intact* Developed by Steve Sweet*/function blogPublished(post_id, obj) {	if (obj.checked)		published = '1';	else		published = '0';	var query = 'subblogpostpublished=1&site_id='+site_id+'&page='+page+'&post_id='+post_id+'&published='+published;	ajaxRequest('/process.php', query, nothingResponse);}function blogTaxable(post_id, obj) {	if (obj.checked)		taxable = '1';	else		taxable = '0';	var query = 'subblogposttaxable=1&site_id='+site_id+'&page='+page+'&post_id='+post_id+'&taxable='+taxable;	ajaxRequest('/process.php', query, nothingResponse);}function blogDownloadable(post_id, obj) {	var control = document.getElementById('downloadfiles');	var list = document.getElementById('downloadlist');	if (obj.checked) {		downloadable = '1';		control.style.visibility='visible';	}	else {		downloadable = '0';		control.style.visibility='hidden';		list.selectedIndex = 0;	}	var query = 'subblogpostdownloadable=1&site_id='+site_id+'&page='+page+'&post_id='+post_id+'&downloadable='+downloadable;	ajaxRequest('/process.php', query, nothingResponse);}function blogDownloadFileSelect(post_id, obj) {	var list = document.getElementById('downloadlist');	var downloadfile = list[list.selectedIndex].value;		var query = 'subblogpostdownloadfile=1&site_id='+site_id+'&page='+page+'&post_id='+post_id+'&downloadfile='+downloadfile;	ajaxRequest('/process.php', query, nothingResponse);}function blogShowHideUserForm() {	var newuser = document.getElementById('newuser');	if (document.forms.blog_user_form.user_id.value) {		newuser.style.display='none';	}	else {		newuser.style.display='block';	}}function blogCancelForm(returnurl) {	window.location.href=returnurl;}var blogUrl;function blogSubmitSettingsForm(returnurl) {	blogUrl = returnurl;	var myform = document.forms.blog_settings_form;	var blog_id = myform.blog_id.value;	var allow_comments = '0';	var notify = '0';	var notify_email = '';	var show_date =  '1';	var date_format =  '1';	var time_zone =  '1';	var show_author = '1';	var show_category = '1';	var show_keywords =  '1';	// this isn't on form for slates	if (myform.allow_comments)		allow_comments = myform.allow_comments.checked ? '1' : '0';	if (myform.notify)		notify = myform.notify.checked ? '1' : '0';	if (myform.notify_email)		notify_email = myform.notify_email.value;	var show_summary = myform.show_summary.checked ? '1' : '0';	var show_price = myform.show_price.checked ? '1' : '0';	var show_quantity = myform.show_quantity.checked ? '1' : '0';	if (myform.layout[1].checked)		layout = '1';	else if (myform.layout[2].checked)		layout = '2';	else		layout = '0';	var query = 'subsetblogsettings=1&blog_id='+blog_id+'&site_id='+site_id+'&page='+page+'&allow_comments='+allow_comments+'&notify='+notify+'&notify_email='+notify_email+'&show_author='+show_author+'&show_category='+show_category+'&show_keywords='+show_keywords+'&show_summary='+show_summary+'&show_date='+show_date+'&date_format='+date_format+'&time_zone='+time_zone+'&show_price='+show_price+'&show_quantity='+show_quantity+'&layout='+layout;	ajaxRequest('/process.php', query, blogFormResponse);}function blogFormResponse() {	if (xmlhttp.readyState==4) {		if (xmlhttp.responseText != 'OK') {			var errobj = document.getElementById('blog_errors');			if (errobj) errobj.innerHTML = xmlhttp.responseText;			else alert(xmlhttp.responseText);		}		else			window.location.href=blogUrl;	}}function nothingResponse() {}
