<!--
function roll(img_name, img_src)
{
   document[img_name].src = img_src;
}

function funcUrl(xmlPath){
	alert(xmlPath);
}

function openwin(theurl, vHeight, vWidth){
	refwindow = window.open(theurl,'Window','resizable=yes,scrollbars=1,height='+ vHeight +',width='+ vWidth);
	refwindow.focus();
}

function confirmRedir(txt, url){
	if (confirm(txt)){
		document.location.href = url;
	}
}

function isEmail(string) {
	if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
		return true;
	else
		return false;
}


function validateRegistration() {
	message='';
	if (!document.sample.firstname.value){
		message += 'Please remember to type in a first name.\n';
	}

	if (!document.sample.lastname.value){
		message += 'Please remember to type in a last name.\n';
	}

	if (!document.sample.address1.value){
		message += 'Please remember to type in an address.\n';
	}

	if (!document.sample.city.value){
		message += 'Please remember to type in a city name.\n';
	}

	if (!document.sample.zipcode.value){
		message += 'Please remember to type in a zip code.\n';
	}

	if (!document.sample.email.value){
		message += 'Please remember to type in an e-mail address.\n';
	}else{
		if(!isEmail(document.sample.email.value)){
			message += 'Please type in a valid e-mail address.\n';
		}
	}

	if (!document.sample.phone.value){
		message += 'Please remember to type in a telephone number.\n';
	}

	if(message==''){
		document.sample.submit();
	}else{
		alert(message);
	}
}


function validateHTML() {
	message='';
	if (!document.element.title.value){
		message += 'Please remember to type in a title.\n';
	}

	if (!document.element.layoutID.value){
		message += 'Please remember to select a layout.\n';
	}else{

		//alert('Layout: ' + document.element.layoutID.value);
		//alert('Content: ' + document.element.content.value);
		//alert('Picture: ' + document.element.picNameHidden.value);

		// ONLY TEXT //
		if(document.element.layoutID.value=='1' && !document.element.content.value ){
			message += 'Please remember to type in some content.\n';
		}
		// ONLY PICTURE //
		if(document.element.layoutID.value=='2' && (!document.element.picName.value && !document.element.picNameHidden.value)){
			message += 'Please remember to select a picture.\n';
		}
		// TEXT AND PICTURE //
		if(document.element.layoutID.value=='3' && (!document.element.content.value || !document.element.picNameHidden.value)){
			message += 'Please remember to type in some content and select a picture.\n';
		}
		if(document.element.layoutID.value=='4' && (!document.element.content.value || !document.element.picNameHidden.value)){
			message += 'Please remember to type in some content and select a picture.\n';
		}
		if(document.element.layoutID.value=='5' && (!document.element.content.value || !document.element.picNameHidden.value)){
			message += 'Please remember to type in some content and select a picture.\n';
		}
		if(document.element.layoutID.value=='6' && (!document.element.content.value || !document.element.picNameHidden.value)){
			message += 'Please remember to type in some content and select a picture.\n';
		}
		if(document.element.layoutID.value=='7' && (!document.element.content.value || !document.element.picNameHidden.value)){
			message += 'Please remember to type in some content and select a picture.\n';
		}
		if(document.element.layoutID.value=='8' && (!document.element.content.value || !document.element.picNameHidden.value)){
			message += 'Please remember to type in some content and select a picture.\n';
		}
		if(document.element.layoutID.value=='9' && (!document.element.content.value || !document.element.picNameHidden.value)){
			message += 'Please remember to type in some content and select a picture.\n';
		}
	}

	if(message==''){
		document.element.submit();
	}else{
		alert(message);
	}
}

function jump() {
	url = document.selLanguage.actLanguage.value;
	if(url != "0") {
		window.location.href=url
	}
	return true;
}

function insertChar() {
	if(document.element.specChars.value!='0'){
		// TRANSFER VALUE
		document.element.spectag.value = document.element.specChars.value;

		// HANDLE AND COPY TEXT TO CLIPBOARD
		var tempval = document.element.spectag;
		therange = tempval.createTextRange()
		therange.execCommand("Copy")

		pasteChar()
	}
}

function subScript() {
	// COPY SELECTED TEXT TO CLIPBOARD
	copyChar()

	//HANDLE TEXT
	copiedText = window.clipboardData.getData("Text");
	document.element.spectag.value = '<sub>' + copiedText + '</sub>';

	if (document.element.spectag.value) {
		// HANDLE AND PASTE TEXT TO CLIPBOARD
		var tempval = document.element.spectag;
		therange = tempval.createTextRange();
		therange.execCommand("Copy")
		pasteChar()
	}
}

function superScript() {
	// COPY SELECTED TEXT TO CLIPBOARD
	copyChar()

	//HANDLE TEXT
	copiedText = window.clipboardData.getData("Text");
	document.element.spectag.value = '<sup>' + copiedText + '</sup>';

	if (document.element.spectag.value) {
		// HANDLE AND PASTE TEXT TO CLIPBOARD
		var tempval = document.element.spectag;
		therange = tempval.createTextRange();
		therange.execCommand("Copy")
		pasteChar()
	}
}

function internalLinks(linkspecs) {
	// COPY SELECTED TEXT TO CLIPBOARD
	copyChar()

	//HANDLE TEXT
	copiedText = window.clipboardData.getData("Text");
	document.element.spectag.value = '<a href=\"' + linkspecs + '\">' + copiedText + '</a>';

	if (document.element.spectag.value) {
		// HANDLE AND PASTE TEXT TO CLIPBOARD
		var tempval = document.element.spectag;
		therange = tempval.createTextRange();
		therange.execCommand("Copy")
		pasteChar()
	}
}

