var oldborder;

function showEdit(ele)
{
	var edit;
	edit = document.getElementById(ele).parentNode;
	oldborder = edit.style.border;
	edit.style.border = "2px solid #D2421A";
}

function hideEdit(ele)
{
	var edit;
	edit = document.getElementById(ele).parentNode;
	edit.style.border = oldborder;
	if(oldborder==""){
		edit.style.border = "none";
	}
}

function confirmDelete(a_str_form, a_str_link){

	var question = confirm("Continue with Delete?");
	if (question == true)
	{
		if(a_str_link)
		{
			window.location = a_str_link;
		}
		else
		{
			a_str_form.submit();
		}
	}

}

function confirmDeleteUser(a_str_form, a_str_link, a_str_name){

	var question = confirm("Continue with Delete of " + a_str_name+ "?");
	if (question == true)
	{
		if(a_str_link)
		{
			window.location = a_str_link;
		}
		else
		{
			a_str_form.submit();
		}
	}

}

function submitonEnter(evt,form){
	var charCode = (evt.which) ? evt.which : event.keyCode;
	if(!charCode){charCode = evt.keyCode;}
	if(charCode == "13"){
		document.form.submit();
		return false;
	}

}

function removeIndustryFromSession(tag_subtag)
{
	var url = "ajax_remove_ind.php?tags=" + escape(tag_subtag);
	new Ajax.Request(url, {
		method: 'get',
		onSuccess: function(req) {
		    new Ajax.Updater('addtag','ajax.addtag.php',{method: 'get',parameters: 'id=',evalScripts: true});
		},
		onFailure: function(req) {
			alert('There was a problem processing your request.');
		}
	});
}

function removeSICFromSession(sic)
{
	var url = "ajax_remove_sic.php?tags=" + escape(sic);
	new Ajax.Request(url, {
		method: 'get',
		onSuccess: function(req) {
		    new Ajax.Updater('brsic','ajax.brsic.php',{method: 'get',parameters: 'id=',evalScripts: true})
		},
		onFailure: function(req) {
			alert('There was a problem processing your request.');
		}
	});
}

function removeNAICSFromSession(code_subcode)
{
	var url = "ajax_remove_naics.php?tags=" + escape(code_subcode);
	new Ajax.Request(url, {
		method: 'get',
		onSuccess: function(req) {
		    new Ajax.Updater('brnaics','ajax.brnaics.php',{method: 'get',parameters: 'id=',evalScripts: true});
		},
		onFailure: function(req) {
			alert('There was a problem processing your request.');
		}
	});
}