// SCRIPTS 

var intervalTime = 0;
var notextalert = "Query is empty !";

// Change 2 graphics
function chGraphics (source, image) {
         // alert(source + "\n" + image);
	   if (navigator.appName == "Microsoft Internet Explorer") {
		 window.event.srcElement.src = image;
	   }
}

// SetFocus() [Source @ msn.com]
// Given an element, it will set the focus
function setFocus (objMT) {
	   objMT.focus();  //document.forms[0].query.focus(); 
}

// Checkquery [Source @ msn.com]
// Determines whether form has proper submission criterion
// RETURNS: false if no value given for query param
function checkMT (objMT, strID, qform) {
	// var cfg = qform.cfg.value;
	if (strID == "") {
		window.alert(notextalert);
		SetFocus(objMT);
		return false;
	} else {
        return true;
	}
}



/* R E S U M E :
** Hide/Show Objects : showSummaryNewsSection() & setIntervalDelay  [Sources @ aljazeera.net]
** 
*/

// Function to show the summary of the news section titles
function showSummaryNewsSection (itemNo, on) {
	var itemObj;
	var linkObj;
	itemObj = "resume" + itemNo;
	linkObj = "title" + itemNo;
	if (on) {
			document.all.item(linkObj).style.display = "none";
			document.all.item(itemObj).style.display = "";
			/*if (intervalTime != 0) window.clearInterval(intervalTime); */
	} else {
			document.all.item(linkObj).style.display = "";
			document.all.item(itemObj).style.display = "none";
			if (intervalTime != 0) window.clearInterval(intervalTime);
	}	

}
// Function to call showSummaryNewsSection() after 1000 milliseconds on mouse over.
function setIntervalDelay (itemNo, on) {
	if (on) intervalTime = window.setInterval("showSummaryNewsSection(" + itemNo + "," + on +")",1000);
	else showSummaryNewsSection(itemNo,on);
}



/* M E N U :
** Hide/Show Menu Topics : showTopicElements()
** 
*/

// Function to show the topic's elements
function showTopicElements (itemNo , on) {
	 var itemObj;
	 var itemOffObj;
	 var itemOnObj;
	 itemObj = "toc" + itemNo;
	 itemOffObj = "0i" + itemNo;
	 itemOnObj = "1i" + itemNo;
	 if (on) {
			document.all.item(itemOffObj).style.display = "none";
			document.all.item(itemOnObj).style.display = "";
			document.all.item(itemObj).style.display = "";
	 } else {
			document.all.item(itemOffObj).style.display = "";
			document.all.item(itemOnObj).style.display = "none";
			document.all.item(itemObj).style.display = "none";
	 }
}
