//OBJECTIVE : Script to replace ' (Apostrophe) with either a space or delete the character as it is incompatible with the current database.
//PROGRAMMER : Rufus P Shrestha
//DATE : 20 APRIL 2010
//PROJECT : Artist Fact Finder
//COMPANY : Blue Pie Productions Pty Ltd, Unit 20 / 112 McEvoy Street, Alexandria, NSW 2015
//STATUS : Deployed

function replaceArtist_name(entry) {
out = "'"; // replace this
add = " "; // with this

artist_name = "" + entry; // temporary holder

while (artist_name.indexOf(out)>-1)
	{
		pos= artist_name.indexOf(out);
		artist_name = "" + (artist_name.substring(0, pos) + add + 
		artist_name.substring((pos + out.length), artist_name.length));
	}
	document.form1.artist_name.value = artist_name;
}

function replaceArtist_website_url(entry) {
out = "'"; // replace this
add = " "; // with this

artist_website_url = "" + entry; // temporary holder

while (artist_website_url.indexOf(out)>-1)
	{
		pos= artist_website_url.indexOf(out);
		artist_website_url = "" + (artist_website_url.substring(0, pos) + add + 
		artist_website_url.substring((pos + out.length), artist_website_url.length));
	}
	document.form1.artist_website_url.value = artist_website_url;
}

function replaceArtist_myspace_url(entry) {
out = "'"; // replace this
add = " "; // with this

artist_myspace_url = "" + entry; // temporary holder

while (artist_myspace_url.indexOf(out)>-1)
	{
		pos= artist_myspace_url.indexOf(out);
		artist_myspace_url = "" + (artist_myspace_url.substring(0, pos) + add + 
		artist_myspace_url.substring((pos + out.length), artist_myspace_url.length));
	}
	document.form1.artist_myspace_url.value = artist_myspace_url;
}

function replaceArtist_address(entry) {
out = "'"; // replace this
add = " "; // with this

artist_address = "" + entry; // temporary holder

while (artist_address.indexOf(out)>-1)
	{
		pos= artist_address.indexOf(out);
		artist_address = "" + (artist_address.substring(0, pos) + add + 
		artist_address.substring((pos + out.length), artist_address.length));
	}
	document.form1.artist_address.value = artist_address;
}

function replaceArtist_state(entry) {
out = "'"; // replace this
add = " "; // with this

artist_state = "" + entry; // temporary holder

while (artist_state.indexOf(out)>-1)
	{
		pos= artist_state.indexOf(out);
		artist_state = "" + (artist_state.substring(0, pos) + add + 
		artist_state.substring((pos + out.length), artist_state.length));
	}
	document.form1.artist_state.value = artist_state;
}

function replaceArtist_postcode(entry) {
out = "'"; // replace this
add = " "; // with this

artist_postcode = "" + entry; // temporary holder

while (artist_postcode.indexOf(out)>-1)
	{
		pos= artist_postcode.indexOf(out);
		artist_postcode = "" + (artist_postcode.substring(0, pos) + add + 
		artist_postcode.substring((pos + out.length), artist_postcode.length));
	}
	document.form1.artist_postcode.value = artist_postcode;
}

function replaceArtist_phone_number(entry) {
out = "'"; // replace this
add = " "; // with this

artist_phone_number = "" + entry; // temporary holder

while (artist_phone_number.indexOf(out)>-1)
	{
		pos= artist_phone_number.indexOf(out);
		artist_phone_number = "" + (artist_phone_number.substring(0, pos) + add + 
		artist_phone_number.substring((pos + out.length), artist_phone_number.length));
	}
	document.form1.artist_phone_number.value = artist_phone_number;
}

function replaceArtist_fax_number(entry) {
out = "'"; // replace this
add = " "; // with this

artist_fax_number = "" + entry; // temporary holder

while (artist_fax_number.indexOf(out)>-1)
	{
		pos= artist_fax_number.indexOf(out);
		artist_fax_number = "" + (artist_fax_number.substring(0, pos) + add + 
		artist_fax_number.substring((pos + out.length), artist_fax_number.length));
	}
	document.form1.artist_fax_number.value = artist_fax_number;
}

function replaceArtist_mobile_number(entry) {
out = "'"; // replace this
add = " "; // with this

artist_mobile_number = "" + entry; // temporary holder

while (artist_mobile_number.indexOf(out)>-1)
	{
		pos= artist_mobile_number.indexOf(out);
		artist_mobile_number = "" + (artist_mobile_number.substring(0, pos) + add + 
		artist_mobile_number.substring((pos + out.length), artist_mobile_number.length));
	}
	document.form1.artist_mobile_number.value = artist_mobile_number;
}

function replaceArtist_email1(entry) {
out = "'"; // replace this
add = ""; // with this

artist_email1 = "" + entry; // temporary holder

while (artist_email1.indexOf(out)>-1)
	{
		pos= artist_email1.indexOf(out);
		artist_email1 = "" + (artist_email1.substring(0, pos) + add + 
		artist_email1.substring((pos + out.length), artist_email1.length));
	}
	document.form1.artist_email1.value = artist_email1;
}

