function callFormValidation(form) {
 if (validateForm(form,0,0,0,0)){
  form.submit();
 }
 return false;
}

String.prototype.trim = function() {
    return this.replace(/^\s+|\s+$/g,"");
}
String.prototype.ltrim = function() {
    return this.replace(/^\s+/,"");
}
String.prototype.rtrim = function() {
    return this.replace(/\s+$/,"");
}

var modifyWindow;
function OpenWindow(url,width,height,scrollbars,windowname)
{
	var w = width;
	var h = height;
	var s = scrollbars;
	var x = 100;
	var y = 150;
	if (document.all)
	{
		var xMax = screen.width, yMax = screen.height;
		x = ((xMax/2) - (w/2));
		y = ((yMax/2) - (h/2));
	}
	else if (document.layers) 
	{
		var xMax = window.outerWidth, yMax = window.outerHeight;
		x = ((xMax/2) - (w/2));
		y = ((yMax/2) - (h/2));
	}
	
	options = "screenX=" + x + ",screenY=" + y + ",top=" + y + ",left=" + x + ",toolbar=0,status=0,menubar=0,scrollbars="+ s +",resizable=1,width=" + w +",height=" + h;
	modifyWindow = window.open(url,windowname,options);
	try
	{
	if (modifyWindow.opener == null) 
		modifyWindow.opener = self;
		modifyWindow.focus();
	}
	catch(err)
	{
	
	}
	
}
