if(document.getElementById&&!document.all){ns6=1;}else{ns6=0;}
var agtbrw=navigator.userAgent.toLowerCase();
var operaaa=(agtbrw.indexOf('opera')!=-1);
var head="display:''";
var folder='';
var st='';
var ht='';

function expandit(curobj, hide) {
  if(document.getElementById(curobj)) {
    folder=document.getElementById(curobj).style;}
  else {
    if(ns6==1||operaaa==true) {
	  folder=curobj.nextSibling.nextSibling.style;}
	else {
	  folder=document.all[curobj.sourceIndex+1].style;}
   }
  if(folder.display=="none"){
    folder.display="";}
  else {
    folder.display="none";}
/*  if(hide) {
    var hide_objects = hide.split(",");
	for(i=0; i<hide_objects.length; i++) {
	  hide_objects[i]=hide_objects[i].replace(/^\s*(.*)/, "$1");
	  hide_objects[i]=hide_objects[i].replace(/(.*?)\s*$/, "$1");
	  if(document.getElementById(hide_objects[i])) {
	    hidden=document.getElementById(hide_objects[i]).style;
		if(hidden.display=="") {
		  hidden.display="none";}
      }
    }
  }*/
}

function SwitchSelect(show, hide) {
//Show "Show" field
  if(document.getElementById(show)) { st=document.getElementById(show).style;}
  else {
    if(ns6==1||operaaa==true) { st=show.nextSibling.nextSibling.style;}
	else { st=document.all[show.sourceIndex+1].style;}
   }
  if(st.display=="none"){ st.display="";}
//Hide "hide" field
   if(document.getElementById(hide)) { ht=document.getElementById(hide).style;}
  else {
    if(ns6==1||operaaa==true) { ht=hide.nextSibling.nextSibling.style;}
	else { ht=document.all[hide.sourceIndex+1].style;}
   }
  if(ht.display!="none"){ ht.display="none";} 
}

function setTextOfTextfield(mit){
  document.sendform.gbmess.value += ' '+mit+' ';
} 

function inserttext(str,tagid,display){
  document.getElementById(tagid).value = str;
  if(display){
   document.getElementById(display).style.display='none';
  }
}

function confirmation(cm,curi,furi) {
  var answer = confirm(cm);
  if (answer){window.location = curi;}
  else{
  if(!furi=="undefined") window.location = furi;
  else {return false;}
  }
}

function open_window(Name,url,wdth,hght) {
 if('full' == wdth){opwndw = window.open(url); }
 else {
  if (wdth) { mywidth=wdth; } 
  else { mywidth=600; }
  if (hght) { myheight=hght; }
  else { myheight=400; }
  opwndw = window.open(url,Name, 'top=100,left=100,resizable=yes,width='+mywidth+',height='+myheight+',scrollbars=yes,menubar=yes');
  }
  opwndw.focus();
}

function NewsPrint(NID){
  window.open('newsprint.php?newsID='+NID,'PPG','toolbar=no, menubar=no, directories=no, status=no, location=no, scrollbars=no, resizable=no, height=1, width=1');
//top.frames["PrintFrame"].location = "newsprint.php?newsID="+NID;
}

function ShowHelp(t,tg){
	var x = document.getElementById(tg);
	x.innerHTML=t;
}

function ShowContactMailRes(Cr) {
  var xr = document.getElementById("MailRes");
  xr.innerHTML = Cr;
}

 function ReDir(page){
 window.location = page;
 }

function LoadPage(Page) {
  top.frames["StatFrame"].location = Page;
}

function SubmitForm(f){
var sf = document.getElementById(f);
sf.submit();
}
