
	function MM_preloadImages() { //v3.0
	  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}
	
	function MM_swapImgRestore() { //v3.0
	  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}
	
	function MM_findObj(n, d) { //v4.01
	  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	  if(!x && d.getElementById) x=d.getElementById(n); return x;
	}
	
	function MM_swapImage() { //v3.0
	  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}
	
	

	/*
                 Initialize and render the Menu when its elements are ready 
                 to be scripted.
            */
            
    YAHOO.util.Event.onContentReady("productsandservices", function () {            
                /*
                     Instantiate a Menu:  The first argument passed to the 
                     constructor is the id of the element in the page 
                     representing the Menu; the second is an object literal 
                     of configuration properties.
                */
				var oMenu = new YAHOO.widget.Menu("productsandservices", { 
                                                      position: "static", 
													  showdelay: 0,
                                                        hidedelay:  150, 
                                                        lazyload: true });
                /*
                     Call the "render" method with no arguments since the 
                     markup for this Menu instance is already exists in the page.
                */
            
                oMenu.render();            
            	//changeImages();
    });
	
function retrieveData(menu_no, page_id){
	$.get('content.php?page_id=' + page_id
		  , function(data) {
	  $("#content").html(data);
	  $("#banner_2").hide();
//	  location.href=location.protocol+"//"+location.host
		//location.pathname="ccccccccc.htm"
	 });
}

function retrieveSubject(subj_id){
	var frm = document.getElementById("formQuestion");
	$.get('ajaxUtil.php?method=retrieve_subject&subj_id=' + subj_id
		  , function(data) {
	  	$("#subj_info").html(data.subj_desc);
		$("#questionContent").html("");
		frm = document.getElementById("formQuestion"); 
		frm.subj_id.value=subj_id;
	 });
}

function retrieveQuestion(q_id){
	$.get('ajaxUtil.php?method=retrieve_question&q_id=' + q_id
		  , function(data) {
	  	$("#subj_info").html(data.subj_desc);
	 });
}


function stopRKey(evt) {
	  var evt = (evt) ? evt : ((event) ? event : null);
	  var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
	  if ((evt.keyCode == 13) && (node.type=="text"))  {return false;}
	}

	//document.onkeypress = stopRKey;
	
function in_array(ar, target){
	for(var i = 0; i<ar.length;i++){
		if (ar[i]==target){
			return true;
		}
	}
	return false;
}

function submitQuestion(){
	var f = document.getElementById("formQuestion");
	var act = document.getElementById("action");
	act.value = "submitQuestion";
	//f.method="get"
	f.submit();
}

function swapImg(imgTag, imgFile){
	imgTag.src = imgFile;
}
/*var swap_imgs= new Array();
<{foreach $img_files as $imf}>
	swap_imgs[<{$imf@index}>]="<{$imf}>";
<{/foreach}>

var currImgIdx=0;
function changeImages(){
	if (currImgIdx>swap_imgs.length-1) {
		currImgIdx=0;	
	}
	var img = document.getElementById("banner1");
	img.height=190;
	img.src=swap_imgs[currImgIdx];
	
	currImgIdx++;
	setTimeout("changeImages()",3000);
}*/
