function newWindow(a_str_windowURL, a_str_windowName, a_int_windowWidth, a_int_windowHeight, a_bool_scrollbars, a_bool_resizable, a_bool_menubar, a_bool_toolbar, a_bool_addressbar, a_bool_statusbar, a_bool_fullscreen) {

  var int_windowLeft = (screen.width - a_int_windowWidth) / 2;

  var int_windowTop = (screen.height - a_int_windowHeight) / 2;

  var str_windowProperties = 'height=' + a_int_windowHeight + ',width=' + a_int_windowWidth + ',top=' + int_windowTop + ',left=' + int_windowLeft + ',scrollbars=' + a_bool_scrollbars + ',resizable=' + a_bool_resizable + ',menubar=' + a_bool_menubar + ',toolbar=' + a_bool_toolbar + ',location=' + a_bool_addressbar + ',statusbar=' + a_bool_statusbar + ',fullscreen=' + a_bool_fullscreen + '';

  var obj_window = window.open(a_str_windowURL, a_str_windowName, str_windowProperties)

    if (parseInt(navigator.appVersion) >= 4) {

      obj_window.window.focus();

    }

  return obj_window;

}



function help(fieldname,body) {

	pagename = '?q=help,'+fieldname+','+body+'';

	newWindow (pagename, 'help', 500, 100, 1, 0, 0, 0, 0, 0, 0);

}



function rhino_bookmark(){

  url = document.location;

  title = document.title;

  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {

  window.external.AddFavorite(url,title);

  } else if (navigator.appName == "Netscape") {

    window.sidebar.addPanel(title,url,"");

  } else {

    alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");

  }

}



function rhino_print () {

	var _url = document.location + "";

	var pos = _url.indexOf("?");

	if (pos >= 0) {

			url = document.location + '&print=1';		

	}

	else {

			url = document.location + '?print=1';

	}

	newWindow(url, 'Print', '800', '600', 1, 1, 1, 1, 1, 1, 0);

}



function rhino_tell () {

	var tellurl = 'modules/friend/';

	newWindow(tellurl, 'Print', '400', '300', 0, 0, 0, 0, 0, 0, 0);

}



function EnableDisable(id) {

     body=document.getElementById(id);

     if (body) {

       if (body.style.display == 'none') {

         try {

           body.style.display='table-row';

         } catch(e) {

           body.style.display = 'block';

         }

       }

       else {

         body.style.display = 'none';

       }

     }

}



function SetText (id, text) {

	body=document.getElementById(id);

	if (body) {

		body.innerHTML  = text;

	}

}







function Disable(id) {

	body=document.getElementById(id);

     if (body) {

     	body.style.display = 'none';

     }

}



function Enable(id) {

     body=document.getElementById(id);

     if (body) {

         try {

           body.style.display='table-row';

         } catch(e) {

           body.style.display = 'block';

         }

     }

}
function validateEmail(form_id,email) {
	var address = document.forms[form_id].elements[email].value;
   if(address){
	   	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	   
	   if(reg.test(address) == false) {
	      alert('Error: Invalid Email Address');
		  document.forms[form_id].elements[email].value = "";
	      return false;
	   }
   }
   
}
