// JavaScript Document

// JavaScript Document
var nn4 = (document.layers) ? true : false ; 
var ie = (document.all) ? true : false ;
var dom = (document.getElementById && !document.all) ? true : false ;
var box_Label = "&nbsp;Ucitavam...&nbsp;";
var box_Label_Default = box_Label;
var THEME = 'standard';
	
	
	
function window_Size() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
 // window.alert( 'Width = ' + myWidth );
  //window.alert( 'Height = ' + myHeight );
  return [myWidth,myHeight];
  
}
	
	
function get_Scroll() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement &&
      ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  //alert(scrOfY);
  //return scrOfY;
  return [ scrOfX, scrOfY ];
}

function move_Layer(id,x,y) 
{

var layer = document.getElementById(id) // get browser specific path to block element


   if(nn4){
   layer.top = y;
   layer.left = x;
   }
   else{
   layer.style.top = y;
   layer.style.left = x;
   }

} 

function show_hide(obj)
{
		if(document.getElementById(obj).style.display == "none")
		{
			document.getElementById(obj).style.display = "block";
		}
		else 
		{
			document.getElementById(obj).style.display = "none";
		}
	
}
function show_Hide(obj)
{	
	show_hide(obj);		
}

function set_Box_Label(str)
{
	box_Label = '&nbsp;' + str + '&nbsp;';
}

function loading_Layer(id, vis)
{
	var layer = document.getElementById(id);
	var label = box_Label;
	
	layer.innerHTML = label;

	if(vis != 0)
	{
	var x;
	var y;
	var ofx = layer.clientWidth + 5;
	var ofy = 5;

	
	//x = window_Size();
	x = 750;
	x = x - ofx;
	y = get_Scroll();
	y = y[1] + ofy;
	
	move_Layer(id,x,y);
	
	if(nn4) layer.visibility = "show";
		else layer.style.visibility = "visible";
	
	}
	else
	{
		if(nn4) layer.visibility = "hide";
		else layer.style.visibility = "hidden";
	}
	
	set_Box_Label(box_Label_Default);
}

function do_Confirm(str)
{
	if(	window.confirm(str) ) return true;
	else return false;
}

function mail_Check(mail)
{
 if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(mail)))  return false;
 else return true;
}