///////////////////////////////////////////////////////////////////////
//                                                                   //
//     JavaScripts Global Function used on every Page			     //
//                                                                   //
///////////////////////////////////////////////////////////////////////

// Global Constants
	var bCompatile = true;		// Compatible with Javascript 1.1
	var nChoice;			
					
function StatusMsg(msgStr) {
// To show the msgStr in the Status Bar
		
		status = msgStr;
		document.returnValue = true;
		//status = "Applying The Web To Your Business"
}

function Conf_Del(sText) {
// To check whether the user realy wants to delete the corresponding item
		if (confirm("Are you sure you want to " +  sText + "?")) {
			return true;
			
		}	
		else {
			return false;
		}
}

function SetFocus(frmName,fldName) {		
// To set the Cursor on the specified field Name
		document.forms(frmName).item(fldName).focus();
}


function PopUp(sURl, sName, sFeatures) {
// To open a new window

		var newBrowser;

		newBrowser = window.open(sURl, sName, sFeatures);
		newBrowser.focus();		
}

function JumpToPage() {
		var sURl = document.JumpPage.PageNumber;
		window.location.href = sURl.options[sURl.selectedIndex].value;			
}

function showLayer(layerName) {
	hideLayers();
	document.all['dropdown_nav_' + layerName + '_div'].style.visibility = "visible";
}

function hideLayer(layerName) {
	document.all['dropdown_nav_' + layerName + '_div'].style.visibility = "hidden";
}

function hideLayers() {
	var oDivs = document.all.tags("div")
	var sDiv;
	
	for ( iDiv = 0; iDiv < oDivs.length; iDiv++) {
		sDiv = new String(oDivs.item(iDiv).id);
		if (sDiv.substring(0,13) == "dropdown_nav_") 
			document.all[sDiv].style.visibility = "hidden";
	}	
}

function switchOn(rowName) {
	document.all.item('dropdown_nav_' + rowName + '_row').style.backgroundColor = "#000000";
}

function switchOff(rowName) {
	document.all.item('dropdown_nav_' + rowName + '_row').style.backgroundColor = "#999999";
}

function showspnspic(nWidth, nHeight, sURl) {	
	PopUp(sURl, "Sponsorship", 
		"WIDTH=" + nWidth + ",HEIGHT=" + nHeight + ",screenX=100,left=100,screenY=50,top=50,ScrollBars=Yes,Resizable=Yes");
}

function viewProfile(sURl) {	
	PopUp(sURl, "vfProfile", "WIDTH=450,HEIGHT=350,screenX=200,left=200,screenY=250,top=200,ScrollBars=No,Resizable=no")
}

function sendmemberemail(sURl, nOffice, nPerson) {	
	window.opener.location = sURl;
	window.close();
}

function viewphoto(sURl) {	
	PopUp(sURl, "Articles", "WIDTH=450,HEIGHT=300,screenX=400,left=400,screenY=250,top=200,ScrollBars=No,Resizable=yes");
}

function uploaddocs(sURl) {
	PopUp(sURl, "Upload", "WIDTH=450,HEIGHT=300,screenX=400,left=400,screenY=250,top=200,ScrollBars=No,Resizable=yes");
}


/* For images */
function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		html_over_en = newImage("/images/en/html_r.gif");
		flash_over_en = newImage("/images/en/flash_r.gif");
		html_over_fr = newImage("/images/fr/html_r.gif");
		flash_over_fr = newImage("/images/fr/flash_r.gif");
		html_over_sp = newImage("/images/sp/html_r.gif");
		flash_over_sp = newImage("/images/sp/flash_r.gif");
		preloadFlag = true;
	}
}