function preloadImage(path, id)
{
  images[id]=new Image();
  images[id].src=path; 
}



function setGalleryImage(obj)
{
  var tmp;
//  document.getElementById('gallery-image-name').innerHTML='<h2>'+images[id].name+'</h2>';
  document.getElementById('main-gallery-image').style.background=obj.style.background.replace('/thumb-s', '/thumb-m');
  //document.getElementById('main-gallery-image').style.background='#f00';

}


function showGalleryImage(path)
{
 // showImage(document.getElementById('main-gallery-image').src.replace('/thumb-m', ''), 1, 1);
}




function mouseX(evt) {
if (evt.pageX) return evt.pageX;
else if (evt.clientX)
   return evt.clientX + (document.documentElement.scrollLeft ?
   document.documentElement.scrollLeft :
   document.body.scrollLeft);
else return null;
}

function mouseY(evt) {
if (evt.pageY) return evt.pageY;
else if (evt.clientY)
   return evt.clientY + (document.documentElement.scrollTop ?
   document.documentElement.scrollTop :
   document.body.scrollTop);
else return null;
}






function showDetail(url,w,h){

	wasOpen  = false;
  if ( (0<w) && (0<h) )
  {
	 win = window.open(url,'detail','left='+(screen.width/2-w/2)+', top='+(screen.height/2-h/2)+', width='+w+',height='+h+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
	}
	else
	{
    win = window.open(url);
  }
	win.focus();
  return (typeof(win)=='object')?true:false;

}       




function showBubble(text, event)
{
	document.getElementById('bubble').innerHTML=text;
	document.getElementById('bubble').style.display='block';
	document.getElementById('bubble').style.margin=(mouseY(event)-80)+'px 0 0 '+(mouseX(event)-180)+'px';
}

function hideBubble()
{
	document.getElementById('bubble').style.display='none';
}


function showImage(url){


	wasOpen  = false;
	  win = window.open('', '', 'left='+(screen.width/2-100)+', top='+(screen.height/2-80)+', width=190, height=180, toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');

  win.focus();

  win.document.write('<html style="padding: 0; maring: 0;"><body style="padding: 0; maring: 0;"><div style="text-align: center;" id="loading"><img src="/images/loading.gif" width="168" height="147" alt="" /></div><img id="photo" style="position: absolute; left: 0; top: 0; visibility: hidden;" onclick="window.close();" onload="this.style.visibility=\'visible\'; window.resizeTo((document.getElementById(\'photo\').offsetWidth+30), (document.getElementById(\'photo\').offsetHeight+80)); window.moveTo(screen.width/2-(document.images.photo.width+30)/2, screen.height/2-(document.images.photo.height+80)/2); window.resizeTo((document.getElementById(\'photo\').offsetWidth), (document.getElementById(\'photo\').offsetHeight+20)); window.moveTo(screen.width/2-(document.images.photo.width+10)/2, screen.height/2-(document.images.photo.height+100)/2);" name="photo" src="'+url+'" alt="" /></body></html>');

  
  return (typeof(win)=='object')?true:false;

}


var images=new Array();
