// JavaScript Document
var win;

	var myrules = {
		'#pic_thumbnails a' : function(element){
			/*element.onclick = function(){
				 $('large_img').src = this.href;
				 $('large_img').title = this.title + " (click for larger version)";
				 $('large_img').alt = this.title;
				 $('largeProductImageLink').href = this.rel;
				 return false;
			}*/
			
		  element.onclick = function(){
			  if(win) {
				  top.Windows.close('largeImageWindow');
			  }
			  win = new Window({destroyOnClose:true, className:"alphacube", id:"largeImageWindow", width: 660, height:500, resizable:false, minimizable:false, maximizable:false, onClick: function(){top.Windows.close('largeImageWindow')}});
			  win.setHTMLContent("<center><img src='"+element.href+"' onClick=\"top.Windows.close('largeImageWindow')\" title='Click to close' /></center>");
			  win.showCenter();
			  win.setTitle(this.title);
			  return false;
		  }
		},
		'#largeProductImageLink' : function(element){
		  element.onclick = function(){
			  if(win) {
				  top.Windows.close('largeImageWindow');
			  }
			  win = new Window({destroyOnClose:true, className:"alphacube", id:"largeImageWindow", width: 660, height:500, resizable:false, minimizable:false, maximizable:false, onClick: function(){top.Windows.close('largeImageWindow')}});
			  win.setHTMLContent("<center><img src='"+element.href+"' onClick=\"top.Windows.close('largeImageWindow')\" title='Click to close' /></center>");
			  win.showCenter();
			  win.setTitle($('large_img').alt);
			  return false;
		  }
		},
		'#fullSitemapImageLink' : function(element){
      element.onclick = function(){
        if(win) {
          top.Windows.close('fullSitemapImageLinkWindow');
        }
        win = new Window({destroyOnClose:true, className:"alphacube", id:"fullSitemapImageLinkWindow", width: 660, height:500, maxWidth: 1054, maxHeight: 798, resizable:false, minimizable:false, maximizable:true, onClick: function(){top.Windows.close('fullSitemapImageLinkWindow')}});
        win.setHTMLContent("<center><img src='"+element.href+"' onClick=\"top.Windows.close('fullSitemapImageLinkWindow')\" title='Click to close' /></center>");
				win.maximize();
				win.showCenter();
        win.setTitle($('large_img').alt);
        return false;
      }
    }
	};
	Behaviour.register(myrules);
	
	var currentProjectID;
	
	function showContentDiv(projectID){
		  $('project_0').hide();
		  if (currentProjectID > 0)
		    $('project_' + currentProjectID).hide();
      
      $('project_' + projectID).show();
      currentProjectID = projectID;
  }
	
	