
var mc = (navigator.appVersion.toLowerCase().indexOf("mac")!=-1) ? true : false;
var ie = (document.all) ? true : false;

function get_el(ip_id){
	if (ie){
		return document.all[ip_id];
	} else {
		return document.getElementById(ip_id);
	}
}

onresize = function(){
	//if (typeof(ticker)!="undefined") ticker.position();
}

var ticker = {};
ticker.speed = 1;
ticker.width = 755;

ticker.init_ticker = function(){
	this.tCDv = get_el("tickerContainer");
	if (!this.tCDv) return;
	if (!this.tCDv || !this.tCDv.style) return;
	this.tCDv.style.height = 16;
	this.dv = get_el("ticker");
	this.text_width = this.dv.clientWidth;
	this.x = 0;
	this.position();
	setInterval("ticker.move();",40);
}

ticker.move = function(){
	this.x-=this.speed;
	if (this.x<-(this.text_width+(this.width/2))) this.x=this.width;
	this.dv.style.left = this.x;
	this.dv.style.clip="rect(0 "+(this.width-this.x)+" 50 0)";
}

ticker.position = function(){
	var y = (document.body.offsetHeight/2)+284;
	if (!ie) y+=3;
	this.tCDv.style.top = 1; //y>602 ? y : 602;
}	



var err_els=[];
	
function form_validate(fm){
	var el,vl,sp;
	var error = false;
	
	for (var i=0;i<err_els.length;i++){
		var ar = err_els[i];
		var el = ar[0];
		var sp = ar[1];
		el.style.backgroundColor="#ffffff";
		sp.innerHTML="";
	}		
	err_els=[];
			
	for (i=0;i<rqd.length;i++){
		el = fm.elements[rqd[i]];
		if (typeof(el)=="undefined") continue;
		if (el.type=="text" || el.type=="password") vl=el.value;
		if (el.type=="select-one") vl = el.options[el.selectedIndex].value;
		if (vl==""){
			if (!error) el.focus();
			error = true;

			sp = get_el("val_"+rqd[i]);
			if (!sp) continue;
			sp.className = "txtValidate";
			if (el.type=="text" || el.type=="password") sp.innerHTML = "* ";
			if (el.type=="select-one") sp.innerHTML = "* ";
			el.style.backgroundColor="#FFE6EB";
			err_els[err_els.length] = [el,sp];
		}
	}
	return !error;
}