// ***********  JavaScript 		  ***********************
// ***********  Some of my own... ***********************

//Globals
var currentCatalog = '';
var lastCatalog = '';

// end Globals

function waitMyCursor() {
	document.body.style.cursor = "wait";
	setTimeout("clearMyCursor()",2500);
}

function clearMyCursor() {
	document.body.style.cursor = "default";
}


function pointerMyCursor(objID) {
	$(objID).style.cursor='pointer';
}

function defaultMyCursor(objID) {
	$(objID).style.cursor='default';
}

function insertCodeFragment(ContainerToUpdate,theFileVars) {
	//waitMyCursor();
	new Ajax.Updater(ContainerToUpdate,theFileVars, {asynchronous:true});return false;
}


function iCF2(divToUpdate,theFileVars) {
	//alert(theFileVars);
	new Ajax.Updater (
		divToUpdate
		,theFileVars, 
			{
				asynchronous:true
				,evalScripts: true
			});
	return false;
}

// *************   Visibility / Display functions ******************************


function toggleVisibility_II(me){
		if ($(me).style.visibility=="hidden"){
			$(me).style.visibility="visible";
			}
		else {
			$(me).style.visibility="hidden";
			}
		}

function toggleDisplay_II(me){
		if ($(me).style.display=="none"){
			$(me).style.display="block";
			}
		else {
			$(me).style.display="none";
			}
		}


function toggleDiv( element ) {
    var e = $(element);
    if (e) {
        e.style.display = ((e.style.display != 'block') ? 'block' : 'none');
    }
}

function toggleDivON( element ) {
    var e = $(element);

    if (e) {
        e.style.display = ((e.style.display != 'block') ? 'block' : 'block');
        //$('div_upper_right').innerHTML = _description[e.id]();
    }
}

// ************  END Visibility / Display functions ******************************

//*************  10SecSurvey *******
function submitForm(theform) {
	var daForm = $(theform);
	var pars = Form.serialize(daForm);
	var url = '_AnswerPosted.asp';
	var myAjax = new Ajax.Request(
			url, 
			{
				 method: 'post' 
				,parameters: pars
				,onFailure: function(req){alert('Save Failure: '+req.statusText);}
				,onSuccess:function(req){ insertCodeFragment("10SecSurvey_div","10SecSurvey_base.asp"); }
			});
	
	
}


function submitRFCForm(theform) {
	var daForm = $(theform);
	var pars = Form.serialize(daForm);
	var url = 'RFC_process.asp';
	var myAjax = new Ajax.Request(
			url, 
			{
				 method: 'post' 
				,parameters: pars
				,onFailure: function(req){alert('Save Failure: '+req.statusText);}
				,onSuccess:function(req){ insertCodeFragment("RFC_div","RFC_base.asp"); }
			});
	
	
}


