/*************** open print window */
var printWin;

function Print(x){
/* check value of x */
    var printURI;
    if (x == null){
    printURI = "";
    } else {
    printURI = x;
    }

/* execute open popup window */
	if (printWin == null || printWin.closed){
		printWin = window.open("/"+printURI,"","toolbar=no,personal=no,menubar=no,status=yes,resizable=yes,width=600,height=400,location=no,scrollbars=yes");
printWin.print();
		}else{
		printWin.focus();
		printWin.location.replace(printURI);
		printWin.print();
		
	}
}

var winName;
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
  winName.focus();
}

function pop(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
  winName.focus();
}

function videopop(theURL) { //v2.0
  window.open("/"+theURL,"videowin","toolbar=no,personal=no,menubar=no,status=yes,resizable=yes,width=560,height=420,location=no,scrollbars=yes");
  videowin.focus();
}


function changepic(img_name,img_src,ProjectCount,new_text) {
document.getElementById(img_name).src=img_src;
document.getElementById("displayText"+ProjectCount).innerHTML = new_text;
}

//var titleRef = document.getElementById('titleBox');

function ShowTitle(title) {
	var titleRef = document.getElementById('titleBox');
   	titleRef.innerHTML = title;
}

function HideTitle() {
	var titleRef = document.getElementById('titleBox');
   	titleRef.innerHTML = '';
}

function setOpacity(obj, opacity) {
  opacity = (opacity == 100)?99.999:opacity;
  
  // IE/Win
  obj.style.filter = "alpha(opacity:"+opacity+")";
  
  // Safari<1.2, Konqueror
  obj.style.KHTMLOpacity = opacity/100;
  
  // Older Mozilla and Firefox
  obj.style.MozOpacity = opacity/100;
  
  // Safari 1.2, newer Firefox and Mozilla, CSS3
  obj.style.opacity = opacity/100;
}

function fadeIn(objId,opacity) {
  if (document.getElementById) {
    obj = document.getElementById(objId);
    if (opacity <= 100) {
      setOpacity(obj, opacity);
      opacity += 10;
      window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 100);
    }
  }
}


document.getElementsByClassName = function(searchClass,node,tag)
{ 

if(node == null)node=document;
var ce = new Array();
if(tag==null || tag=='*')tag='*';
var els = new Array();
if (tag=='*' && document.evaluate){
var xpr=document.evaluate("//*",document, null, 0, null);
var t=true;
 while (t=xpr.iterateNext()){
 if(els.push)
  els.push(t);
 else
  els[els.length]=t;
 };
}
else
els = node.getElementsByTagName(tag);
var elsLen = els.length;
var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
var i;var j;
for (i = 0, j = 0; i < elsLen; i++) {
 if ( pattern.test(els[i].className) )
  if (ce.push)
   ce.push(els[i]);
  else
   ce[j++] = els[i];
}

return ce;

}

function initThumb() {
  imageId = 'thethumb';
   imageDiv = 'imgp';
  image = document.getElementsByClassName(imageDiv);
  if(image){
  setOpacity(image, 0);
  image.style.visibility = 'visible';
  fadeIn(imageDiv,0);
  }
}

//window.onload = function() {initThumb()}