function removeFormat() {
//	element.editor.ExecCommand(DECMD_REMOVEFORMAT,0);
//	element.editor.focus();

	// COPY SELECTED TEXT TO CLIPBOARD
	element.editor.ExecCommand(DECMD_SELECTALL,0);
	copyChar()

	copiedText = '';
	document.element.formatRemoval.value = '';

	//HANDLE TEXT
	copiedText = window.clipboardData.getData("Text");
	document.element.formatRemoval.value = copiedText;

	if (document.element.formatRemoval.value) {
		// HANDLE AND PASTE TEXT TO CLIPBOARD
		var tempval = document.element.formatRemoval;
		therange = tempval.createTextRange();
		therange.execCommand("Copy")
		pasteChar()
	}
	element.editor.focus();
}

function bold() {
	element.editor.ExecCommand(DECMD_BOLD,0);
	element.editor.focus();
}

function italic() {
	element.editor.ExecCommand(DECMD_ITALIC,0);
	element.editor.focus();
}

function underline() {
	element.editor.ExecCommand(DECMD_UNDERLINE,0);
	element.editor.focus();
}

function oList() {
	element.editor.ExecCommand(DECMD_ORDERLIST,0);
	element.editor.focus();
}

function uList() {
	element.editor.ExecCommand(DECMD_UNORDERLIST,0);
	element.editor.focus();
}

function indentPlus() {
	element.editor.ExecCommand(DECMD_INDENT,0);
	element.editor.focus();
}

function indentMinus() {
	element.editor.ExecCommand(DECMD_OUTDENT,0);
	element.editor.focus();
}

function hyperlink() {
	element.editor.ExecCommand(DECMD_HYPERLINK,0);
	element.editor.focus();
}

function copyChar() {
	element.editor.ExecCommand(DECMD_COPY,0);
	element.editor.focus();
}

function pasteChar() {
	element.editor.ExecCommand(DECMD_PASTE,0);
	element.editor.focus();
}



/* ********************** */
/* ***** TOC EDITOR ***** */

function tocinsertChar() {
	if(document.toceditor.tocspecChars.value!='0'){
		alert('1');
		// TRANSFER VALUE
		document.toceditor.tocspectag.value = document.toceditor.tocspecChars.value;

		// HANDLE AND COPY TEXT TO CLIPBOARD
		var tempval = document.toceditor.tocspectag;
		therange = tempval.createTextRange()
		therange.execCommand("Copy")

		tocpasteChar()
	}
}

function tocsubScript() {
	// COPY SELECTED TEXT TO CLIPBOARD
	toccopyChar()

	//HANDLE TEXT
	copiedText = window.clipboardData.getData("Text");
	document.toceditor.tocspectag.value = '<sub>' + copiedText + '</sub>';

	if (document.toceditor.tocspectag.value) {
		// HANDLE AND PASTE TEXT TO CLIPBOARD
		var tempval = document.toceditor.tocspectag;
		therange = tempval.createTextRange();
		therange.execCommand("Copy")
		tocpasteChar()
	}
}

function tocsuperScript() {
	// COPY SELECTED TEXT TO CLIPBOARD
	toccopyChar()

	//HANDLE TEXT
	copiedText = window.clipboardData.getData("Text");
	document.toceditor.tocspectag.value = '<sup>' + copiedText + '</sup>';

	if (document.toceditor.tocspectag.value) {
		// HANDLE AND PASTE TEXT TO CLIPBOARD
		var tempval = document.toceditor.tocspectag;
		therange = tempval.createTextRange();
		therange.execCommand("Copy")
		tocpasteChar()
	}
}

function tocinternalLinks(linkspecs) {
	// COPY SELECTED TEXT TO CLIPBOARD
	copyChar()

	//HANDLE TEXT
	copiedText = window.clipboardData.getData("Text");
	document.toceditor.tocspectag.value = '<a href=\"' + linkspecs + '\">' + copiedText + '</a>';

	if (document.toceditor.tocspectag.value) {
		// HANDLE AND PASTE TEXT TO CLIPBOARD
		var tempval = document.element.tocspectag;
		therange = tempval.createTextRange();
		therange.execCommand("Copy")
		tocpasteChar()
	}
}

function tocremoveFormat() {
	toceditor.toc.ExecCommand(DECMD_REMOVEFORMAT,0);
	toceditor.toc.focus();
}

function tocbold() {
	toceditor.toc.ExecCommand(DECMD_BOLD,0);
	toceditor.toc.focus();
}

function tocitalic() {
	toceditor.toc.ExecCommand(DECMD_ITALIC,0);
	toceditor.toc.focus();
}

function tocunderline() {
	toceditor.toc.ExecCommand(DECMD_UNDERLINE,0);
	toceditor.toc.focus();
}

function tocoList() {
	toceditor.toc.ExecCommand(DECMD_ORDERLIST,0);
	toceditor.toc.focus();
}

function tocuList() {
	toceditor.toc.ExecCommand(DECMD_UNORDERLIST,0);
	toceditor.toc.focus();
}

function tocindentPlus() {
	toceditor.toc.ExecCommand(DECMD_INDENT,0);
	toceditor.toc.focus();
}

function tocindentMinus() {
	toceditor.toc.ExecCommand(DECMD_OUTDENT,0);
	toceditor.toc.focus();
}

function tochyperlink() {
	toceditor.toc.ExecCommand(DECMD_HYPERLINK,0);
	toceditor.toc.focus();
}

function toccopyChar() {
	toceditor.toc.ExecCommand(DECMD_COPY,0);
	toceditor.toc.focus();
}

function tocpasteChar() {
	toceditor.toc.ExecCommand(DECMD_PASTE,0);
	toceditor.toc.focus();
}
/* ***** TOC EDITOR ***** */
/* ********************** */

//-->