function createBookmarkLink(url, title) {
	try {
		if (window.sidebar) { // Mozilla Firefox Bookmark
			return window.sidebar.addPanel(title, url, "");
		} else if( window.external ) { // IE Favorite
			return window.external.AddFavorite( url, title); 
		} else if(window.opera && window.print) { // Opera Hotlist
			return true; 
		}
	} catch(err) {
		// do nothing
	}
	alert('Could not create a bookmark on your client.\n\nTo return to ' + title + ' you must manually create a bookmark to: \n' + url + '.');
}

function writeBookmarkLink(url, title) {
	try {
		if (window.sidebar) { // Mozilla Firefox Bookmark
			return document.write('<a href="javascript:createBookmarkLink(\'' + url + '\', \'' + title + '\')");">Create a Bookmark to <em>' + title + '</em></a>'); 
		} else if (window.external) { // IE Favorite
			return document.write('<a href="javascript:createBookmarkLink(\'' + url + '\', \'' + title + '\')");">Add <em>' + title + '</em> to your Favorites</a>'); 
		} else if (window.opera && window.print) { // Opera Hotlist
			return document.write('<a rel="sidebar" href="' + url + '" title="' + title + '">Create a Bookmark to <em>' + title + '</em></a>');
		} 
	} catch(err) {
		// do nothing
	}
	return document.write('To return to ' + title + ' create a bookmark to: <a style="color: white;" href="' + url + '">' + url + '</a>');
}


function replaceChars(field1) {
out = ","; // replace this
add = "&nbsp;-&nbsp;"; // with this
temp = "" + field1; // temporary holder

while (temp.indexOf(out)>-1) {
pos= temp.indexOf(out);
temp = "" + (temp.substring(0, pos) + add + 
temp.substring((pos + out.length), temp.length));
}
//field1.value = temp;
return document.write(temp)
}




function showYouTube(url) {
try
{
var urlInput = url;
var pattern = "watch\?v=";
var replacement = "v/";
var urlInput = urlInput.replace(pattern, replacement);
var YouTubeEmbed = '<object width="320" height="267"><param name="movie" value="' + urlInput + '&rel=0&color1=0x3a3a3a&color2=0x999999&border=1&hl=en"><\/param><param name="wmode" value="transparent"><\/param>\<embed src="' + urlInput + '&rel=0&color1=0x3a3a3a&color2=0x999999&border=1&hl=en" type="application\/x-shockwave-flash" wmode="transparent" width="320" height="267"><\/embed><\/object>';	
return document.writeln(YouTubeEmbed);
}
catch(err)
  {
  txt="Hi .\n\n"
  txt+="There was an error on this page.\n\n"
  txt+="YouTube video cannot be displayed.\n\n"
  txt+="Error description: " + err.description + "\n\n"
  txt+="Error on: " + ctlValue + "\n\n"
  txt+="Click OK to continue.\n\n"
  alert(txt)
  }
finally
  {
  // do nothing
  }
} 


function ClearSubCategory(Control1, Control2) {

try 
{


	Control2.value = '';
	//Control2.style.display = 'none';

}
catch(err)
  {
  txt="Hi {XMOD_UserFirstName}.\n\n"
  txt+="There was an error on this page.\n\n"
  txt+="Error description: " + err.description + "\n\n"
  txt+="Click OK to continue.\n\n"
  alert(txt)
  }
finally
  {
  // do nothing
  }
}
