function formSendOpt(url, formName, params, loader, status) {
	
	var pars=$(formName).serialize();
	var ajax = new Ajax.Request( 
		url,
		{method: 'post', 
		postBody: pars, 
		parameters: params,
		onLoading: function (){
		$(loader).style.display = 'block';
		}, 
		onComplete:function (originalRequest){
		var newData = originalRequest.responseText;
		$(loader).style.display = 'none';
		//$(status).innerHTML =newData;
			
			sp= newData.split('|');
			if(sp[0]==1){
			window.location=sp[1];
			}else{
			$(status).innerHTML =sp[1];	
			}
			
			
		}});

	}
	

var loader;
var status;
function formSend(url, formName, params, loader, status) {
var pars=$(formName).serialize();

var ajax = new Ajax.Request( 
	url,
	{method: 'post', 
	postBody: pars, 
	parameters: params,
	onLoading: function (){
	$(loader).style.display = 'block';
	}, 
	onComplete:function (originalRequest){
	var newData = originalRequest.responseText;
	$(loader).style.display = 'none';
	$(status).innerHTML = newData;
	
	}});

} 


function getMePost(url, content, params) {	 
	var ajax = new Ajax.Updater(
	{success: content},
	url,
	{method: 'post', parameters: params});
}

  
function openWin(name,wid,hei,sbar,title){

	xx=screen.availWidth/2-wid/2;
	yy=screen.availHeight/2-hei/2;
	str="left=" + Math.round(xx) + ",top=" + Math.round(yy);
	window.open(name,title,'width='+wid+',height='+hei+',toolbar=no,scrollbars='+sbar+',resizable='+sbar+','+str);

}

function confirm_delete(loc){ 
	
	if (confirm("Are you sure you want to delete!")){ 
			self.location=loc; 
	} //end of if
} //end of function

function loginFormSend(url, formName, params, loader, status) {
	
	var pars=$(formName).serialize();
	var ajax = new Ajax.Request( 
		url,
		{method: 'post', 
		postBody: pars, 
		parameters: params,
		onLoading: function (){
		$(loader).style.display = 'block';
		}, 
		onComplete:function (originalRequest){
		var newData = originalRequest.responseText;
		$(loader).style.display = 'none';
		sp= newData.split('|');
			if(sp[0]==1){
				if(sp[1]!=""){
				$(loader).style.display = 'block';
				window.location=sp[1];
				}
			}else{
			$(status).innerHTML =sp[1];	
			}
			
		}});
} 
function checkrequired(which) {
var pass=true;
   if (document.images) {
      

      for (i=0;i<which.length;i++) {
      var tempobj=which.elements[i];
         if (tempobj.name.substring(0,8)=="required") {
		      //---added
			  if (tempobj.defaultValue==tempobj.value)
              tempobj.value = ""
			//-----------
			  
			  
              if (((tempobj.type=="text"||tempobj.type=="textarea")&&
              tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&
              tempobj.selectedIndex==0)) {
              pass=false;
              break;
              }
        }
      }
  }
if (!pass) {
shortFieldName=tempobj.name.substring(8,30).toUpperCase();
alert("Please make sure the "+shortFieldName+" field was properly completed.");
return false;
}
else
return true;
}//end of function