/****************************************************
*	   DOM Image rollover:
*		by Chris Poole
*		http://chrispoole.com
*     Script featured on http://www.dynamicdrive.com
*		Keep this notice intact to use it :-)
****************************************************/
function init() {
  if (!document.getElementById) return
  var imgOriginSrc;
  var imgTemp = new Array();
  var imgarr = document.getElementsByTagName('img');
  for (var i = 0; i < imgarr.length; i++) {
    if (imgarr[i].getAttribute('hsrc')) {
        imgTemp[i] = new Image();
        imgTemp[i].src = imgarr[i].getAttribute('hsrc');
        imgarr[i].onmouseover = function() {
            imgOriginSrc = this.getAttribute('src');
            this.setAttribute('src',this.getAttribute('hsrc'))
        }
        imgarr[i].onmouseout = function() {
            this.setAttribute('src',imgOriginSrc)
        }
    }
  }
}
onload=init;

// html pop up window that needs fixing (scroll bars)
function imgPopup(url,x,y){  
	MyWin = window.open("","","width=" + x + ",height=" + y + ",toolbar=no,location=no,directories=no,status=no,menubar=no,top=20,left=20,scrollbars=0");
	with(MyWin.document){
	open();
	write("<html>\n<head>\<title>Pavlik Design Team</title>\n</head>\n<body style='margin:0;'>\n");
	write("<meta http-equiv=imagetoolbar content=no>\n");	
	write("<a href='javascript:window.close();'><img src=\"" + url + "\" width=\"" + x + "\" height=\"" + y + "\" border=0></a>\n");
	write("</body>\n</html>\n");
	close();
	}
}

//centered pop up
function openWindow(theURL,winName,winWidth,winHeight,otherFeatures) {
   var x = 0;
   var y = 0;
   x = (screen.availWidth - 12 - winWidth) / 2;
   y = (screen.availHeight - 48 - winHeight) / 2;
   if (otherFeatures != "") {otherFeatures = "," + otherFeatures}
   var features = "screenX=" + x + ",screenY=" + y + ",width=" + winWidth + ",height=" + winHeight+",top="+y+",left="+x+"'" + otherFeatures
   var NewWindow = window.open(theURL,winName,features);
   NewWindow.focus();
}

// update image
function updateImage(url)  {
	document['main'].src=url;
	return;
}