	function display_main_table()
	{
	  window.parent.document.getElementById('main').style.display='block';
	  window.parent.document.getElementById('cancel').style.display='none';
	  xmlhttpPost('http://item.liveleak.com/item?a=show_connections&connection=<?=$connection;?>&ajax=1','connections');
	} //end function display_main_table()
	
	function display_main_table_without_connections()
	{
	  window.parent.document.getElementById('main').style.display='block';
	  window.parent.document.getElementById('cancel').style.display='none';
	} //end function display_main_table()

	function hide_main_table()
	{
	  document.getElementById('main').style.display='none';
	  //document.getElementById('cancel').style.display='inline';
	} //end function hide_main_table()

	function cancel()
	{
	  document.getElementById('tab_content_div').innerHTML = '';
	  display_main_table();
	} //end function cancel()
	
    //file attach functions
	function upload_file(form)
    {
      document.getElementById('upload_msg').innerHTML = "<br><div class=\"msg\">Uploading file....</div>";
	  document.getElementById('upload_table').style.display='none';
	  submit_form(form,'file?a=add&upload=1&ajax=1','upload_file_div');
    } //end function upload_file(form)

    function startUpload(){
      document.getElementById('progress-bar').style.display='block';
      document.getElementById('f1_upload_form').style.display='none';
      return true;
    } //end function startUpload(){

    function stopUpload(msg){
	  document.getElementById('progress-bar').style.display='none';
      document.getElementById('upload_file_div').innerHTML = "<div class=\"msg\">"+msg+"</div>";
    }
	
	function addElement(list,innerHTML){
      // This is the <ul id="myList"> element that will contains the new elements
      var container = document.getElementById(list);
      // Create a new <li> element for to insert inside <ul id="myList">
      var new_element = document.createElement('li');
      new_element.innerHTML = innerHTML;
      container.insertBefore(new_element, container.firstChild);
    } //end function addElement(list,innerHTML){
		
		
	function insertText(textBox, insertText){
	    if(document.selection) { //IE way
		  textBox.focus();
		  document.selection.createRange().text = insertText;
		}
		else //Firefox Way
		{
          var tb = textBox;
          var first = tb.value.slice(0, tb.selectionStart);
          var second = tb.value.slice(tb.selectionStart);
          tb.value = first + insertText + second;
		}
    }
	
function rollover()
{
  if(!document.getElementById || !document.createTextNode){return;}
  var n=document.getElementById('nav');
  if(!n){return;}
  var lis=n.getElementsByTagName('li');
  for (var i=0;i<lis.length;i++)
  {
    lis[i].onmouseover=function()
    {
      this.className=this.className?'cur':'over';
    }
    lis[i].onmouseout=function()
    {
       this.className=this.className=='cur'?'cur':'';
    }
  }
}
window.onload=rollover;

function check_comment_form(form)
{
  if(form.comment_text.value=='')
  {
	alert("Make sure your comment contains a text");
	return false;
  } //end if(form.comment_text.value=='')
  return true;
} //end function check_comment_form(form)


