var fetchStatesDropDown;
var frm;
function submitfrmLinksexchangeUpdateLinks(obj)
{
	frm = obj;
    var errs=0;
    if (!commonCheck(obj.website_url, 'ERROR: Please enter website url', true)) errs += 1;
    else if (!commonCheck(obj.email, 'ERROR: Please enter your email id', true)) errs += 1;
    else if (!validateEmail(obj.email, 'ERROR: Please enter valid email', true)) errs += 1;
    else if (!commonCheck(obj.update_message, 'ERROR: Please type your request message', true)) errs += 1;
    if(errs==0) {
        obj.submit();		
	}
}
function submitfrmLinksexchangeNewCategory(obj)
{
	frm = obj;
	if (!commonCheck(frm.category_name, 'ERROR: Please enter category name', true)) errs += 1;
	if( typeof(frm.linksexchange_category.options)!='undefined') {
		if (frm.linksexchange_category.options[obj.linksexchange_category.selectedIndex].value=="0") { 
			alert("ERROR: Please select category");
			frm.linksexchange_category.focus();
			errs +=1
		} 
	}
}
function submitfrmLinksexchangeNewLinks(obj)
{
	frm = obj;
    var errs=0;
	if( typeof(frm.linksexchange_category.options)!='undefined') {
		if (frm.linksexchange_category.options[obj.linksexchange_category.selectedIndex].value=="0") { 
			alert("ERROR: Please select category");
			frm.linksexchange_category.focus();
			errs +=1
		} 
	}
	if(errs==0) {
	    if (!commonCheck(obj.link_title, 'ERROR: Please enter website\'s title', true)) errs += 1;
		else if (!commonCheck(obj.website_url, 'ERROR: Please enter website url', true)) errs += 1;
		else if(!validateUrlPath(obj.website_url, "ERROR: Unusual website url - check if correct", true)) errs += 1;
		else if (!commonCheck(obj.reciprocal_url, 'ERROR: Please enter reciprocal url', true)) errs += 1;
		else if(!validateUrlPath(obj.reciprocal_url, "ERROR: Unusual reciprocal url - check if correct", true)) errs += 1;
        else if (!commonCheck(obj.description, 'ERROR: Please enter description', true)) errs += 1;
        else if (!commonCheck(obj.email, 'ERROR: Please enter your email id', true)) errs += 1;
        else if (!validateEmail(obj.email, 'ERROR: Please enter valid email', true)) errs += 1;
	}    
    if (errs == 0) {
        obj.submit();		
    }
}