// JavaScript Document
var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+width+',height='+height+'');
  popUpWin.focus();
}

function popUpAdminWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+width+',height='+height+'');
  popUpWin.focus();
}

function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'block':(v=='hide')?'none':v; }
    obj.display=v; }
}

function MM_toggleLayers(layerID) { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  with (document) if (getElementById && ((obj=getElementById(layerID))!=null)) { 
    if (obj.style) { obj=obj.style; v=(obj.display=='none')?'block':'none'; }
    obj.display=v; }

	with (document) if (getElementById && ((obj=getElementById('img'+layerID))!=null)) { 
    if (obj.src) { v=(obj.src.indexOf('ico-open.gif') != -1)?'/img/ico-close.gif':'/img/ico-open.gif'; }
    obj.src=v;}
	
}

function clearLoginForm() {
	setTimeout("document.getElementById('password').value = '';document.getElementById('login').value = '';",1000);
}

function JJ_ShowAnno(contentfile, divtext) {
	document.getElementsByTagName('html')[0].style.overflow='hidden';

	with (document) if (getElementById && ((obj=getElementById('annoiframe'))!=null)) { 
		if (obj.src) { obj.src = '/inc/iframe.php?pt='+contentfile; }
	}
	with (document) if (getElementById && ((obj=getElementById('annoheader'))!=null)) { 
		if (obj.innerHTML) { obj.innerHTML= divtext; }
	}

	MM_showHideLayers('fader','','show');
	MM_showHideLayers('txtanno','','show');
}


function JJ_ShowAuthor(contentfile, dalink) {
	document.getElementsByTagName('html')[0].style.overflow='hidden';

	with (document) if (getElementById && ((obj=getElementById('annoiframe'))!=null)) { 
		if (obj.src) { obj.src = '/inc/iframe.php?pt=cnt-author-'+contentfile; }
	}
	with (document) if (getElementById && ((obj=getElementById('annoheader'))!=null)) { 
		if (obj.innerHTML) { obj.innerHTML = dalink; }
	}

	MM_showHideLayers('fader','','show');
	MM_showHideLayers('txtanno','','show');
}

function JJ_ShowReviews(contentfile, dalink) {
	document.getElementsByTagName('html')[0].style.overflow='hidden';

	with (document) if (getElementById && ((obj=getElementById('annoiframe'))!=null)) { 
		if (obj.src) { obj.src = '/inc/iframe.php?pt=cnt-review-'+contentfile; }
	}
	with (document) if (getElementById && ((obj=getElementById('annoheader'))!=null)) { 
		if (obj.innerHTML) { obj.innerHTML = dalink; }
	}

	MM_showHideLayers('fader','','show');
	MM_showHideLayers('txtanno','','show');
}

function JJ_CloseAll() {

	with (document) if (getElementById && ((obj=getElementById('annoheader'))!=null)) { 
		if (obj.innerHTML) { obj.innerHTML= '&nbsp;'; }
	}

	document.getElementsByTagName('html')[0].style.overflow='';
//	document.getElementsByTagName("body")[0].style.overflow='auto';

	MM_showHideLayers('fader','','hide');
	MM_showHideLayers('txtanno','','hide');
	MM_showHideLayers('txtbook','','hide');


	MM_showHideLayers('txtbook1','','hide');
	MM_showHideLayers('txtbook2','','hide');
	MM_showHideLayers('txtbook3','','hide');
	MM_showHideLayers('txtbook4','','hide');
	MM_showHideLayers('txtbook5','','hide');
//alert("!!");
	return;
}

function JJ_ShowBook(id) {
	if(id == undefined) id =''
	document.getElementsByTagName('html')[0].style.overflow='hidden';
	MM_showHideLayers('fader','','show');
	MM_showHideLayers('txtbook'+id,'','show');
	document.getElementById('readerswf'+id).focus();
}
