function xlaAFMlaunch(){
	if (document.all) {
		windowheight = screen.availHeight;
		rightwidth=240;
		leftwidth=screen.availWidth-rightwidth-11;
		AFMwindow=window.open('http://64.224.186.101/askus/afmmain.asp?topicid=&faqid=','xlaAFM','width='+rightwidth+',height='+(windowheight-51)+',screenX='+leftwidth+',screenY=0,top=0,left=' +leftwidth+',toolbar=0,location=0,status=1,menubar=0,resizable=1');
		AFMwindow.focus();
	} else {
		AFMwindow=window.open('http://64.224.186.101/askus/afmmain.asp?topicid=&faqid=','','width=240,height=480,toolbar=0,location=0,status=1,menubar=0,resizable=1');
	}
}
//-- This function opens the new, empty window named floater.
function openWindow(url) {
    		wpix=300
    		hpix=200
    		xpix=50
    		ypix=50
    		features='toolbar=no,location=no,directories=no,menubar=no,status=no,'
    		features+='scrollbars=no,resizable=yes,width='
    		features+=wpix
    		features+=',height='
    		features+=hpix
 
    		if (navigator.appName.indexOf("Microsoft")>=0) {
        		//xpix=screen.width-wpix-50
        		//ypix=screen.height-hpix-150
 			features+=',left='
 			features+=xpix
 			features+=',top='
 			features+=ypix
    		}else{
 			//-- Netscape
 			features+=',screenX='
			features+=xpix
 			features+=',screenY='
			features+=ypix
		}
		floater=window.open(url,"LittleWindow",features); 
		floater.opener=self;
    		floater.focus(); 
}

// stop double clicking of payment button
var submitcount = 0;

function checkFields()
{

if (submitcount == 0) {
	//sumbit form
	submitcount ++;	
	return true;	
	}
else
	{	
		alert("Transaction is in progress.");
		return false;
	}
}

function dynamicSelect()
{
	this.selects = new Array();
	
	this.addSelect = function(name)
	{
		this.selects[name] = new selectObj();
	}


	this.updateOptions = function(source, target)
	{
		var form = source.form;
		var target = form.elements[target];
		var value = source.options[source.selectedIndex].value;
		while(target.options.length) target.remove(0);
		
		if(!this.selects[source.name].options[value])
		{
			//alert('Invalid selection.'); //For debugging while you set it up
			return;
		}
		
		var data = this.selects[source.name].options[value].options;
		
		for(var x=0; x<data.length; x++)
		{
			try
			{
				target.add(data[x]);
			}
			catch(e)
			{
				target.add(data[x], null);
			}
		}
		
		target.selectedIndex = 0;
	}

}


function selectObj()
{
	this.options = new Array();
	
	this.addOption = function(value)
	{
		this.options[value] = new optionObj();
	}
}


function optionObj()
{
	this.options = new Array();
	
	this.createOption = function(name, value)
	{
		this.options[this.options.length] = new Option(name, value);
	}
}
