// JavaScript Document
function $get(el) {
	var obj = document.getElementById(el);
	if (obj) {
		return obj;		
	} else {
		// alert(el + ' not found');
		return null;
	}
} 

function initGlossary() {
	var obj = $get('masterList');	
	var qs = new Querystring();
	
	if (obj!=null) {
		obj.className = 'jsMasterList';
		
	}
	
	var itm = qs.get('jsid','0');
	
	if (itm!=0) {
		showItem(itm);	
	}
	
}

function showItem(r) {
	var obj = $get('item' + r);		
	var p;
	
	p = obj.parentNode; 
/*	
if($get('outputTest')) {
	$get('outputTest').value = p.outerHTML;
}*/

	var lis = p.getElementsByTagName('li');
	
	for (i=0;i<=(lis.length-1);i++) {
		lis[i].style.display = 'none';	
		lis[i].style.display = 'none';	
	}
	
	if (obj.filters) {
		obj.filters[0].apply();
		obj.filters[0].play(); 
	}
	obj.style.display = 'block'; 
	p.scrollTop = 0;
}

function financeDecider(q,v) {	
	
	if (q=='q1') {
		if (v=='private') {
			showThis('deciderFRM_q2a','block');
			
			hideThisAndUncheck('deciderFRM_q2b');	
			hideThisAndUncheck('deciderFRM_q2c');	
			hideThisAndUncheck('deciderFRM_q3a');	
			hideThisAndUncheck('deciderFRM_q3b');	
			hideThisAndUncheck('deciderFRM_q3c');	
			hideThisAndUncheck('deciderFRM_q4a');	
			hideThisAndUncheck('deciderFRM_q4b');	
			hideThisAndUncheck('deciderFRM_q4c');		
			hideThisAndUncheck('deciderFRM_q4d');
			hideThis('fdr1');	
			hideThis('fdr2');		
			hideThis('fdr3');		
			hideThis('fdr4');		
			hideThis('fdr5');		
			hideThis('fdr6');
			hideThis('fdr7');					
		} else if (v=='business') {
			showThis('deciderFRM_q2b','block');	
			showWarn();
			hideThisAndUncheck('deciderFRM_q2a');	
			hideThisAndUncheck('deciderFRM_q2c');	
			hideThisAndUncheck('deciderFRM_q3a');	
			hideThisAndUncheck('deciderFRM_q3b');	
			hideThisAndUncheck('deciderFRM_q3c');	
			hideThisAndUncheck('deciderFRM_q4a');	
			hideThisAndUncheck('deciderFRM_q4b');
			hideThisAndUncheck('deciderFRM_q4c');			
			hideThisAndUncheck('deciderFRM_q4d');
			hideThis('fdr1');	
			hideThis('fdr2');		
			hideThis('fdr3');		
			hideThis('fdr4');		
			hideThis('fdr5');		
			hideThis('fdr6');
			hideThis('fdr7');						
		} else if (v=='out') {
			showThis('deciderFRM_q2c','block');	
			
			hideThisAndUncheck('deciderFRM_q2a');	
			hideThisAndUncheck('deciderFRM_q2b');	
			hideThisAndUncheck('deciderFRM_q3a');	
			hideThisAndUncheck('deciderFRM_q3b');		
			hideThisAndUncheck('deciderFRM_q3c');
			hideThisAndUncheck('deciderFRM_q3c');	
			hideThisAndUncheck('deciderFRM_q4a');	
			hideThisAndUncheck('deciderFRM_q4b');
			hideThisAndUncheck('deciderFRM_q4c');	
			hideThisAndUncheck('deciderFRM_q4d');
			hideThis('fdr1');	
			hideThis('fdr2');		
			hideThis('fdr3');		
			hideThis('fdr4');		
			hideThis('fdr5');		
			hideThis('fdr6');
			hideThis('fdr7');						
		}
	}
	if (q=='q2a') {
		if (v=='yes') {
			showThis('deciderFRM_q3a','block');
			
			hideThisAndUncheck('deciderFRM_q3b');		
			hideThisAndUncheck('deciderFRM_q3c');		
			hideThisAndUncheck('deciderFRM_q3d');	
			hideThisAndUncheck('deciderFRM_q4a');	
			hideThisAndUncheck('deciderFRM_q4b');		
			hideThisAndUncheck('deciderFRM_q4d');
			hideThis('fdr1');	
			hideThis('fdr2');		
			hideThis('fdr3');		
			hideThis('fdr4');		
			hideThis('fdr5');		
			hideThis('fdr6');
			hideThis('fdr7');				
		} else if (v=='no') {
			showThis('deciderFRM_q3d','block');
			
			hideThisAndUncheck('deciderFRM_q3a');	
			hideThisAndUncheck('deciderFRM_q3b');	
			hideThisAndUncheck('deciderFRM_q3c');		
			hideThisAndUncheck('deciderFRM_q4a');	
			hideThisAndUncheck('deciderFRM_q4b');	
			hideThisAndUncheck('deciderFRM_q4d');
			hideThis('fdr1');		
			hideThis('fdr2');		
			hideThis('fdr3');		
			hideThis('fdr4');		
			hideThis('fdr5');		
			hideThis('fdr6');
			hideThis('fdr7');			
		}
	}
	if (q=='q2b') {
		if (v=='yes') {
			showThis('fdr4','block');
			
			hideThisAndUncheck('deciderFRM_q3a');	
			hideThisAndUncheck('deciderFRM_q3b');
			hideThisAndUncheck('deciderFRM_q3c');	
			hideThisAndUncheck('deciderFRM_q4a');	
			hideThisAndUncheck('deciderFRM_q4b');	
			hideThisAndUncheck('deciderFRM_q4d');		
			hideThis('fdr1');	
			hideThis('fdr2');		
			hideThis('fdr3');		
			hideThis('fdr5');		
			hideThis('fdr6');
			hideThis('fdr7');			
		} else if (v=='no') {
			showThis('deciderFRM_q3b','block');	
			
			hideThisAndUncheck('deciderFRM_q3a');
			hideThisAndUncheck('deciderFRM_q3c');		
			hideThisAndUncheck('deciderFRM_q4a');
			hideThisAndUncheck('deciderFRM_q4b');	
			hideThisAndUncheck('deciderFRM_q4d');	
			hideThis('fdr1');	
			hideThis('fdr2');		
			hideThis('fdr3');		
			hideThis('fdr4');		
			hideThis('fdr5');		
			hideThis('fdr6');
			hideThis('fdr7');				
		}
	}
	if (q=='q2c') {
		if (v=='yes') {
			showThis('deciderFRM_q3c','block');
			
			hideThisAndUncheck('deciderFRM_q2a');	
			hideThisAndUncheck('deciderFRM_q2b');	
			hideThisAndUncheck('deciderFRM_q3a');	
			hideThisAndUncheck('deciderFRM_q3b');	
			hideThisAndUncheck('deciderFRM_q4a');	
			hideThisAndUncheck('deciderFRM_q4b');	
			hideThisAndUncheck('deciderFRM_q4c');	
			hideThisAndUncheck('deciderFRM_q4d');		
			hideThis('fdr1');	
			hideThis('fdr2');		
			hideThis('fdr3');		
			hideThis('fdr4');		
			hideThis('fdr5');		
			hideThis('fdr6');
			hideThis('fdr7');			
		} else if (v=='no') {
			showThis('deciderFRM_q2a','block');	
				
			hideThisAndUncheck('deciderFRM_q2b');
			hideThisAndUncheck('deciderFRM_q3a');	
			hideThisAndUncheck('deciderFRM_q3b');	
			hideThisAndUncheck('deciderFRM_q3c');	
			hideThisAndUncheck('deciderFRM_q4a');
			hideThisAndUncheck('deciderFRM_q4b');
			hideThisAndUncheck('deciderFRM_q4c');		
			hideThisAndUncheck('deciderFRM_q4d');
			hideThis('fdr1');	
			hideThis('fdr2');		
			hideThis('fdr3');		
			hideThis('fdr4');		
			hideThis('fdr5');		
			hideThis('fdr6');
			hideThis('fdr7');				
		}
	}
	if (q=='q3a') {
		if (v=='yes') {
			showThis('deciderFRM_q4a','block');
			
			hideThisAndUncheck('deciderFRM_q4b');		
			hideThisAndUncheck('deciderFRM_q4d');			
			hideThis('fdr1');	
			hideThis('fdr2');		
			hideThis('fdr3');		
			hideThis('fdr4');		
			hideThis('fdr5');		
			hideThis('fdr6');
			hideThis('fdr7');							
		} else if (v=='no') {
			showThis('fdr1','block');	
			
			hideThisAndUncheck('deciderFRM_q4a');	
			hideThisAndUncheck('deciderFRM_q4b');		
			hideThisAndUncheck('deciderFRM_q4d');
			hideThis('fdr2');		
			hideThis('fdr3');		
			hideThis('fdr4');		
			hideThis('fdr5');		
			hideThis('fdr6');
			hideThis('fdr7');			
		}
	}
	if (q=='q3b') {
		if (v=='yes') {
			showThis('deciderFRM_q4b','block');
			
			hideThisAndUncheck('deciderFRM_q4a');		
			hideThisAndUncheck('deciderFRM_q4c');	
			hideThisAndUncheck('deciderFRM_q4d');
			hideThis('fdr1');	
			hideThis('fdr2');		
			hideThis('fdr3');		
			hideThis('fdr4');		
			hideThis('fdr5');	
			hideThis('fdr6');	
			hideThis('fdr7');							
		} else if (v=='no') {
			showThis('fdr5','block');
			
			hideThisAndUncheck('deciderFRM_q4a');	
			hideThisAndUncheck('deciderFRM_q4b');		
			hideThisAndUncheck('deciderFRM_q4c');	
			hideThisAndUncheck('deciderFRM_q4d');
			hideThis('fdr1');	
			hideThis('fdr2');		
			hideThis('fdr3');		
			hideThis('fdr4');		
			hideThis('fdr6');		
			hideThis('fdr7');		
		}
	}
	if (q=='q3c') {
		if (v=='yes') {
			showThis('deciderFRM_q4c','block');
			
			hideThisAndUncheck('deciderFRM_q4a');	
			hideThisAndUncheck('deciderFRM_q4b');	
			hideThisAndUncheck('deciderFRM_q4d');	
			hideThis('fdr1');	
			hideThis('fdr2');		
			hideThis('fdr3');		
			hideThis('fdr4');		
			hideThis('fdr5');	
			hideThis('fdr6');	
			hideThis('fdr7');							
		} else if (v=='no') {
			showThis('fdr3','block');
			
			hideThisAndUncheck('deciderFRM_q4a');	
			hideThisAndUncheck('deciderFRM_q4b');	
			hideThisAndUncheck('deciderFRM_q4c');	
			hideThisAndUncheck('deciderFRM_q4d');	
			hideThis('fdr1');	
			hideThis('fdr2');		
			hideThis('fdr4');		
			hideThis('fdr5');		
			hideThis('fdr6');		
			hideThis('fdr7');		
		}
	}
	if (q=='q3d') {
		if (v=='yes') {
			showThis('fdr1','block');
			
			hideThisAndUncheck('deciderFRM_q4a');	
			hideThisAndUncheck('deciderFRM_q4b');
			hideThisAndUncheck('deciderFRM_q4c');	
			hideThisAndUncheck('deciderFRM_q4d');		
			hideThis('fdr2');		
			hideThis('fdr3');		
			hideThis('fdr4');		
			hideThis('fdr5');	
			hideThis('fdr6');	
			hideThis('fdr7');							
		} else if (v=='no') {
			showThis('deciderFRM_q4d','block');
			
			hideThisAndUncheck('deciderFRM_q4a');	
			hideThisAndUncheck('deciderFRM_q4b');	
			hideThisAndUncheck('deciderFRM_q4c');	
			hideThis('fdr1');	
			hideThis('fdr2');		
			hideThis('fdr4');		
			hideThis('fdr5');		
			hideThis('fdr6');		
			hideThis('fdr7');		
		}
	}
	if (q=='q4a') {
		if (v=='yes') {
			showThis('fdr2','block');
				
			hideThis('fdr1');	
			hideThis('fdr3');		
			hideThis('fdr4');		
			hideThis('fdr5');		
			hideThis('fdr6');
			hideThis('fdr7');			
		} else if (v=='no') {
			showThis('fdr3','block');
			
			hideThis('fdr1');	
			hideThis('fdr2');		
			hideThis('fdr4');		
			hideThis('fdr5');		
			hideThis('fdr6');
			hideThis('fdr7');			
		}
	}
	if (q=='q4b') {
		if (v=='yes') {
			showThis('fdr6','block');
				
			hideThis('fdr1');		
			hideThis('fdr2');	
			hideThis('fdr3');		
			hideThis('fdr4');		
			hideThis('fdr5');
			hideThis('fdr7');			
		} else if (v=='no') {
			showThis('fdr7','block');
			
			hideThis('fdr1');	
			hideThis('fdr2');
			hideThis('fdr3');		
			hideThis('fdr4');		
			hideThis('fdr5');		
			hideThis('fdr6');			
		}
	}
	if (q=='q4c') {
		if (v=='yes') {
			showThis('fdr2','block');
				
			hideThis('fdr1');	
			hideThis('fdr3');		
			hideThis('fdr4');		
			hideThis('fdr5');		
			hideThis('fdr6');
			hideThis('fdr7');			
		} else if (v=='no') {
			showThis('fdr6','block');
			
			hideThis('fdr1');	
			hideThis('fdr2');
			hideThis('fdr3');		
			hideThis('fdr4');		
			hideThis('fdr5');		
			hideThis('fdr7');			
		}
	}
	if (q=='q4d') {
		if (v=='yes') {
			showThis('fdr1','block');
				
			hideThis('fdr2');	
			hideThis('fdr3');		
			hideThis('fdr4');		
			hideThis('fdr5');		
			hideThis('fdr6');
			hideThis('fdr7');			
		} else if (v=='no') {
			showThis('fdr2','block');
			
			hideThis('fdr1');
			hideThis('fdr3');		
			hideThis('fdr4');		
			hideThis('fdr5');		
			hideThis('fdr6');	
			hideThis('fdr7');			
		}
	}
}
function showWarn() {
	var obj = $get('businessWarnContainer');
	var h = 0;
	var w = 0;
	if (window.innerHeight) {
		h = window.innerHeight;
	} else {
		h = document.body.clientHeight;		
	}
	var t = ((h/2)-165);
	var l = (370-165);
	
	obj.style.display = 'block'
	obj.style.position = 'absolute';
	obj.style.top = t + 'px';
	obj.style.left = l + 'px';
	obj.style.zIndex = 100;
}
function hideThis(o) {
	var obj = $get(o);
	
	if (obj!=null) {
		obj.style.display = 'none';
	}
}
function hideThisAndUncheck(o) {
	var obj = $get(o);
	
	if (obj!=null) {
		obj.style.display = 'none';
		var inputs = obj.getElementsByTagName('input');
		for (i=0;i<=(inputs.length-1);i++) {
			if (inputs[i].checked) {
				inputs[i].checked=false;	
			}
		}
	}
}
function showThis(o,f) {
	var obj = $get(o);
	
	if (obj!=null) {
		obj.style.display = f;
	}
}


function Querystring(qs) { 
	this.params = new Object()
	this.get=Querystring_get
	
	if (qs == null)
		qs=location.search.substring(1,location.search.length)

	if (qs.length == 0) return

	qs = qs.replace(/\+/g, ' ')
	var args = qs.split('&') 
	
	
	for (var i=0;i<args.length;i++) {
		var value;
		var pair = args[i].split('=')
		var name = unescape(pair[0])

		if (pair.length == 2)
			value = unescape(pair[1])
		else
			value = name
		
		this.params[name] = value
	}
}

function Querystring_get(key, default_) {
	if (default_ == null) default_ = null;
	
	var value=this.params[key]
	if (value==null) value=default_;
	
	return value
}