/*************************************************
rock-newWindow.js
Process every element with CSS selector "a.newWindow" 
so that onclick will open a new window.

Depends on prototype.js, rock.js, rock-util.js
**************************************************/
  
// define the namespace
rock.namespace("rock.newwindow");

/*================================================
   Class NewWindow
 =================================================*/
rock.newwindow.NewWindow = function(){
    this.init = function(){
	    var links = $$('a.newWindow');
	    links.each(function(link){
		    link.onclick = function(){
			    //var url = this.getAttribute('url');
			    window.open(this.href);
			    return false;
		    };
	    });  
    }	
}

// create object rock_newWindow if not exist
if (!rock_newWindow) {
    var rock_newWindow = new rock.newwindow.NewWindow();
}

