/* calls that are specific to commissions page */

function Field(name){
         this.name = name;
         this.value = null;
         this.hasContent = function(){ if (this.value == null){ return false; } else { return true; } }
         this.has_request_in_progress = false;
}

fields = new function(){
         this.global = new Field('global');
	 this.north_america = new Field('north_america');
         this.europe = new Field('europe');
         this.asia = new Field('asia');

         this.setSelected=function(s){
	   if (s == 'north_america'){ this.selected = this.north_america; }
           else if (s == 'europe'){ this.selected = this.europe; }
	   else if (s == 'asia'){ this.selected = this.asia; }
	   else { this.selected = this.global; }
         }
}

function getdata(r, path, ib_entity)
{
	 if (xmlHttp)
	 {
	     try {
	        xmlHttp.open("GET", path+"/exchangedata.php?r="+r+"&ib_entity="+ib_entity, true);
		xmlHttp.onreadystatechange = displaycontent;
		xmlHttp.send(null);
	     }
	     catch(e){}
	 }
}

function displaycontent()
{
	 try {
	     if (xmlHttp.readyState == 4)
	     {
		     fields.selected.value = xmlHttp.responseText;
		     content.innerHTML = fields.selected.value;
	             fields.has_request_in_progress = false;
	     }
         } catch(e){alert(e)}
}
