<!--

// whitespace characters
var whitespace = " \t\n\r";


function submitForm(i) {
	document.forms[i].submit();
}


// submit form1
function submitForm1(btnSubmit) {
	btnSubmit.disabled=true;
	form1.submit();
}


function submitForm2(btnSubmit,strURL) {
	btnSubmit.disabled=true;
	btnSubmit.form.action=strURL;
	btnSubmit.form.submit();
}


function submitForm3(strURL) {
	document.forms[0].action=strURL;
	document.forms[0].submit();
}

function getHelp() {
	var x = window.open("../training/help.php#registerTrainingTop","helpWin");
}


function selectDropDown(oSelect,strValue) {
	for (i=0;i<oSelect.options.length;i++) {
		if (oSelect.options[i].text == strValue) {
			oSelect.selectedIndex = i;
			break;
		}
	}
}


function refreshMainFrame(strURL) {
//	parent.parent.frames("mainFrame").location.href = strURL;
	parent.frames("mainFrame").location.href = strURL;
}


function sure(tid) {
	if (confirm("Training details including all registrations will be deleted.\n\nDo you want to continue ?")) {
		document.location.href="delete_training.php?tid=" + tid;
	}
}

function sure2(rid) {
	if (confirm("Training registration will be deleted.\n\nDo you want to continue ?")) {
		document.location.href="delete_trainingRegistration.php?rid=" + rid;
	}
}

function sure3(tid) {
	if (confirm("Deleting the trainer will also delete all published training by this trainer.\n\nAre you absolutely sure you want to continue ?")) {
		document.location.href="delete_trainer.php?tid=" + tid;
	}
}

function sure4(nid) {
	if (confirm("Are you sure you want to delete this ?")) {
		document.location.href="delete_newsletter.php?nid=" + nid;
	}
}


function sureSpecialOccasion(nid) {
	if (confirm("Are you sure you want to delete this special occasion entry?")) {
		document.location.href="delete_newsletter_so.php?nid=" + nid;
	}
}

function sure5(pid) {
	if (confirm("Are you sure you want to delete this practitioner?")) {
		document.location.href="delete_partitioner.php?pid=" + pid;
	}
}

function sure6(cid) {
	if (confirm("Congres details will be deleted.\n\nDo you want to continue ?")) {
		document.location.href="delete_congres.php?cid=" + cid;
	}
}

function sure7(crid) {
	if (confirm("Congres Registration details will be deleted.\n\nDo you want to continue ?")) {
		document.location.href="delete_congresRegistration.php?crid=" + crid;
	}
}

function sureLibraryDelete(libraryID) {
	if (confirm("Library item will be deleted.\n\nDo you want to continue ?")) {
		document.location.href="delete_library.php?libraryID=" + libraryID;
	}
}

function custom_print() {
    if (document.all) {
        if (navigator.appVersion.indexOf("5.0") == -1) {
            var OLECMDID_PRINT = 6;
            var OLECMDEXECOPT_DONTPROMPTUSER = 2;
            var OLECMDEXECOPT_PROMPTUSER = 1;
            var WebBrowser = "<OBJECT ID=\"WebBrowser1\" WIDTH=0 HEIGHT=0 CLASSID=\"CLSID:8856F961-340A-11D0-A96B-00C04FD705A2\"></OBJECT>";
            document.body.insertAdjacentHTML("beforeEnd", WebBrowser);
            WebBrowser1.ExecWB(6, 2);
            WebBrowser1.outerHTML = "";
        } else {
            self.print();
        }
    } else {
        self.print();
    }
    return false;
}


// IE & NS !!!!!
function changeContent(el,text) {
	var newDiv = document.createElement("span");
	newDiv.id = el;
	var newText = document.createTextNode(text);
	newDiv.appendChild(newText);
	var oldEl = document.getElementById(el);
	var par = oldEl.parentNode;
	var replaced = par.replaceChild(newDiv,oldEl);
}


function isEmpty(el)	{
	var i;
	var s = el.value;
	if (isEmptyString(s)) {
		alert("Deze veld kan niet leeg zijn!");
		el.focus();
		return true;
	}
    for (i = 0; i < s.length; i++)    {
		var c = s.charAt(i);
        if (whitespace.indexOf(c) == -1) return false;
    }
	alert("Deze veld kan niet leeg zijn!");
	el.focus();
    return true;
}

function isEmptyString(s) {
	return ((s == null) || (s.length == 0))
}


// PayPal renames our frame into superDaddy
// rename it back to original value
function renameFrame(strFrameName) {
	window.name=strFrameName;
}

// works in IE and NETSCAPE
function copyOption(sourceList,targetList)	{
	var si = sourceList.selectedIndex;
	if (si >= 0)	{
		var oOption = new Option(sourceList.options[si].text, sourceList.options[si].value);
		//targetList.options.add(oOption);
		targetList.options[targetList.options.length] = oOption;
		sourceList.options[si] = null;
	}
	return;
}

// works in IE and NETSCAPE
function copyOptionAll(sourceList,targetList)	{
	while(sourceList.options.length>0) {
		// get first option and delete it from source list
		var oOption = new Option(sourceList.options[0].text, sourceList.options[0].value);
//		targetList.options.add(oOption);
		targetList.options[targetList.options.length] = oOption;
		sourceList.options[0] = null;
	}
	return;
}


// works in IE and NETSCAPE
function copyOptionNL(sourceList,targetList)	{
	j=sourceList.options.length;
	for(i=0;i<j;i++) {
		// get first option and delete it from source list
		alert(i);
		alert(j);
		if (sourceList.options[i].text.substr(sourceList.options[i].text.length-3,3) == "(N)") {
			var oOption = new Option(sourceList.options[i].text, sourceList.options[i].value);
			targetList.options[targetList.options.length] = oOption;
			sourceList.options[i] = null;
			j=sourceList.options.length-1;
		}
	}
	return;
}


function replaceSpan(){

    var newSpan = document.createElement("span");
    var newText = document.createTextNode("on top of the astounded zebra");
    newSpan.appendChild(newText);

    var para = document.getElementById("example3");
    var spanElm = document.getElementById("ex3Span");
    var replaced = para.replaceChild(newSpan,spanElm);
}


//-->




