
function ShowSubMenu(DivId)
		{
			document.getElementById(DivId).style.display = "";
			document.getElementById("td"+DivId).className = "MenuBG";
		}
function HideSubMenu(DivId)
		{
			document.getElementById(DivId).style.display = "none";
			document.getElementById("td"+DivId).className = "menuFont";
		}
		
function OverTdSub(DivId)
		{
			document.getElementById("tdSub"+DivId).className = "MenuBG";
		}
function OutTdSub(DivId)
		{
			document.getElementById("tdSub"+DivId).className = "menuFont";
		}
		

if(docDate == null)
	var docDate = "";

if(id == null)
	var id = "";

var i=0;

// Mohammed Al-Tobji @ 29-07-2002
var home_temp_type		= "44"	; //as default
var home_template_id	= "-1"	;
var sys_lang			= "1"	; // english as default
var sys_cu_no			= "1"	; // as default
// Mohammed AL-Tobji @19-09-2002
var style_id			= "2"	; // as default

if(document.all.item("styleId"))
	if(document.all.item("styleId").length)
			style_id	=	(document.all.item("styleId"))[0].value	;
		else
			style_id		= document.all.item("styleId").value	;	


if(document.all.item("home_page"))
	if(document.all.item("home_page").length)
	{
		home_temp_type		= (document.all.item("home_page"))[0].temp_type	;
		home_template_id	= (document.all.item("home_page"))[0].value		;	
	}
	else
	{
		 home_temp_type		= document.all.item("home_page").temp_type	;
		 home_template_id	= document.all.item("home_page").value		;	
	}

if(document.all.item("lang"))	
	if(document.all.item("cu_no").length)
		sys_lang	=	(document.all.item("lang"))[0].value		;
	else
		sys_lang	=	document.all.item("lang").value		;

if(document.all.item("cu_no"))
	if(document.all.item("cu_no").length)
	{
		sys_cu_no	=	(document.all.item("cu_no"))[0].value	;		
	}
	else
		sys_cu_no	=	document.all.item("cu_no").value	;

var home_page = "/site/topics/index.asp?cu_no=" + sys_cu_no + "&temp_type=" + home_temp_type  +"&template_id=" + home_template_id + "&lng=" + sys_lang ;

var logo_path  = "" ;
if(document.all.logoPath)
	if(document.all.logoPath.length)
		logo_path = (document.all.item("logoPath"))[0].value ;
	else
		logo_path = document.all.logoPath.value ;		

// end of Mohammed Al-Tobji

function veiwDetail(detailId)
{
	//Header = detailId+'H';
	Icon = detailId+'I';
	if (document.all[detailId].className == "")
	{
		document.all[detailId].className = "hide";
		//document.all[Header].className = "category";
		document.all[Icon].src="/site/images/iconNEW.JPG";
	}
	else
	{
		document.all[detailId].className = "";
		document.all[Icon].src='/site/images/M-icon.JPG';
	}
	
}

////////////////////////////////////////////////////////
// trim is similar to the Trim fucntion in VBScript   //
//   it uses ltrim(left trim), to eliminate the left  //
//   side spaces, and rtrim(right trim),to eliminate  //
//   the right side spaces.                           //
// Parameters:                                        //
//	IN - strParam : the text input					  //                        
////////////////////////////////////////////////////////

function Trim(strParam)
{
	strParam = LTrim(strParam) ;
	strParam = RTrim(strParam) ;
	return strParam ;
}
// Eliminate all Left Spaces	////////////
function LTrim(strParam)
{
	var c;
	for(var i = 0 ; i < strParam.length ; i++)
	{
		c = strParam.charAt(i) ;
		if( c != " ")
			break ;
	}
	strParam = strParam.substring(i,strParam.length)	 ;
	return strParam ;
}
// Eliminate all Right Spaces	/////////////
function RTrim(strParam)
{	
	var c ;
	for(var i = strParam.length-1 ; i>0 ; i--)
	{
		c = strParam.charAt(i) ;
		if( c != " " )
			break ;
	}
	if(i != strParam.length-1)
		strParam = strParam.substring(0,i+1) ;
	
	return strParam ;
}
/////////////////////////////////////////


function submitSearch()
{
	//alert(document.all.searchText.value);
	var cu_no = "2" ;
	if( document.all.cu_no )
	{
		cu_no = document.getElementById("cu_no").value ; 
	}

	if( document.getElementById("searchText") != null  )
	{
		document.getElementById("searchText").value = Trim(document.getElementById("searchText").value) ;
		
		//alert(window.document.readyState)
		
		
				
			if( document.getElementById("searchText").value == "Search" || document.getElementById("searchText").value == "")
			{
				alert('You must enter search data');
				//alert( unescape("%u0627%u0644%u0631%u062C%u0627%u0621%20%u0625%u062F%u062E%u0627%u0644%20%u0643%u0644%u0645%u0629%20%u0648%u0627%u062D%u062F%u0629%20%u0639%u0644%u0649%20%u0627%u0644%u0623%u0642%u0644")) ;
				document.getElementById("searchText").focus() ;

			}
			else
			{
				var  hrefVal ;
				hrefVal = "/site/topics/AdvSearchResult.asp?cu_no="+ cu_no +"&text=" + escape(document.getElementById("searchText").value) ;
				window.location.href= hrefVal ;
			}
		
	}
	

}

//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
/////					Send Article By Email					//////////////
/////			By Mohammed Al-Tobji @12-08-2002				//////////////		
//////////////////////////////////////////////////////////////////////////////
var SendEmailWindow = null  ;
function SendByEmail()
{
	
	if(SendEmailWindow != null) // if SendEmail was already opened
	{
		SendEmailWindow.focus() ;
		return ;
	}
	// open SendEmail window	
	SendEmailWindow = window.open('/site/Stream/sendByEmail.htm','','width=402; height=360; scrollbars=0');
}

function AddToBookmarks (url,title) 
{
window.external.AddFavorite(url,title); 
}

	/********************************************************************************************/
	/* Mohammad Abdullah : refresh pages that have flash on publish site to active flash script */
	/* hrefHome for URL site of indexpage , hrefSection for URL site of section and cover pages */
	/* we used split URL of the page to determine the page if it in Publish site or online site */
	/********************************************************************************************/
	
	var hrefHome = window.location.href;
	var hrefSection = window.location.href;
	
	hrefHome = hrefHome.split("&");
	
	hrefSection = hrefSection.split("/");
	hrefSection = hrefSection[5].split("?")
	
	
	/*if(hrefHome[2] == "form_id=2" || hrefHome[5] == "form_id=2" || hrefSection[0] == "ProducerCore.asp")
	{
		var c=window.document.getElementById("flashscript");
	
		if(!c.AC_FL_RunContent)
		{
		window.location.reload(true);
		}
	}
	*/
	
	/*********************************************************************************/

function keyshit(evt)
	{
	
		if (navigator.userAgent.indexOf("Firefox")!=-1)
		{
			//debugger;
			var nbr;  
			var nbr = (window.event)?event.keyCode:evt.which;  
	
			if (nbr == 13)
				submitSearch();
	
			//alert(nbr);  
			return true;	
		}

	}

