function validateForm(form,notsetfocus,validateCallBack)
	{
	var formIsOk = true;
	var elementIsOk = null;
	var currentElement = null;
	var i=0;
	var tmp = null;
	var elements = null;
	var elementIsOk = null;
	
	Element.extend(form);
	elements = form.getElements();
	elementIsOk = new Array(elements.length);
	
	for (i=elements.length-1;i>=0;i--) 	{
		elementIsOk[i] = null;
		currentElement = elements[i];

		if (currentElement.hasAttribute('onSubmit'))
			{
			eval("currentElement.onSubmit = function () { "+ currentElement.getAttribute('onSubmit') +" };");
			elementIsOk[i] = currentElement.onSubmit();
			}
		
		if (!((elementIsOk[i]===true) || (elementIsOk[i]===false)) && elements[i].hasAttribute('format'))
			if ($F(currentElement).match(currentElement.getAttribute('format')))
				elementIsOk[i] = true;
			else
				elementIsOk[i] = false;
		}
		
	
	for (i=elements.length-1;i>=0;i--) 	{	
		currentElement = elements[i];
		if (elementIsOk[i]===false) {
			tmp = null;
			if (currentElement.hasAttribute('onValidationError'))
				{
				eval("currentElement.onValidationError = function () { "+ currentElement.getAttribute('onValidationError') +" };");
				tmp =currentElement.onValidationError();
				}
			if (!((tmp===true) || (tmp===false))) {
				try
					{
					currentElement.focus();
					}
				catch(err)
					{
					
					}
				if ($(currentElement.id + '_error'))
					$(currentElement.id + '_error').style.display='';
				}
			else {
				if (tmp===false)
					elementIsOk[i]=true;
				}
			}
		}
	for (i=elements.length-1;i>=0;i--) 	{	
		currentElement = elements[i];
		if (!(elementIsOk[i]===false)) {
			tmp = null;
			if (currentElement.hasAttribute('onValidationPassed'))
				{
				eval("currentElement.onValidationPassed = function () { "+ currentElement.getAttribute('onValidationPassed') +" };");
				tmp =currentElement.onValidationPassed();
				}
			if (!((tmp===true) || (tmp===false))) {
				if ($(currentElement.id + '_error'))
					$(currentElement.id + '_error').style.display='none';
				}
			else {
				if (tmp===false)
					elementIsOk[i]=false;
				}
			}
				
		if (elementIsOk[i]===false)
			formIsOk = false;
		}
	
	if ((formIsOk==false) && form.hasAttribute('onValidationError'))
		{
		eval("form.onValidationError = function () { "+ form.getAttribute('onValidationError') +" };");
		tmp = form.onValidationError();
		if (!((tmp===true) || (tmp===false))) {
			if ($(form.id + '_error'))
				$(form.id + '_error').style.display='';
			}
		else {
			if (tmp===false)
				formIsOk=true;
			}
		}
	
	if ((formIsOk==true) && form.hasAttribute('onValidationPassed'))
		{
		eval("form.onValidationPassed = function () { "+ form.getAttribute('onValidationPassed') +" };");
		tmp = form.onValidationPassed();
		if (!((tmp===true) || (tmp===false))) {
			if ($(form.id + '_error'))
				$(form.id + '_error').style.display='none';
			}
		else {
			if (tmp===false)
				formIsOk=false;
			}
		}
	
	return (formIsOk===false)?false:true;
	
	}

function confirmLink(ask){
document.frozenenter = true;   
if (typeof(window.opera) != 'undefined') return true; 	
return ret=confirm('Warning: ' + ask);}

function  _openFull(p1,titl){
var x1='/_std/bigpic.html?ltitle=' + p1 +((p1.search('.swf')>-1)?'&ext=swf':'') + '&rtitle='+ titl; //
var a=window.open(x1, '', "height=150, width=230, status=no, scrollbars=no, menubar=no,  resizable=no, left=" + 150/2 + " , top=" + 230/2);
a.focus();
return;
}

function trim(inputString) {
   if (typeof inputString != "string") { return inputString; }
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   while (ch == " ") { // Check for spaces at the beginning of the string
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   ch = retValue.substring(retValue.length-1, retValue.length);
   while (ch == " ") { // Check for spaces at the end of the string
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }
   while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
   }
   return retValue; // Return the trimmed string back to the user
} // Ends the "trim" function


function isEmailAddr(email)
{
  var result = false
  var theStr = new String(email)
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}

function isUrl(url)
	{
	var urlRegxp = 	/^(http:\/\/www.|https:\/\/www.|ftp:\/\/www.|www.){0,1}([\w]+)(.[\w]+){1,2}$/
		if (urlRegxp.test(url) != true) return false;
		else return true;
	}

function linit(){
var ix=document.getElementById('limg').width, iy=document.getElementById('limg').height;
window.moveTo((screen.availWidth-ix)/2,(screen.availHeight-iy)/2);
window.resizeTo(ix, iy);
document.getElementById('table_loading').style.display='none';
return;
}

// Browser Detection Javascript
// copyright 1 February 2003, by Stephen Chapman, Felgall Pty Ltd

// You have permission to copy and use this javascript provided that
// the content of the script is not changed in any way.

function getBrowser() {
var agt=navigator.userAgent.toLowerCase();
if (agt.indexOf("opera") != -1) return 'Opera';
if (agt.indexOf("staroffice") != -1) return 'Star Office';
if (agt.indexOf("beonex") != -1) return 'Beonex';
if (agt.indexOf("chimera") != -1) return 'Chimera';
if (agt.indexOf("netpositive") != -1) return 'NetPositive';
if (agt.indexOf("phoenix") != -1) return 'Phoenix';
if (agt.indexOf("firefox") != -1) return 'Firefox';
if (agt.indexOf("safari") != -1) return 'Safari';
if (agt.indexOf("skipstone") != -1) return 'SkipStone';
if (agt.indexOf("msie") != -1) return 'MSIE';
if (agt.indexOf("netscape") != -1) return 'Netscape';
if (agt.indexOf("mozilla/5.0") != -1) return 'Mozilla';
if (agt.indexOf('\/') != -1) {
if (agt.substr(0,agt.indexOf('\/')) != 'mozilla') {
return navigator.userAgent.substr(0,agt.indexOf('\/'));}
else return 'Netscape';} else if (agt.indexOf(' ') != -1)
return navigator.userAgent.substr(0,agt.indexOf(' '));
else return navigator.userAgent;
}


function show_hide_element(id)
{
if (document.getElementById(id))
	document.getElementById(id).style.display = ((document.getElementById(id).style.display == 'inline')?'none':'inline');
}

function storeCaret(textEl) {
	if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
}

function copy_clip(meintext){if (window.clipboardData) {window.clipboardData.setData("Text", meintext);}else if (window.netscape) { netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);if (!clip) return;var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);if (!trans) return;trans.addDataFlavor('text/unicode');var str = new Object();var len = new Object();var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);var copytext=meintext;str.data=copytext;trans.setTransferData("text/unicode",str,copytext.length*2);var clipid=Components.interfaces.nsIClipboard;if (!clip) return false;clip.setData(trans,null,clipid.kGlobalClipboard);}alert("Following info was copied to your clipboard:\n\n" + meintext);return false;}