// JavaScript Document


var xmlHttp



function showRep(url, id, div_id, waiting_type)
	{
	window.tag_id = div_id
	window.w_type = waiting_type
	checkhttp()
	url=url+id

	xmlHttp.onreadystatechange=CheckState 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function checkhttp()
	{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
		{
		alert ("Browser does not support HTTP Request")
		return
		} 
}

function CheckState() 
	{ 
	
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		document.getElementById(tag_id).innerHTML=xmlHttp.responseText 
		} 
	if (xmlHttp.readyState==1)
		{ 
			if (w_type == 1) {
				document.getElementById(tag_id).innerHTML="<div align='center'><br><span style='font-size:16px; color:#4F4F9D; font-family:Arial; line-height:130%;'><strong>Loading, Please wait!</strong></span><br>&nbsp;<img src='../images/symbols/loading.gif'>&nbsp;<br>&nbsp;</div>" 
			}
			else{
				document.getElementById(tag_id).innerHTML="&nbsp;<span style='font-size:11px; color:#4F4F9D; font-family:Tahoma;'>Loading, Please wait!</span>" 	
			}
		} 
} 

function GetXmlHttpObject()
	{ 
	var objXMLHttp=null
	if (window.XMLHttpRequest)
		{
		objXMLHttp=new XMLHttpRequest()
		}
	else if (window.ActiveXObject)
		{
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
		}
	return objXMLHttp
}


	function toggle(b_ref) {
		 if( document.getElementById(b_ref).style.display=='' ){
		   document.getElementById(b_ref).style.display = 'none';
		 }else{
		   document.getElementById(b_ref).style.display = '';
		 }
	}
	

function CheckNumber(checkStr, space_id){
	space_id = space_id+'_span';
	var errori = 0;
	for (i = 0;  i < checkStr.length;  i++)
	{
		if (checkStr.charAt(i) < "0" || checkStr.charAt(i) > "9")
		{
			if(checkStr.charAt(i)!="."){
				errori = errori + 1 ;
			}
		}
	}
	
	if (errori == 0){
		document.getElementById(space_id).style.display = 'none';
	}
	else {
		document.getElementById(space_id).style.display = '';
		document.getElementById(space_id).innerHTML="<img src=\"../images/symbols/error3.gif\" align=\"absmiddle\" border=\"0\">";
	}
	
}