﻿startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}
window.onload=startList;

function showgallery(w,h,id,pid,table,lang){

	h = h ? h : 450;
	w = w ? w : 500;

	url = '/gal.php?lang='+lang+'&pid='+pid+'&id='+id+'&table='+table+'&width='+w+'&height='+h;

	popWin(url,h,w);	
}		


function nothing(){
	return;
}	

function checknum(val) 
{
	temp_val=val.split("");
	_exp = new RegExp(/\d/);
	_exp2 = new RegExp(/,/);
	_exp3 = new RegExp(/\./);
	ret_str='';
	for(i=0;i<temp_val.length;i++)
	{
		temp=_exp.test(temp_val[i]);
		temp2=_exp2.test(temp_val[i]);
		temp3=_exp3.test(temp_val[i]);
		if(temp || temp2 || temp3 || temp_val[i]==' ') 
		{
			ret_str+=temp_val[i];
		}

	}
	return ret_str;
}

var win = null;
function popWin(winurl, h, w, scroll, status)
{
	var h = h ? h : 310;
	var w = w ? w : 300;
	var scroll = scroll ? 1 : 0;
	var status = status ? 1 : 0;
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	var settings  ='height='+h+',';
	  settings +='width='+w+',';
	  settings +='top='+wint+',';
	  settings +='left='+winl+',';
	  settings +='scrollbars='+scroll+',';
	  settings +='status='+status+',';
	  settings +='resizable=yes';

	win=window.open(winurl,"",settings);
	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

function myHide(useDiv){
 if (document.getElementById) {
		eval("document.getElementById(useDiv).style.visibility = \"hidden\"");
	  } else {
		if (document.layers) {
			document.layers[useDiv].visibility = 'hidden';
		} else {
		  if (document.all) {
			eval("document.all."+useDiv+".style.visibility = \"hidden\"");
		  }
		}
	  }
}

function myShow(useDiv)
{
	 if (document.getElementById) {
		eval("document.getElementById(useDiv).style.visibility = \"visible\"");
	  } else {
		if (document.layers) {
			document.layers[useDiv].visibility = 'show';
		} else {
		  if (document.all) {
			eval("document.all."+useDiv+".style.visibility = \"visible\"");
		  }
		}
	  }

}

function confirmation2(url,txt)
{
	input_box=confirm(txt);
	if (input_box==true){ document.location=url}
}

function ShowHide(div) 
{
	if(document.getElementById( div ).style.display == 'none'){
		document.getElementById( div ).style.display = 'block';
	} else {
		document.getElementById( div ).style.display = 'none';
	}
}