var ie, op, ge;
if(navigator.userAgent.indexOf("MSIE") >= 0){ie=true;}else{ie=false};
if(navigator.userAgent.indexOf("Opera") >= 0) op=true;
if(navigator.userAgent.indexOf("Gecko") >= 0) ge=true;

function newwin(src, w, h)
{
	newWin= "newWindow2"+Math.floor(Math.random()*500)+"";
	myWin= open("", newWin, "width="+w+",height="+h+",status=no,toolbar=no,menubar=no");
	myWin.document.writeln("<html style='margin: 0px; padding: 0px;'><title></title><script>function zero() {window.close();}</script><body style='margin: 0px; padding: 0px;' onclose='zero();' onclose='break; zero();' onunload='zero();' leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0 marginwidth=0 marginheight=0><img onclick='zero();' src="+src+" width="+w+" height="+h+" border=0></body></html>");
}

function closesw(id,id1) {
	document.getElementById(id).className="blue";
	document.getElementById(id+'d').className="hidden";
	if ( dcur==id1 ) { swd=1; };
			

}

var dcur=null;
var swd=null;
	
function sw(id1) {
	swd=null;
	if ( dcur != null ) { 
		closesw(dcur,id1);
		if ( dcur==id1 ) {
			dcur=null;
			swd=1;
			};
		};
	if( ((dcur == null) || (dcur != id1)) && (swd == null) ){
		document.getElementById(id1).className="gr";
		document.getElementById(id1+'d').className="dvis";
		dcur=id1;
		};
}


var current=null;
var rl=null;



function show(e,id,dh) {
var Width = 0;
if( typeof( window.innerWidth ) == 'number' ) {
	Width = window.innerWidth;
} else if ( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	Width = document.documentElement.clientWidth;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	Width = document.body.clientWidth;
}

var posx=0,posy=0;
if(e==null) e=window.event;
if(e.pageX || e.pageY){
	x=e.pageX; y=e.pageY;
	}
else if(e.clientX || e.clientY){
	if(document.documentElement.scrollTop){
		x=e.clientX+document.documentElement.scrollLeft;
		y=e.clientY+document.documentElement.scrollTop;
		}
else{
		x=e.clientX+document.body.scrollLeft;
		y=e.clientY+document.body.scrollTop;
		}
	}
document.getElementById(id).style.filter="alpha(opacity:85)";
document.getElementById(id).style.KHTMLOpacity="0.85";
document.getElementById(id).style.MozOpacity="0.85";
document.getElementById(id).style.opacity="0.85";
if(Width <= x+400) {
	x = x - 350;
	rl=true;
} else {
	rl=null;
}
document.getElementById(id).style.left=x-50+"px";
document.getElementById(id).style.top=y+20+"px";

if (current!=id && rl == null) document.getElementById(id).className="visible";
if (current!=id && rl == true) document.getElementById(id).className="visible2";
if (rl == true && document.getElementById(id).className=="visible" ) document.getElementById(id).className="visible2";
if (rl == null && document.getElementById(id).className=="visible2" ) document.getElementById(id).className="visible";

current=id;
}

function hide(id) {
	document.getElementById(id).className="quote";
	current=null;
}

