function getXhttp(){var ajax_request;if(window.ActiveXObject){var mSoftVersions=['MSXML2.DOMDocument.5.0','MSXML2.DOMDocument.4.0','MSXML2.DOMDocument.3.0','MSXML2.DOMDocument.2.0','MSXML2.DOMDocument','Microsoft.XmlDom','Msxml2.XMLHTTP','Microsoft.XMLHTTP'];for(i=0;i<mSoftVersions.length;i++){try{ajax_request=new ActiveXObject(mSoftVersions[i]);}catch(e){}}}else if(!ajax_request&&typeof XMLHttpRequest!='undefined'){try{ajax_request=new XMLHttpRequest;}catch(e){}}else if(!ajax_request&&window.createRequest){try{ajax_request=window.createRequest;}catch(e){}}else{ajax_request=false;}
return ajax_request;}
function clear_grocery_list(user_name){var xml=getXhttp();if(!xml){return false;}
xml.open('POST','/js/clear_grocery_list.php');xml.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xml.send('list_user_name='+user_name);window.location="/groceries";}
function calendar_completed(calendar_id){var xml=getXhttp();if(!xml){return false;}
xml.open('POST','/js/calendar_completed.php');xml.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xml.send('calendar_id='+calendar_id);if(document.getElementById('checkbox_calendar_'+calendar_id).checked==true){document.getElementById('calendar_'+calendar_id+'_h2').style.color='green';}
else{document.getElementById('calendar_'+calendar_id+'_h2').style.color='red';}}
function transaction_status(id){var xml=getXhttp();if(!xml){return false;}
xml.open('POST','/js/transaction_status.php');xml.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xml.send('transaction_id='+id+'&transaction_submit='+id);var checkbox='document.transactions.'+checkbox+'.checked';if(document.getElementById('checkbox_transaction_'+id).checked==true){document.getElementById('transaction_'+id).style.background='none';}
else{document.getElementById('transaction_'+id).style.background='darkgrey';}}
function ad_new(id){var xml=getXhttp();if(!xml){return false;}
xml.open('POST','/js/ad_new.php');xml.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xml.send('ad_id='+id+'&ad_submit='+id);var checkbox='document.ad.'+checkbox+'.checked';}
function feed_checkboxes(id,type){var xml=getXhttp();if(!xml){return false;}
xml.open('POST','/js/feed_checkboxes.php');xml.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xml.send('id='+id+'&type='+type+'&submit='+id);var checkbox='document.feed_form.'+checkbox+'.checked';}
function bill_status(id){var xml=getXhttp();if(!xml){return false;}
xml.open('POST','/js/bill_status.php');xml.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xml.send('id='+id+'&submit='+id);var checkbox='document.bill_form.'+checkbox+'.checked';}
function music_status(id){var xml=getXhttp();if(!xml){return false;}
xml.open('POST','/js/music_status.php');xml.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xml.send('music_id='+id);var checkbox='document.music.'+checkbox+'.checked';if(document.getElementById('checkbox_music_'+id).checked==true){document.getElementById('music_'+id).style.background='none';}
else{document.getElementById('music_'+id).style.background='darkgrey';}}

function delete_song(id){
 var xml=getXhttp();if(!xml){return false;}
 xml.open('POST','/js/delete_song.php');
 xml.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
 xml.send('delete='+id);
 var row = document.getElementById('music_'+id);
 if (row.style.display == '') row.style.display = 'none';
}

function trak_priority(id){
 var xml=getXhttp();if(!xml){return false;}
 var element_id = 'trak_priority_'+id;
 var e = document.getElementById(element_id);
 var priority = e.options[e.selectedIndex].value;
 xml.open('GET','/js/trak_priority.php?id='+id+'&priority='+priority);
 xml.send(null);
}
function trak_status(id){
 var xml=getXhttp();if(!xml){return false;}
 var element_id = 'trak_status_'+id; 
 var e = document.getElementById(element_id);
 var status = e.options[e.selectedIndex].value;
 xml.open('GET','/js/trak_status.php?id='+id+'&status='+status);
 xml.send(null);
}

function note_priority(id){
 var xml=getXhttp();if(!xml){return false;}
 var element_id = 'note_priority_'+id;
 var e = document.getElementById(element_id);
 var priority = e.options[e.selectedIndex].value;
 xml.open('GET','/js/note_priority.php?id='+id+'&priority='+priority);
 xml.send(null);
}

