// ***********  JavaScript 		  ***********************
// ***********  Some of my own... ***********************

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';
}

insertCodeFragment= function(ContainerToUpdate,theFileVars) {
	//waitMyCursor();
	new Ajax.Updater(ContainerToUpdate,theFileVars, {asynchronous:true});return false;
};

iCF2=function(divToUpdate,theFileVars){
	new Ajax.Updater (divToUpdate, theFileVars, {
			asynchronous: true
			,evalScripts: true
		});
	return false;
};

iCF3=function (divToUpdate,theFileVars,placeWhere) {
	switch(String(placeWhere)){
	
	case 'After':
	new Ajax.Updater (divToUpdate, theFileVars, {
			asynchronous: true
			,evalScripts: true
			,insertion: Insertion.After 
		});
	return false;
	break
	
	case 'Before':
	new Ajax.Updater (divToUpdate, theFileVars, {
			asynchronous: true
			,evalScripts: true
			,insertion: Insertion.Before 
		});
	return false;
	break
	
	case 'Bottom':
	new Ajax.Updater (divToUpdate, theFileVars, {
			asynchronous: true
			,evalScripts: true
			,insertion: Insertion.Bottom 
		});
	return false;
	break
	
	case 'Top':
	new Ajax.Updater (divToUpdate, theFileVars, {
			asynchronous: true
			,evalScripts: true
			,insertion: Insertion.Top 
		});
	return false;
	break
	
	default:
	new Ajax.Updater (divToUpdate, theFileVars, {
			asynchronous: true
			,evalScripts: true
		});
	return false;
	}// end of switch

};


// *************   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');
    }
}

function toggleDivOFF( element ) {
    var e = $(element);

    if (e) {
        e.style.display = ((e.style.display != 'block') ? 'block' : 'none');
    }
}

// ************  END Visibility / Display functions ******************************


