// JavaScript Document

function check_Mail(mail)
{
	 if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(mail))) 
	 {
		return false;
	} else
	{	return true;
	}
}

function check_Selected(id)
	{	
		d = document.getElementById(id);
		if(d.options[d.selectedIndex].value == -1) 
		{
			alert("Please choose an option from the dropdown menu.");
			d.focus();
			return false;
		}
		return true;
	}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}


function get_Element(id)
{
	return document.getElementById(id);
}

function do_Confirm(str)
{
	if(	window.confirm(str) ) return true;
	else return false;
}

// _____________________________________________________________________________

Function.prototype.defaults = function() 	
{ 	
  var _f = this; 	
  var _a = Array(_f.length-arguments.length).concat( 	
    arguments.length-1?Array.apply(null, arguments): 	
    [arguments[0]]); 	
  return function() 	
  { 	
    return _f.apply(_f, (arguments.length-1 ? 	
      Array.apply(null, arguments) : [arguments[0]]).concat( 	
        _a.slice(arguments.length, _a.length))); 	
  } 	
} 



var container_Show = function(obj, force_Show, force_Hide)
{
	if(force_Hide)
	{
		document.getElementById(obj).style.display = "none";
		return true;
	}
	if(force_Show)
	{
		document.getElementById(obj).style.display = "block";
		return true;
	}
	
	
	if(document.getElementById(obj).style.display == "none")
	{
		document.getElementById(obj).style.display = "block";
	}
	else 
	{
		document.getElementById(obj).style.display = "none";
	}
	
	
	return true;
	
}.defaults(false, false); 

