function loadGeneral(){
	return ; 
}

function raiseSubMenu(pItem,pX,pY){

	hideSubMenus();
	
	var sItemID = pItem.id ;

	var sSubItemId = 'sub_' + sItemID ;

	var submenu = document.getElementById(sSubItemId) ;

	if(document.all){
		submenu.filters[0].apply() ;
		submenu.style.left = pX ; 
		submenu.style.top = pY ;
		//submenu.innerText = window.event.x + ',' + window.event.y ;
	} else {

		submenu.style.left = pX + 'px' ;
		submenu.style.top = pY + 'px' ;
	}


	if(document.all){
		submenu.filters[0].apply() ;
		submenu.style.visibility = 'visible' ;
		submenu.filters.revealTrans.transition=5 ;
		submenu.filters.revealTrans.duration=0.25 ;
		submenu.filters[0].play() ;
	} else {
		submenu.style.visibility = 'visible' ;
	}
	
	sExemptItemId = sSubItemId ;

}

function raiseSubSubMenu(p_sgid,pX,pY){

	//THIS method displays the div and calls AJAX

	var subsubmenu = document.getElementById('sub_sub_products') ;
	
	//subsubmenu.innerHTML = '' ; 
	
	ajaxReset();
	
	ajaxSend(p_sgid) ;

	if(document.all){
		subsubmenu.filters[0].apply() ;
		subsubmenu.style.left = pX ; 
		subsubmenu.style.top = pY ;
		//subsubmenu.innerText = window.event.x + ',' + window.event.y ;
	} else {

		subsubmenu.style.left = pX + 'px' ;
		subsubmenu.style.top = pY + 'px' ;
	}


	if(document.all){
		subsubmenu.filters[0].apply() ;
		subsubmenu.style.visibility = 'visible' ;
		subsubmenu.filters.revealTrans.transition=5 ;
		subsubmenu.filters.revealTrans.duration=0.25 ;
		subsubmenu.filters[0].play() ;
	} else {
		subsubmenu.style.visibility = 'visible' ;
	}
	
	sExemptItemId = 'sub_sub_products' ;

}

function hideSubMenus(){

	//top	
	document.getElementById('sub_thecompany').style.visibility = 'hidden' ;
	document.getElementById('sub_organic').style.visibility = 'hidden' ;
	//left
	document.getElementById('sub_soybeaninoculants').style.visibility = 'hidden' ;
	document.getElementById('sub_corninoculants').style.visibility = 'hidden' ;
	document.getElementById('sub_wheatinoculants').style.visibility = 'hidden' ;
	document.getElementById('sub_specialty').style.visibility = 'hidden' ;
	document.getElementById('sub_peanuts').style.visibility = 'hidden' ;
	document.getElementById('sub_foragecrops').style.visibility = 'hidden' ;
	document.getElementById('sub_pulsecrops').style.visibility = 'hidden' ;
	document.getElementById('sub_wateradjuvants').style.visibility = 'hidden' ;
	document.getElementById('sub_yielddata').style.visibility = 'hidden' ;
	
	document.getElementById('sub_sub_products').style.visibility = 'hidden' ;

	//right
	document.getElementById('sub_QLEducation').style.visibility = 'hidden' ;
	
	//sExemptItemId = '' ;
	
}

function movenOut(el){
	return;
	if (!el.contains(event.toElement)){
		el.style.visibility = 'hidden' ; 
	}
}

//START AJAX

var xmlhttp ;


if(document.all){
	xmlhttp = new ActiveXObject("Microsoft.XMLHTTP") ;
	//xmlhttp = new ActiveXObject("MSXML2.XMLHTTP.3.0") ;
} else {
	xmlhttp =  new XMLHttpRequest();
}

xmlhttp.onreadystatechange = ajaxStateChange ;


function ajaxStateChange(){

    if (xmlhttp.readyState == 4) {

        if (xmlhttp.status == 200){

			var sProduct = new String() ;
			var temp = new String() ;
			var sOutput = new String() ;

			if(document.all){
				sProduct = xmlhttp.responseXML.getElementsByTagName('product_title')[0].text ;
			} else {
				sProduct = xmlhttp.responseXML.getElementsByTagName('product_title')[0].firstChild.data ;
			}

			for(var ii = 0; ii < sProduct.length; ii++){
				if(sProduct.charAt(ii)==';'){
					tempComma = temp.indexOf(",") ; 
					tempVal = temp.substr(0, tempComma) ; 
					tempVerb = temp.substr(tempComma+1) ; 
						
					//sOutput += tempVerb + '<br>' ;
					sOutput += '<a class=\"leftsubmenu\" href=\"product.php?id=' + tempVal + '\">&#8226; ' + tempVerb + '</a><br>' ;
					temp = '' ;
				} else {
					temp += sProduct.charAt(ii) ;
				}
			}


			document.getElementById('sub_sub_products').innerHTML = sOutput ;


			ajaxReset();

	}

    }
}

function ajaxReset(){

	xmlhttp.abort() ;

	if(document.all){
		xmlhttp = null ;
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP") ;
		//xmlhttp = new ActiveXObject("MSXML2.XMLHTTP.3.0") ;
	} else {
		xmlhttp = null ;
		xmlhttp = new XMLHttpRequest() ;
	}

	xmlhttp.onreadystatechange = ajaxStateChange ;

}

function ajaxSend(p_sgid){

	xmlhttp.open('POST', 'ajaxProducts.php', true);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	xmlhttp.send('sgid=' + p_sgid);
}



//END AJAX
