var xmlHttp;

//============================== Displaying Button Information ==============================//
function showButtonInformation(sport_id,category_id,product_id,info_page,title,anchorname)
	{		
		//==== Setting Layer Position
		var coordinates=getAnchorPosition(anchorname);
		if(coordinates.x<250){ browserCompatiablity("divInformationDisplay").style.left=(coordinates.x+20)+'px'; }
		else{ browserCompatiablity("divInformationDisplay").style.left=(coordinates.x-230)+'px'; }
		browserCompatiablity("divInformationDisplay").style.top=(coordinates.y+0)+'px';		
		
		var strSubmit       = '';		
        var formElem;
        var strLastElemName = ''; 	
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
			{
				alert ("Browser does not support HTTP Request");
				return;
			} 
		var url=path_src+"WEB-INF/classes/ajax/show_button_information.php?category_id="+category_id+"&sport_id="+sport_id+"&product_id="+product_id+"&info_page="+info_page+"&title="+title;
		
		xmlHttp.open("POST",url,true);
		xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlHttp.onreadystatechange=stateChangedButInfo;		
		xmlHttp.send(strSubmit);	
	}
//============================== Displaying Button Information ==============================//

	
function hideButtonInformation()
	{
		browserCompatiablity("divInformationDisplay").style.display='none';
	}	
function stateChangedButInfo() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{ 
				if(xmlHttp.responseText=="")
					{					
						//browserCompatiablity("divInformationDisplay").innerHTML=xmlHttp.responseText;
					}
				else{
						browserCompatiablity("divInformationDisplay").innerHTML=xmlHttp.responseText;	
						browserCompatiablity("divInformationDisplay").style.display='block';
						setTimeout("hideButtonInformation()", 5000);
					}	
			} 
	} 	
//============================== Displaying Button Information ==============================//	



function GetXmlHttpObject()
{ 

	var objXMLHttp=null
		
	//For Mozilla, Firefox, Safari, Opera, and Netscape:
	if (window.XMLHttpRequest)
		{
			
			try {		
                        objXMLHttp = new ActiveXObject("Msxml2.XMLHTTP");										
                } 
			catch (e) 
				{
                        try 
						{	
                           objXMLHttp = new ActiveXObject("Microsoft.XMLHTTP");						   
                        } 
						catch (E) 
						{	
                              	objXMLHttp = new XMLHttpRequest();
            					objXMLHttp.overrideMimeType('text/xml');
                        }
                }

		}

	//For Internet Explorer:
	else if (window.ActiveXObject)
		{	
			try {		
                        objXMLHttp = new ActiveXObject("Msxml2.XMLHTTP");
                } 
			catch (e) 
				{
                        try 
						{	
                            objXMLHttp = new ActiveXObject("Microsoft.XMLHTTP"); 
                        } 
						catch (E) 
						{	
                                objXMLHttp = false;
                        }
                }			
		}
	

	return objXMLHttp
} 


function submitWhileEnter(evt) 
	{	  
		evt = (evt) ? evt : event;
		var charCode = (evt.charCode) ? evt.charCode :  ((evt.which) ? evt.which : evt.keyCode);	
		//alert(charCode);		
		if (charCode == 13 || charCode == 3) 
			{				
				form_validation();
			}
		else{
				return;
			}
		return;		
	}



function browserCompatiablity(ugra)
	{
		var elem;
		if( document.getElementById ){	elem = document.getElementById( ugra );	} // this is the way the standards work
		else if( document.all ){ elem = document.all[ugra];	} // this is the way old msie versions work
		else if( document.layers ){	elem = document.layers[ugra]; } // this is the way nn4 works
		return elem;
	}
