// ***** Validate Question Form *****

function validate(warn, field, type)
{

    if(((type=="field")&&(document.forms.question[field].value.length == 0))||
    	((type=="check")&&(document.forms.question[field].checked == false)))
	{
		
	    alert(warn);
		return false;
	}
	
	else return true;
}

// ***** Show/Hide Question Form *****

function at_click()
{
  var p = document.getElementById(this["at_parent"]);
  var c = document.getElementById(this["at_child" ]);

  if (c.style.display != "block")
  		c.style.display = "block";
  else c.style.display = "none";

  if (c.style.visibility != "visible")
  		c.style.visibility = "visible";
  else c.style.visibility = "hidden";
  
  return false;
}

function attach(parent, child, cursor)
{
  var p = document.getElementById(parent);
  var c = document.getElementById(child);

  p["at_parent"]     = p.id;
  c["at_parent"]     = p.id;
  p["at_child"]      = c.id;
  c["at_child"]      = c.id;


 
  c.style.visibility = "hidden";
  c.style.display = "none";

  if (cursor != undefined) p.style.cursor = cursor;


      p.onclick     = at_click;
  
}




function at_click_del()
{
	
var allPageTags = new Array(); 

var allPageTags=document.getElementsByTagName("*");

for (i=0; i<allPageTags.length; i++) 
{
	if (allPageTags[i].className=="usuniety") {
  		if (allPageTags[i].style.visibility != "visible")
  		{
  			allPageTags[i].style.visibility = "visible";
  			allPageTags[i].style.display = "block";
  		}
  		else 
  		{ 
  			allPageTags[i].style.visibility = "hidden";	
  			allPageTags[i].style.display = "none";
  		}
}
} 	

  return false;
}


function hide_deleted(parent, child, cursor)
{
  var p = document.getElementById(parent);
  var c = document.getElementById(child);

  p["at_parent"]     = p.id;
//  c["at_parent"]     = p.id;
  p["at_child"]      = c.id;
//  c["at_child"]      = c.id;

 
 // c.style.visibility = "hidden";
 // c.style.display = "none";

  if (cursor != undefined) p.style.cursor = cursor;

      p.onclick     = at_click_del;
  
}






// ***** Set The Scroll Bar To The Bottom *****


function setScrollBottom()
{
var scrolledDiv = document.getElementById('');
scrolledDiv.scrollTop = scrolledDiv.scrollHeight;
}
