// JavaScript Document
function LavSiteState(){
	this.started = false;
	this.change = new Signal(this, "statechanged");	
	$(document).ready($lavdelegate(this, this.onDocumentReady));
}
LavSiteState.prototype.onDocumentReady = function(){
	SWFAddress.addEventListener(SWFAddressEvent.CHANGE, $lavdelegate(this, this.onStateChanged));
}
LavSiteState.prototype.onStateChanged = function(evt){
	if((evt.path == "/") && !this.started){
		SWFAddress.setValue("all");
		var e = {value:evt.pathNames[0]}
		this.started = true;
	}else{
		this.manageEvents(evt);		
	}
}
LavSiteState.prototype.manageEvents = function(evt){
	var e = {};
	e.value = evt.pathNames;
	this.change.dispatch(e);
}
LavSiteState.prototype.setValue = function(val){
	SWFAddress.setValue(val);
}
LavSiteState.prototype.getValue = function(){
	return SWFAddress.getValue();
}
