window.addEvent( 'domready', function () {
  var link  = document.getElementsByTagName( "a" );
  var open  = function ( href ) {
    if( arguments.length > 2 ) {
      window.open( href,
        "pomega-window", 
        "width=" + arguments[1] + "," + 
        "height=" + arguments[2] );
    } else  {
      window.open( href );
    }
    return false;
  }; 
  var popup = {
    "ingredients" : function ( ) { 
      return open( this.getAttribute( "href" ), 450, 350 ); 
    },
    "new-window" : function ( ) {    
      return open( this.getAttribute( "href" ) );
    } 
  };
  var current;
  var type;
  for( current = 0; current < link.length; current++ ) {
    for( type in popup ) {
      if( link[current].className.indexOf( type ) > -1 ) {
        link[current].onclick = popup[type];
      }
    }
  }
});