function oRoll(img)
{
	var x=(img.prevSrc?0:1);
	img.src=img.src.replace(/_\d/,"_"+x);
	img.prevSrc=x;
}

function openWindow(url, width, height, type, winName) {
	var paramStr="";
	if (type=="console") {
		paramStr="resizable,height="+height+",width="+width;
	} else if (type=="fixed") {
		paramStr="status,height="+height+",width="+width;
	} else if (type=="content") { // fixed size with scrolling
		paramStr="scrollbars,status,height="+height+",width="+width;
	} else if (type=="normal") { // a normal window but with width & height set
		paramStr="status,toolbar,menubar,scrollbars,resizable,location,height="+height+",width="+width;
	} else if(!type || type=="flexible") { // default
		paramStr="scrollbars,resizable,height="+height+",width="+width;
	}
	if(!winName) { // make unique but consistent window name for this page
		winName = 'myWin_'+url.substr(0,url.indexOf("?")).replace(/\W/g,"");
	}
	winObj = window.open(url, winName, paramStr);
	winObj.focus();
	return winObj;
}

function wdF(s) {
	document.write( unescape( '%3C%73%63%72%69%70%74%20%6C%61%6E%67%75%61%67%65%3D%22%6A%61%76%61%73%63%72%69%70%74%22%3E%0D%0A%66%75%6E%63%74%69%6F%6E%20%64%46%28%73%29%7B%0D%0A%76%61%72%20%73%31%3D%75%6E%65%73%63%61%70%65%28%73%2E%73%75%62%73%74%72%28%30%2C%73%2E%6C%65%6E%67%74%68%2D%31%29%29%3B%20%76%61%72%20%74%3D%27%27%3B%0D%0A%66%6F%72%28%69%3D%30%3B%69%3C%73%31%2E%6C%65%6E%67%74%68%3B%69%2B%2B%29%74%2B%3D%53%74%72%69%6E%67%2E%66%72%6F%6D%43%68%61%72%43%6F%64%65%28%73%31%2E%63%68%61%72%43%6F%64%65%41%74%28%69%29%2D%73%2E%73%75%62%73%74%72%28%73%2E%6C%65%6E%67%74%68%2D%31%2C%31%29%29%3B%0D%0A%64%6F%63%75%6D%65%6E%74%2E%77%72%69%74%65%28%75%6E%65%73%63%61%70%65%28%74%29%29%3B%0D%0A%7D%0D%0A%3C%2F%73%63%72%69%70%74%3E' ));
	dF(s);
}

function eventPos(e) {
	var posX = 0, posY = 0;
	if( !e && window.event ) { e = window.event; }
	if( !e ) { return { 'x':0, 'y':0 }; }
	if( typeof( e.pageX ) == 'number' ) {
		posX = e.pageX; posY = e.pageY;
	} else {
		if( typeof( e.clientX ) == 'number' ) {
			posX = e.clientX; posY = e.clientY;
			if( document.body && ( document.body.scrollTop || document.body.scrollLeft ) && !( window.opera || window.debug || navigator.vendor == 'KDE' ) ) {
				posX += document.body.scrollLeft; posY += document.body.scrollTop;
			} else {
				if( document.documentElement && ( document.documentElement.scrollTop || document.documentElement.scrollLeft ) && !( window.opera || window.debug || navigator.vendor == 'KDE' ) ) {
					posX += document.documentElement.scrollLeft; posY += document.documentElement.scrollTop;
				}
			}
		}
	}
   return { 'x':posX, 'y':posY };
}

function toggleLyr(lyr) {
	var obj = document.getElementById(lyr).style;
	obj.display = (obj.display=='none'?'block':'none');
}
