var Projects = {
 
  links : {
	  'magicomio': [
	    { name: 'Ver', href: 'http://www.youtube.com/v/VUrIDlcuB2k&hl=en_US&fs=1&', title: 'Magicomio'
		},
		{ name: 'Escuchar', href: 'http://www.eniolandia.com/proyectos/08_01_magicomiodisco.zip', title: '_link'
		},
		{ name: 'Leer', href: 'http://www.eniolandia.com/proyectos/08_02_magicomiolascaras.pdf', title: 'Magicomio :: :: fullscreen: true'
		}
	  ],
	  'camayjardin': [
	    { name: 'Leer', href: 'http://www.eniolandia.com/proyectos/09_camayjardin.pdf', title: 'Cama y jardin :: :: fullscreen: true'
		}
	  ],
	  'poegrafia': [
	 { name: 'Blog', href: 'http://www.eniolandia.com/wp', title: '_link'
		}
	  ],
	  'capital': [
	    { name: 'Blog', href: 'http://www.eniolandia.com/wp', title: '_link'
		},
		{ name: 'YouTube', href: 'http://www.youtube.com/user/eniolandia', title: '_link', target:'_blank'
		}
	  ],
	  'cellomalditocello': [
		{ name: 'Escuchar', href: 'http://www.eniolandia.com/proyectos/02_01cellomalditocellomusica.zip', title: '_link'
		},   
	 { name: 'Leer', href: 'http://www.eniolandia.com/proyectos/02_cellomalditocello.pdf', title: 'Cello maldito cello :: :: fullscreen: true'
		}
	  ],
	  'maryhombre': [
	    { name: 'Leer', href: 'http://www.eniolandia.com/proyectos/03_maryhombre.pdf', title:'Mar y hombre :: :: fullscreen: true'
		}
	  ],
	  'posetarium': [
		{ name: 'Leer', href: 'http://www.eniolandia.com/proyectos/04_posetarium.pdf', title:'Posetarium :: :: fullscreen: true'
		}
	  ],
	  'zoologico': [
	    { name: 'Ver 1', href: 'http://www.youtube.com/v/5F-sOgssm14&hl&fs=1&', title: 'Zool&oacute;gico'
		},
		{ name: 'Ver 2', href: 'http://www.youtube.com/v/rRYWVqQZnRc&fs=1', title: 'Mar&iacute;a la tortuga'
		},
		{ name: 'Ver 3', href: 'http://www.youtube.com/v/AG-TFjNzwgs&hl&fs=1&', title: 'Juancito el pescao'
		},
		{ name: 'Leer', href: 'http://www.eniolandia.com/proyectos/05_00_zoologicoplantillacubo.pdf', title: 'Plantilla :: :: fullscreen: true'
		},
		{ name: 'Escuchar', href: 'http://www.eniolandia.com/proyectos/05_24_zoologicodisco.zip', title: '_link'
		}
	  ],
	  'caraelibro': [
	    { name: 'Leer', href: 'http://www.eniolandia.com/proyectos/06_caraelibro.pdf', title:'Cara e&lsquo; libro  :: :: fullscreen: true'
		}
	  ],
	  'clasificados': [
	    { name: 'JPG', href: 'http://www.eniolandia.com/proyectos/07_clasificados.jpg', title:'Clasificados   :: :: fullscreen: false'
		}
	  ],



	  linksmodelo: [
	    { name: 'Lightview', href: 'http://www.nickstakenburg.com/projects/lightview', 
		  hook: { tip: 'topRight', target: 'bottomLeft' }
		},
		{ name: 'Prototip', href: 'http://www.nickstakenburg.com/projects/prototip2', 
		  hook: { tip: 'topRight', target: 'bottomLeft' }
		},
	    { name: 'Starbox', href: 'http://www.nickstakenburg.com/projects/starbox', 
		  hook: { tip: 'topRight', target: 'bottomLeft' }
		}
	  ]
  },
  getTipContent: function(name) {
    // if (!($('ideas') || $('projects'))) return;
	
	var wrapper = new Element('div');
	
	var links = wrapper.appendChild(new Element('ul'));
	links.insert(new Element('li', { className: 'top' }).update('<!-- round -->'));
	this.links[name].each(function(l,i) {
	  var li = links.appendChild(new Element('li'));
	  var target = (l.name == name) ? '_self' : '_self';
	  if (l.title=='_link') {
		var a = li.appendChild(new Element('a', { className: 'idea' + l.name, 'target': target, 'href': l.href }).update(l.name));
	} else {
		var a = li.appendChild(new Element('a', { className: 'lightview', 'target': target, 'href': l.href, 'title':l.title }).update(l.name));
	}
	  if (i + 1 == this.links.length) a.addClassName('last');
    }.bind(this));
	links.insert(new Element('li', { className: 'bottom' }).update('<!-- round -->'));
	
	return wrapper;
  },
  
  createIdeas: function(name) {
	var content = this.getTipContent(name),
	ideas = $('ideas'),
	projects = $('projects');
	
    if (ideas) {
	  var hook = this.links.find(function(l) { return l.name.toUpperCase() == name.toUpperCase(); }).hook;
	  new Tip('ideas', content, Object.extend({
		className: 'ideaTip',
		effect: 'appear',
		hook: hook,
		hideOn: false,
		hideAfter: 1.5
	  }, arguments[1] || {}));
	}
	else if(projects) {
	  new Tip(projects, content, Object.extend({
		className: 'ideaTip',
		effect: 'appear',
		hook: { target: 'bottomLeft', tip: 'topLeft' },
		offset: { x: 0, y: 2 },
		hideOn: false,
		hideAfter: 1.5
	  }, arguments[1] || {}));
	}
  }
}

document.observe('dom:loaded', function() {
  var project = $(document.body).className != 'projectLicense' ? $(document.body).className.substr(7).toLowerCase() : null;
  if (!project) return;

});


