
function confirm_on_del(val)
{

	if(val.length==0)
	val = "Are you sure?";
	
		if(confirm(val))
			return true;
		else
			return false;
}

function alert_delete(val1,val2,val3)
{

if(confirm_on_del(''))
{
str=val2+"&id="+val1+"&type="+val3;
//alert(str);
window.location.href=str;

}

}



function set_form_field(form_name, field_name, field_value)
{
	str="document."+form_name + "." + field_name + ".value='" + field_value+"'";
	eval(str);
}



function change_pass()
{
	var msg="";

	if(document.loginfrm.password.value.length==0)
		msg+="Enter New Password\n";

	if(document.loginfrm.password.value!=document.loginfrm.con_password.value)
		msg+= "Passwords do not match\n"; 
   
	if(document.loginfrm.old_pass.value.length==0)
		msg+="Enter Old Password\n";	
  
  if(msg.length > 0)

 {

	alert(msg);

	return false;

	}	

return true;

	
}

//for ajax

  function addOption(selectId, val, txt) {
    var objOption = new Option(txt, val);
     document.getElementById(selectId).options.add(objOption);
   }



function validate_listings()
{
	var msg="";
	var dc=document.listings_frm;
	
	for(i=0;i<dc.elements.length;i++)
	{
		if(dc.elements[i].value.length==0)
		{
			msg="enter";
			break;
		}
	}
	
	msg="";//no validation required
	if(msg.length > 0)
	{
		alert("Enter all Fields");
		return false;
	}
	
	return true;

}