function replaceArtist_email2(entry) {
out = "'"; // replace this
add = ""; // with this

artist_email2 = "" + entry; // temporary holder

while (artist_email2.indexOf(out)>-1)
	{
		pos= artist_email2.indexOf(out);
		artist_email2 = "" + (artist_email2.substring(0, pos) + add + 
		artist_email2.substring((pos + out.length), artist_email2.length));
	}
	document.form1.artist_email2.value = artist_email2;
}

function replaceMyspace_stats(entry) {
out = "'"; // replace this
add = " "; // with this

myspace_stats = "" + entry; // temporary holder

while (myspace_stats.indexOf(out)>-1)
	{
		pos= myspace_stats.indexOf(out);
		myspace_stats = "" + (myspace_stats.substring(0, pos) + add + 
		myspace_stats.substring((pos + out.length), myspace_stats.length));
	}
	document.form1.myspace_stats.value = myspace_stats;
}

function replaceChart_answer(entry) {
out = "'"; // replace this
add = " "; // with this

chart_answer = "" + entry; // temporary holder

while (chart_answer.indexOf(out)>-1)
	{
		pos= chart_answer.indexOf(out);
		chart_answer = "" + (chart_answer.substring(0, pos) + add + 
		chart_answer.substring((pos + out.length), chart_answer.length));
	}
	document.form1.chart_answer.value = chart_answer;
}

function replacePublish_answer(entry) {
out = "'"; // replace this
add = " "; // with this

publish_answer = "" + entry; // temporary holder

while (publish_answer.indexOf(out)>-1)
	{
		pos= publish_answer.indexOf(out);
		publish_answer = "" + (publish_answer.substring(0, pos) + add + 
		publish_answer.substring((pos + out.length), publish_answer.length));
	}
	document.form1.publish_answer.value = publish_answer;
}

function replaceBudget_answer(entry) {
out = "'"; // replace this
add = " "; // with this

budget_answer = "" + entry; // temporary holder

while (budget_answer.indexOf(out)>-1)
	{
		pos= budget_answer.indexOf(out);
		budget_answer = "" + (budget_answer.substring(0, pos) + add + 
		budget_answer.substring((pos + out.length), budget_answer.length));
	}
	document.form1.budget_answer.value = budget_answer;
}

function replaceManager_answer(entry) {
out = "'"; // replace this
add = " "; // with this

manager_answer = "" + entry; // temporary holder

while (manager_answer.indexOf(out)>-1)
	{
		pos= manager_answer.indexOf(out);
		manager_answer = "" + (manager_answer.substring(0, pos) + add + 
		manager_answer.substring((pos + out.length), manager_answer.length));
	}
	document.form1.manager_answer.value = manager_answer;
}

function replaceLegal_answer(entry) {
out = "'"; // replace this
add = " "; // with this

legal_answer = "" + entry; // temporary holder

while (legal_answer.indexOf(out)>-1)
	{
		pos= legal_answer.indexOf(out);
		legal_answer = "" + (legal_answer.substring(0, pos) + add + 
		legal_answer.substring((pos + out.length), legal_answer.length));
	}
	document.form1.legal_answer.value = legal_answer;
}

function replaceAccountant_answer(entry) {
out = "'"; // replace this
add = " "; // with this

accountant_answer = "" + entry; // temporary holder

while (accountant_answer.indexOf(out)>-1)
	{
		pos= accountant_answer.indexOf(out);
		accountant_answer = "" + (accountant_answer.substring(0, pos) + add + 
		accountant_answer.substring((pos + out.length), accountant_answer.length));
	}
	document.form1.accountant_answer.value = accountant_answer;
}

function replaceFunding_answer(entry) {
out = "'"; // replace this
add = " "; // with this

funding_answer = "" + entry; // temporary holder

while (funding_answer.indexOf(out)>-1)
	{
		pos= funding_answer.indexOf(out);
		funding_answer = "" + (funding_answer.substring(0, pos) + add + 
		funding_answer.substring((pos + out.length), funding_answer.length));
	}
	document.form1.funding_answer.value = funding_answer;
}

function replaceInfluential_answer(entry) {
out = "'"; // replace this
add = " "; // with this

influential_answer = "" + entry; // temporary holder

while (influential_answer.indexOf(out)>-1)
	{
		pos= influential_answer.indexOf(out);
		influential_answer = "" + (influential_answer.substring(0, pos) + add + 
		influential_answer.substring((pos + out.length), influential_answer.length));
	}
	document.form1.influential_answer.value = influential_answer;
}

function replaceArtist_sales(entry) {
out = "'"; // replace this
add = " "; // with this

artist_sales = "" + entry; // temporary holder

while (artist_sales.indexOf(out)>-1)
	{
		pos= artist_sales.indexOf(out);
		artist_sales = "" + (artist_sales.substring(0, pos) + add + 
		artist_sales.substring((pos + out.length), artist_sales.length));
	}
	document.form1.artist_sales.value = artist_sales;
}

function replaceTouring_sales(entry) {
out = "'"; // replace this
add = " "; // with this

touring_sales = "" + entry; // temporary holder

while (touring_sales.indexOf(out)>-1)
	{
		pos= touring_sales.indexOf(out);
		touring_sales = "" + (touring_sales.substring(0, pos) + add + 
		touring_sales.substring((pos + out.length), touring_sales.length));
	}
	document.form1.touring_sales.value = touring_sales;
}
