/*	-------------------------------------------------------
	browsercheck()
	what type of browser is the user running?
*/
function browsercheck () {
    if (typeof $L != 'undefined') $L.trace( 'deprecatedJsFunctionCall', {file:'persuasion.js',func:'browsercheck/is',page:document.location} );
    
var agt			= navigator.userAgent.toLowerCase();
this.agt		= agt;
this.major		= parseInt(navigator.appVersion);
this.minor		= parseFloat(navigator.appVersion);

// *** Microsquash ***
this.ie			= ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
this.ie4		= (this.ie && (this.major == 4) && (agt.indexOf("msie 5")==-1) );
this.ie5		= (this.ie && (this.major == 4) && (agt.indexOf("msie 5.0")!=-1));
this.ie6		= (this.ie && (this.major == 4) && (agt.indexOf("msie 6")!=-1));
this.ie7		= (this.ie && (this.major == 4) && (agt.indexOf("msie 7")!=-1));

// *** Mozilla spawn ***
this.ns			= ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('hotjava')==-1));

// *** Firefox ***
var ffStr		= 'firefox/'
var ffAgt		= agt.indexOf(ffStr);
this.ff			= ( ffAgt != -1 );
if( this.ff ) {
	this.major	= agt.substr(ffAgt+ffStr.length, 1);
	this.minor	= agt.substr(ffAgt+ffStr.length+2, 1);
}
this.ff1		= (this.ff && (this.major == 1));
this.ff2		= (this.ff && (this.major == 2));

// *** OS ***
this.win		= ((agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1));
this.win95		= ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1));
this.win98		= ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1));
this.mac		= (agt.indexOf("mac")!=-1);
}
var is	= new browsercheck();


/*	-------------------------------------------------------
	toggletext()
	slides the collapsed (height:0, display:none) text open
*/
function toggleText (id) {
    if (typeof $L != 'undefined') $L.trace( 'deprecatedJsFunctionCall', {file:'persuasion.js',func:'toggleText',page:document.location} );
	textEl = document.getElementById(id);
	textH = (document.all)? textEl.offsetHeight : textEl.clientHeight;
	
	if( textH==0 ) {
		YAHOO.util.Dom.setStyle( id, 'height', 'auto' );
		textH = (document.all)? textEl.offsetHeight : textEl.clientHeight;
		YAHOO.util.Dom.setStyle( id, 'height', '0px' );
	} else {
		textH = 0;
	}

	var anim = new YAHOO.util.Anim( textEl );
	anim.attributes.height = { to: textH };
	anim.attributes.top = { to: textH*-1 };
	anim.duration = 0.5;
	anim.method = YAHOO.util.Easing.easeOut;
	anim.animate();
}

/*	------------------------------------------------------------
	gotoSearch( url )
	go to provided url with advanced search stuff appended
*/
function gotoSearch (url) {
    if (typeof $L != 'undefined') $L.trace( 'deprecatedJsFunctionCall', {file:'persuasion.js',func:'gotoSearch',page:document.location} );
	location.href = url+"?fAdvSearch[descr]="+document.getElementById('fSearch').value;
}

