function triger_div(name){
if (document.getElementById(name)) {
	obj=document.getElementById(name);
	if (obj.style.display!='block')  obj.style.display='block'; else obj.style.display='none';
	}
}


/* This script and many more are available free online at

The JavaScript Source!! http://javascript.internet.com

Created by: Mr J | http://www.huntingground.net/ */
scrollStep=5
timerLeft=""
timerAutoUp=""
timerRight=""
timerUp=""
timerDown=""
timerTop=""
timerBottom=""

function toLeft(id){
  document.getElementById(id).scrollLeft=0
}

function scrollDivLeft(id){
  clearTimeout(timerRight) 
  document.getElementById(id).scrollLeft+=scrollStep
  timerRight=setTimeout("scrollDivLeft('"+id+"')",10)
}

function scrollDivUp(id){
  clearTimeout(timerDown) 
  document.getElementById(id).scrollTop-=scrollStep
  timerDown=setTimeout("scrollDivUp('"+id+"')",10)
}

function scrollDivDown(id){
  clearTimeout(timerUp) 
  document.getElementById(id).scrollTop+=scrollStep
  timerUp=setTimeout("scrollDivDown('"+id+"')",10)
}


function scrollDivRight(id){
  clearTimeout(timerLeft)
  document.getElementById(id).scrollLeft-=scrollStep
  timerLeft=setTimeout("scrollDivRight('"+id+"')",10)
}

function toRight(id){
  document.getElementById(id).scrollLeft=document.getElementById(id).scrollWidth
}

function stopMe(){
  clearTimeout(timerRight) 
  clearTimeout(timerLeft)
  clearTimeout(timerUp) 
  clearTimeout(timerDown)
  clearTimeout(timerAutoUp)   
}
/////////////////////////////////////////////////////// VERTICAL
function toBottom(id){
  document.getElementById(id).scrollBottom=0
}

function toTop(id){
  document.getElementById(id).scrollBottom=document.getElementById(id).scrollHeight
}

var maxi=0;

function autoscrollDivDown(id){
  clearTimeout(timerAutoUp) 
  document.getElementById(id).scrollTop+=1
  if (document.getElementById(id).scrollTop>347) { document.getElementById(id).scrollTop=0; }
  timerAutoUp=setTimeout("autoscrollDivDown('"+id+"')",50)
}

function hide_div(name){
if (document.getElementById(name)) {
	obj=document.getElementById(name);
	obj.style.display='none';
	}
}

function show_div(name){
if (document.getElementById(name)) {
	obj=document.getElementById(name);
	obj.style.display='block';
	}
}

function pic_reload(obj_id){
if (obj_id=='') return;
var obj=document.getElementById(obj_id);
if (obj) {
var old_val=obj.src;
var dat= new Date;
obj.src='/images/w3c.jpg';
obj.src=old_val+'?id='+dat.getTime();
}
}


function make_element(key,val){
if (obj=document.forms[forma].elements[key])
{
var obj=document.forms[forma].elements[key];
var typer=obj.type;
if (typer==undefined) {typer=obj[0].type;}
if (typer=='radio') 	{ if (val!='') obj[val].checked=true; obj[val].click();  }
if (typer=='text' || typer=='textarea'){ obj.value=val;  }
if (typer=='checkbox'){ if (val='On') obj.click(); }
if (typer=='select-one') {
	 obj.selectedIndex=val;  
	 for (i in obj.options) if (parseInt(i)>=0)  if (obj[i].value==val) obj.selectedIndex=i;
	 }
}
}


