var request = false;
    try {
      request = new XMLHttpRequest();
    } catch (trymicrosoft) {
      try {
        request = new ActiveXObject("Msxml2.XMLHTTP");
      } catch (othermicrosoft) {
        try {
          request = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (failed) {
          request = false;
        }  
      }
    }

    if (!request)
      alert("Error initializing XMLHttpRequest!");

function viewTopic(index, selectedaction){
  document.hidden_form.topic_id_hid.value = index;
  document.hidden_form.action = selectedaction;
  document.hidden_form.submit();
}

function getLanguage( selectedlang )
{
  document.hidden_form.langtype.value = selectedlang;
  document.hidden_form.action = "blog.php";
  document.hidden_form.submit();
}

function getPage( page ){
  document.hidden_form.page_hid.value = page;
  document.hidden_form.action = 'blog.php';
  document.hidden_form.submit();
}

function editTopic( index ){
  document.hidden_form.action = 'topic.php';
  document.hidden_form.actionfield.value = 'edit';
  document.hidden_form.topic_id_hid.value = index;
  document.hidden_form.submit();
}

function deleteTopic( index ){
  var cid = document.getElementById("cid").value;
  document.hidden_form.action = "blog.php?cid="+cid;
  document.hidden_form.actionfield.value = 'delete';
  document.hidden_form.topic_id_hid.value = index;
  document.hidden_form.submit(); 
}

function showCategory( page, index ){
    var cid = document.getElementById("cid").value;
	document.hidden_form.action = "blog.php?cid="+cid;
	document.hidden_form.category_id.value = index;
	document.hidden_form.page_hid.value = page;
	document.hidden_form.submit();
}

function subCategory( page, index ){
	document.hidden_form.action = "blog.php?mflag=1&cid="+index;
	document.hidden_form.page_hid.value = page;
	document.hidden_form.submit(); 
}

function viewCompany( selected, username ){
	document.hidden_form.company_id.value = selected;
	document.hidden_form.action = "companies/"+username;
	document.hidden_form.submit(); 
}

function viewProperty(property_id, selectedaction){
	document.getElementById("property_id").value = property_id;
	document.hidden_form.action = selectedaction;
	document.hidden_form.submit();
}

function search_submit( type, act )
{
	document.hidden_form.actiontype.value = type;
	document.hidden_form.action = act;
	document.hidden_form.submit();
}

function blogWrite(){
	document.hidden_form.action = "topic.php";
	document.hidden_form.submit();
}
