function setPaging(form, startValue, moduleInstanceId) {    form.start.value = startValue;    updateModuleSettings(form, moduleInstanceId);}function updateModuleSettings(form, moduleInstanceId) {	var errorText="something went wrong";	var loadingDiv = $('divModuleInstanceLoading_' + moduleInstanceId);	var divToUpdate = $('divModuleInstance_' + moduleInstanceId);	if (loadingDiv) {		loadingDiv.style.display = "block";	}    gatherAjax.Request({ url: form.action, options: {        asynchronous: false,        method: 'POST',        parameters: form.serialize(true),      onSuccess: function(transport) {        //update the div with the new value    	if (divToUpdate) {    		divToUpdate.innerHTML = transport.responseText;    	}      },      onError: function(transport){            alert("error!");            if (divToUpdate) {        		divToUpdate.innerHTML = errorText;        	}      },      onException: function(request, e) {            alert(e.message);            if (divToUpdate) {        		divToUpdate.innerHTML = errorText;        	}      }    }    });    updateCufonHeaders(false);}function updateModuleSettingsExternal(form, moduleInstanceId) {	var errorText="something went wrong";	var loadingDiv = parent.document.getElementById('divModuleInstanceLoading_' + moduleInstanceId);	var divToUpdate = parent.document.getElementById('divModuleInstance_' + moduleInstanceId);	if (loadingDiv) {		loadingDiv.style.display = "block";	}      gatherAjax.Request({ url: form.action, options: {        asynchronous: false,        method: 'POST',        parameters: form.serialize(true),      onSuccess: function(transport) {        //update the div with the new value    	if (divToUpdate) {    		divToUpdate.innerHTML = transport.responseText;    	}      },      onComplete: function(transport){            if (divToUpdate) {                divToUpdate.innerHTML = transport.responseText;            }      },      onError: function(transport){            alert("error!");            if (divToUpdate) {        		divToUpdate.innerHTML = errorText;        	}      },      onException: function(request, e) {            alert(e.message);            if (divToUpdate) {        		divToUpdate.innerHTML = errorText;        	}      }    }    });    updateCufonHeaders(true);    parent.myLightWindow.deactivate();}function updateModuleReloadPage(form, reloadUrl) {	var errorText="something went wrong";	gatherAjax.Request({ url: form.action, options: {        asynchronous: false,        method: 'POST',        parameters: form.serialize(true),      onSuccess: function(transport) {		parent.location.href = reloadUrl;      },      onComplete: function(transport){  		parent.location.href = reloadUrl;      },      onError: function(transport){    	alert("error!");      },      onException: function(request, e) {        alert(e.message);      }    }    });    updateCufonHeaders(false);}function refreshModule(moduleAction, moduleInstanceId) {	var errorText="something went wrong";	var loadingDiv = parent.document.getElementById('divModuleInstanceLoading_' + moduleInstanceId);	var divToUpdate = parent.document.getElementById('divModuleInstance_' + moduleInstanceId);	if (loadingDiv) {		loadingDiv.style.display = "block";	}      gatherAjax.Request({ url: moduleAction, options: {        asynchronous: false,        method: 'GET',      onSuccess: function(transport) {        //update the div with the new value    	if (transport.responseText && transport.responseText.indexOf('<script') >= 0) {    		window.location.href=window.location.href;    	} else {    		if (divToUpdate) {    			divToUpdate.innerHTML = transport.responseText;    		}    	}      },      onComplete: function(transport){      	if (transport.responseText && transport.responseText.indexOf('<script') >= 0) {      		window.location.href=window.location.href;    	} else {    		if (divToUpdate) {    			divToUpdate.innerHTML = transport.responseText;    		}    	}      },      onError: function(transport){            alert("error!");            if (divToUpdate) {        		divToUpdate.innerHTML = errorText;        	}      },      onException: function(request, e) {            alert(e.message);            if (divToUpdate) {        		divToUpdate.innerHTML = errorText;        	}      }    }    });    updateCufonHeaders(false);}function toggleModuleVisibility(toggleAction, moduleAction, moduleInstanceId) {	var errorText="something went wrong";	var loadingDiv = $('divModuleInstanceLoading_' + moduleInstanceId);	var divToUpdate = $('divModuleInstance_' + moduleInstanceId);	if (loadingDiv) {		loadingDiv.style.display = "block";	}    var lock = false;    document.body.style.cursor = "wait";    while (lock) { /* wait for lock to be released */ }    lock = true;    gatherAjax.Request({ url: toggleAction,                         options: {                           asynchronous: false,                           method: 'get',                           parameters: {moduleInstanceId: moduleInstanceId},                           onSuccess: function(transport) {                             lock = false;                             document.body.style.cursor = "auto";                             refreshModule(moduleAction, moduleInstanceId);                           },                           onException: function(request, e) {                             lock = false;                             alert(e.message);                             document.body.style.cursor = "auto";                           }                         }});}//Show/Hide contaners per toggle click and optionally hide a loading icon or some-such elementfunction settingsUpDownSlide(toggleElm,hideElm) {  var sr = $(toggleElm);  if(typeof hideElm != 'undefined') $(hideElm).hide();  if(typeof Effect == 'undefined') {    if(sr.visible()){ sr.hide(); } else { sr.show(); }  } else {    if(sr.visible()){      //new Effect.Fade(sr, {duration : 1 });      Effect.SlideUp(sr, {duration:1, queue:'end'});    } else {      //new Effect.Appear(sr, {duration : 1 });      Effect.SlideDown(sr, {duration:1, queue:'end'});    }  }};function updateCufonHeaders(useParent) {    try {        if (useParent) {            parent.Cufon.replace('.moduleTitle, .moduleTitle_inactive, .moduleTitle_skinny, .moduleTitle_inactive_skinny');            parent.Cufon.now();        } else {            Cufon.replace('.moduleTitle, .moduleTitle_inactive, .moduleTitle_skinny, .moduleTitle_inactive_skinny');            Cufon.now();        }    } catch (e) {}}