/**
* 
* home mvc
* V 080402
* home mvc est une architecture model view controler qui gère l'ensemble des comportement interactif de la home a l'exeption des menus déroulant du header
* by www.g-u-i.net
* depend on prototype 1.6.0 and scriptaculous 1.8.0
*
*/


function Model() {
	//
	if (typeof Model.initialized == "undefined"){
		var ACTUS_IS_UP = true;
		var GdThemeIsUp = false;
		var TopIsUp = false;
		var HELP_IS_OPEN = false;
		var M_X = 0;
		var M_Y = 0;
		/*
		var AR_COLL_LINKS = $$('#corps_collections div.collectionLink');
		var AR_INIT_SCALE = [];
		var AR_INIT_SCALETemp= [];
		var b=0;
		AR_COLL_LINKS.each(function(elmt){
			AR_INIT_SCALE.push({num:b, width:elmt.getWidth(), height:elmt.getHeight()});
			b++;
		});
		*/
		var AR_COLL_LINKS_FIX = $$('#corps_collections div.collectionLink');
		var AR_COLL_LINKS = AR_COLL_LINKS_FIX.clone();
		var AR_INIT_SCALE_FIX = [];
		var b=0;
		AR_COLL_LINKS_FIX.each(function(elmt){
			AR_INIT_SCALE_FIX.push({num:b, width:elmt.getWidth(), height:elmt.getHeight()});
			b++;
		});
		var AR_INIT_SCALE = AR_INIT_SCALE_FIX.clone();
		//
		var MENU_IS_RUNNING = false;
		var AR_COLL_HIDDEN_LINKS = [];
		var AR_BULLE_COLL  = $$('div.prevColl');
		var TIMER;
		var DRAGGABLE = 'undefined';
		var DRAGGED = 'false';
		var hrz =0;

		Model.prototype.showZoomNouv = function(event){
			var vignette = event.element();
			var nouveaute = vignette.up('div').up('div');
			switch(nouveaute.readAttribute('num')){
				case "1":
					var bulle = $('zoomNouv1');
					var ar_hiddenBulle = $('zoomNouv2', 'zoomNouv3', 'zoomNouv4', 'zoomNouv5');
					break;
				case "2":
					var bulle = $('zoomNouv2');
					var ar_hiddenBulle = $('zoomNouv1', 'zoomNouv3', 'zoomNouv4', 'zoomNouv5');
					break;
				case "3":
					var bulle = $('zoomNouv3');
					var ar_hiddenBulle = $('zoomNouv1', 'zoomNouv2', 'zoomNouv4', 'zoomNouv5');
					break;
				case "4":
					var bulle = $('zoomNouv4');
					var ar_hiddenBulle = $('zoomNouv1', 'zoomNouv3', 'zoomNouv2', 'zoomNouv5');
					break;
				case "5":
					var bulle = $('zoomNouv5');
					var ar_hiddenBulle = $('zoomNouv1', 'zoomNouv3', 'zoomNouv4', 'zoomNouv2');
			}
			view.showZoomNouv(vignette, bulle, ar_hiddenBulle);
			//view.helpDragAndDropClose();
		};
		Model.prototype.hideZoomNouv = function(event){
			var pictoClose = event.element();
			var bulle = pictoClose.up('div').up('div');
			view.fadeZoomNouv(bulle);
			
		};

		Model.prototype.controlMouse = function(event){
			
			M_X = Event.pointerX(event);
			M_Y = Event.pointerY(event);
			if(DRAGGED=="false"){
				view.setMousePos(M_X, M_Y);
				if(Position.within($('corps_collections'), M_X, M_Y)){
					if(MENU_IS_RUNNING === false){
						view.openMenuColl();
						/*
						AR_COLL_LINKS = $$('#corps_collections div.collectionLink');
						var b=0;
						AR_COLL_LINKS.each(function(elmt){
							AR_INIT_SCALE.push({num:b, width:elmt.getWidth(), height:elmt.getHeight()});
							b++;
						});
						*/
						AR_COLL_LINKS = AR_COLL_LINKS_FIX.clone();
						AR_INIT_SCALE = AR_INIT_SCALE_FIX.clone();
						//
						TIMER = setInterval("model.moveMenuColl()", 80);
						MENU_IS_RUNNING = true;
					}
				}else{
					view.closeMenuColl();
				}
			}else{
				if(Prototype.Browser.IE){
					if(hrz == 0){
						var ar_nouv = $$('#corps_nouveautes div.nouveaute');
						ar_nouv.each(function(elmt){
							var imgVignette = elmt.down('div.vignette').down('img');
							if(Position.within(elmt, M_X, M_Y)){
								imgVignette.setStyle({opacity:0.5});
							}else{
								imgVignette.setStyle({opacity:1});
							}
						});
					}else if(hrz ==200){
						hrz = 0;
					}else{
						hrz++;
					}
				}			
			}
			event.stop();
		};
		Model.prototype.moveMenuColl = function(){
			if(DRAGGED=="false"){
				if(AR_COLL_LINKS.size() > 0){
					var i=0;
					AR_COLL_LINKS.each(function(elmt){
						view.moveCollItem(i, elmt, AR_INIT_SCALE[i]);
						i++;
					});
					if(AR_COLL_HIDDEN_LINKS.size() > 0){
						AR_COLL_HIDDEN_LINKS.reverse();
						AR_COLL_HIDDEN_LINKS.each(function(index){
							AR_COLL_LINKS.splice(index, 1);
							AR_INIT_SCALE.splice(index, 1);
						});
						AR_COLL_HIDDEN_LINKS.clear();
					}
				}else{model.stopMenuColl();}
			}
		};
		
		Model.prototype.hideCollItem = function(index){
			AR_COLL_HIDDEN_LINKS.push(index);
		};
		/*
		Model.prototype.stopMenuColl = function(){
			clearInterval(TIMER);
			MENU_IS_RUNNING = false;
		};
		*/
		Model.prototype.stopMenuColl = function(){
			clearInterval(TIMER);
			MENU_IS_RUNNING = false;
			AR_COLL_LINKS.clear();
			AR_INIT_SCALE.clear();
		};
		//
		Model.prototype.newDRAGGABLE = function(elmt){
			DRAGGABLE = new Draggable(elmt, {
				onStart:function(eventName, DRAGGABLE){
					model.setDragged("true");
					view.disablePrevCollMvt(eventName, DRAGGABLE);
				},
				onEnd:function(eventName, DRAGGABLE){
					model.setDragged("false");
					view.resetDisabledPrevCollMvt();
				},
				starteffect:false,
				reverteffect:false,
				endeffect:false,
				handle:false,
				revert:false,
				snap:false,
				zindex:false,
				ghosting:false,
				constraint:false
			});	
		};
		Model.prototype.setDragged = function(str){
			DRAGGED = str;
		};
		Model.prototype.suppDRAGGABLE = function(){
			if(DRAGGABLE!="undefined"){
				DRAGGABLE.destroy();
				DRAGGABLE = "undefined";
				ar_nouv = $$('#corps_nouveautes div.nouveaute');
				ar_nouv.each(function(elmt){
					vignette = elmt.down('div.vignette').down('img');
					vignette.setStyle({opacity:1});
				});
			}
		};
		Model.prototype.newDroppable = function(elmt){
			Droppables.add(elmt, {
				accept:'prevColl',
				onDrop:function(src_elmt, cible_elmt){
					cible_elmt.setStyle({opacity:1});
					model.UpdateNouveaute(src_elmt, cible_elmt);
				},
				hoverclass:'hoverdropp'
			});
		};
		
		Model.prototype.UpdateNouveaute = function(src_elmt, cbl_elmt){
			model.suppDRAGGABLE();
			var src_elmt = src_elmt;
			var cbl_elmt = cbl_elmt;
			var cbl_num = cbl_elmt.readAttribute('num');
			var cbl_zoomNouv;
			var ar_zoomNouv = $$('div.bulleZoom');
			ar_zoomNouv.each(function(elmt){
				if(elmt.readAttribute('num') == cbl_num) {
					cbl_zoomNouv = elmt;
					throw $break;
				}
			});
			
			view.upDateNouveaute(src_elmt, cbl_elmt);
			view.upDateZoomNouv(src_elmt, cbl_zoomNouv);
			
			var nom = "Folio-nouveaute-"+cbl_num;
			var collnum = parseInt(src_elmt.readAttribute('num'))+1;
			var date=new Date;
			date.setFullYear(date.getFullYear()+10);
			model.writeCookie(nom, collnum, date, "/");
      
      var collectionsId = new Array();
			for(i=1;i<6;i++){
				var nom = "Folio-nouveaute-"+i;
				 collectionsId[i-1] = readCookie(nom);				
      }						
			model.writeCookie("customHome", collectionsId.join("_"), date, "/");
			document.location.reload();
		};
		
		Model.prototype.writeCookie = function(nom, valeur){
			var argmts = model.writeCookie.arguments;
			var argmtsL = model.writeCookie.arguments.length;
			var expires = (argmtsL > 2) ? argmts[2] : null;
			var path = (argmtsL > 3) ? argmts[3] : null;
			var domain = (argmtsL > 4) ? argmts[4] : null;
			var secure = (argmtsL > 5) ? argmts[5] : false;
			document.cookie = nom+"="+escape(valeur)+
			((expires==null) ? "" : ("; expires="+expires.toGMTString()))+
			((path==null) ? "" : ("; path="+path))+
			((domain==null) ? "" : ("; domain="+domain))+
			((secure==true) ? "; secure" : "");
		};
		Model.prototype.suppCookies = function(){
			var date=new Date;
			date.setFullYear(date.getFullYear()-1);
			for(i=1;i<6;i++){
				var nom = "Folio-nouveaute-"+i;
				model.writeCookie(nom,null,date);
			}
		};
		Model.prototype.BlindActus = function(){
			if(ACTUS_IS_UP){
				view.BlindDownActu($('corps_actualites'));
				ACTUS_IS_UP = false;
			}else{
				view.BlindUpActu($('corps_actualites'));
				ACTUS_IS_UP = true;
			}
			
			view.hideZoomNouv();
			//view.helpDragAndDropClose();
		};
		Model.prototype.BlindGdThemes = function(event){
			var elmt = event.element();
			var picto = elmt.down('img.pictoBlind');
			var divGdThemes=$('grandsthemes');
			if(GdThemeIsUp){
				view.BlindDown(picto,divGdThemes);
				GdThemeIsUp = false;
			}else{
				view.BlindUp(picto, $('grandsthemes'));
				GdThemeIsUp = true;
			}
			view.hideZoomNouv();
			//view.helpDragAndDropClose();
		};
		Model.prototype.BlindTop = function(event){
			var elmt = event.element();
			var picto = elmt.down('img.pictoBlind');
			var divTop=$('topinternautes');
			if(TopIsUp){
				view.BlindDown(picto,divTop);
				TopIsUp = false;
			}else{
				view.BlindUp(picto,divTop);
				TopIsUp = true;
			}
			view.hideZoomNouv();
			//view.helpDragAndDropClose();
		};

	}
};
function View() {
	if (typeof View.initialized == "undefined"){
		var M_X = 0;
		var M_Y = 0;
		var MENU_IS_OPEN = false;
		var AR_BULLE_COLL = $$('div.prevColl');
		var AR_BTNCOLL = $$('#menuCollection div.collectionLink');
		var DISABLED_PREV_COLL_MVT=999;
		var DIST_MAX = 110;
		var DIST_MIN = 5;
		
		View.prototype.loadImages = function(){
			var ar_imgAcharger = [];
		};
		View.prototype.scrollTo = function(elmt){
			Effect.ScrollTo(elmt);
			view.hideZoomNouv();
			//view.helpDragAndDropClose();
		};
		View.prototype.hideElmt = function(elmt){
			new Effect.Fade(elmt, {duration: 0.4});
		};
		View.prototype.showZoomNouv = function(vignette, bulle, ar_hiddenBulle){
			bulle.show();
			var backGround = bulle.down('div.backGround');
			backGround.show();
			backGround.setStyle({opacity:0});
			var cont = bulle.down('div.inner');
			cont.show();
			cont.setStyle({opacity:0});
			
			var pos_vignette = Position.cumulativeOffset(vignette);
			var x_bulle = pos_vignette[0] - 2;
			var y_bulle = pos_vignette[1] + vignette.getHeight() - bulle.getHeight() + 2;
			if( (x_bulle+bulle.getWidth()) > 1024){
				x_bulle = 1024 - bulle.getWidth();
			}
			bulle.setStyle({
				top:y_bulle+"px",
				left:x_bulle+"px"
			});
			new Effect.Opacity($(backGround), {duration: 0.5, from:0, to:0.8, afterFinish:function(elmt){
					var cont = elmt.element.next('div');
					new Effect.Appear($(cont), {duration: 0.7});
				}
			});
			var visuelBulle = bulle.down('img.visuel');
			Effect.ScrollTo(bulle);
			ar_hiddenBulle.each(function(elmt){
				view.fadeZoomNouv(elmt);
			});
		};
		View.prototype.hideZoomNouv = function(){
			var ar_hiddenBulle = $('zoomNouv1', 'zoomNouv2', 'zoomNouv3', 'zoomNouv4', 'zoomNouv5');
			ar_hiddenBulle.each(function(elmt){
				view.fadeZoomNouv(elmt);
			});
		};
		View.prototype.fadeZoomNouv = function(elmt){
			var cont = elmt.down('div.inner');
			new Effect.Fade($(cont), {duration: 0.2, afterFinish:function(elmt){
					var back = elmt.element.previous('div');
					new Effect.Fade($(back), {duration: 0.2, afterFinish:function(elmt){
						elmt.element.up('div').hide();
					}});
				}
			});
		};
//		View.prototype.helpDragAndDropOpen = function(){
//			var pos_help = Position.cumulativeOffset($('help'));
//			var x_bulleHelp = pos_help[0]-5;
//			var y_bulleHelp = pos_help[1]-75;
//			$('bulleHelp').setStyle({
//				top: y_bulleHelp+'px',
//				left: x_bulleHelp+'px'
//			});
//			new Effect.Appear('bulleHelp', {duration: 0.4});
//			var nouveautes = $('corps_nouveautes');
//		};
//		View.prototype.helpDragAndDropClose = function(){
//			new Effect.Fade('bulleHelp', {duration: 0.4});
//		};
		View.prototype.setMousePos = function(x, y){
			M_X = x;
			M_Y = y;
		};
		View.prototype.moveCollItem = function(index, elmt, initScale){
				var elmt_w = elmt.getWidth();
				var scale_now = (elmt_w * 100)/initScale.width;
				var elmt_pos = Position.cumulativeOffset(elmt);
				if(MENU_IS_OPEN === true){
					var elmt_x = elmt_pos[0] + elmt_w/2;
					var dist =  Math.abs(elmt_x - M_X)*0.6;
					var dist_x = (dist > DIST_MAX) ? DIST_MAX : dist;
					dist_x = (dist_x < DIST_MIN) ? DIST_MIN : dist_x;
					var scale_cible = 200-dist_x;
				}else{
					var scale_cible = 100;
				}
				if( Math.abs(scale_now - scale_cible) > 5){
					var scale = scale_now + (scale_cible - scale_now)*0.8;
					var div_w = (initScale.width * scale)/100;
					var div_h = (initScale.height * scale)/100;
					var fontSize = (11 * scale)/100;
					elmt.setStyle({
						height: div_h+"px",
						width: div_w+"px",
						fontSize: fontSize+"px"
					});
				}
				
				var bulleColl = AR_BULLE_COLL[initScale.num];
				if(MENU_IS_OPEN === false){
					if( Math.abs(scale_now - scale_cible ) < 20){
						if(bulleColl.visible()){
							view.FadePrevColl(bulleColl);
						}
						model.hideCollItem(index);
					}
				}
				
				if(DISABLED_PREV_COLL_MVT != initScale.num){
					if(bulleColl.visible()){
						var bulleColl_x = elmt_pos[0] - ( bulleColl.getWidth() - elmt.getWidth() )/2;
						bulleColl_x = (bulleColl_x < 5) ? 5 : bulleColl_x;
						var bulleColl_y = elmt_pos[1] - bulleColl.getHeight() +47;
						bulleColl.setStyle({
							left: bulleColl_x+"px",
							top: bulleColl_y+"px"
						});
					}
					if(Position.within(elmt, M_X, M_Y)){
						if(MENU_IS_OPEN === true){
							setTimeout(function(){
								if(Position.within(elmt, M_X, M_Y)){
									if(!bulleColl.visible()){
										view.AppearPrevColl(bulleColl);
										view.hideZoomNouv();
										//view.helpDragAndDropClose();
									}
								}
							}, 900);
						}
					}else{
						if(bulleColl.down('div.inner').getStyle('opacity') == 1){
								model.suppDRAGGABLE();
								view.FadePrevColl(bulleColl);
						}
					}
				}
		};
		View.prototype.closeMenuColl = function(){
			MENU_IS_OPEN = false;
		};
		View.prototype.openMenuColl = function(){
			MENU_IS_OPEN = true;
		};
		
		View.prototype.AppearPrevColl = function(elmt){
			if (elmt.readAttribute('isbn')!='') {
      elmt.show();
			elmt.setStyle({cursor:'pointer'});
			var backGround = elmt.down('div.backGround');
			backGround.setStyle({opacity:0});
			var visuel = elmt.down('div.inner');
			visuel.setStyle({opacity:0});
			
			new Effect.Opacity(backGround, {duration:0.3, from:0, to:0.6, afterFinish:function(background){
				var visuel = background.element.next('div.inner');
				new Effect.Opacity(visuel, {duration:0.2, from:0, to:1, afterFinish:function(visuel){
					var bulleColl = visuel.element.up('div');
					bulleColl.setStyle({cursor:'move'});
					model.newDRAGGABLE(bulleColl);
				}});
			}});
			}
		};
		//
		View.prototype.FadePrevColl = function(elmt){
			var visuel = elmt.down('div.inner');
			new Effect.Opacity(visuel, {duration:0.1, from:1, to:0, afterFinish:function(elmt){
				var background = elmt.element.previous('div.backGround');
				new Effect.Opacity(background, {duration:0.1, from:0.6, to:0,  afterFinish:function(elmt){
					var bullColl = elmt.element.up('div');
					bullColl.hide();
				}});
			}});
		};
		View.prototype.FadeAllPrevColl = function(){
			AR_BULLE_COLL.each(function(bulleColl){
				if(bulleColl.visible()){
					view.FadePrevColl(bulleColl);
				}
			});
		};
		//
		View.prototype.disablePrevCollMvt = function(eventName, DRAGGABLE){
			divPrevColl = eventName.element;
			DISABLED_PREV_COLL_MVT = divPrevColl.getAttribute('num');
		};
		View.prototype.resetDisabledPrevCollMvt = function(){
			var bullColl = AR_BULLE_COLL[DISABLED_PREV_COLL_MVT];
			bullColl.hide();
			DISABLED_PREV_COLL_MVT = 999;
		};
		View.prototype.upDateNouveaute = function(src_elmt, cbl_elmt){
			var prod_code=src_elmt.readAttribute('codeProd');
			var codeAuteur=src_elmt.readAttribute('idAuteur');
      var innerDiv = '<div class="texte"><a href="javascript:goFicheAuteur(\''+codeAuteur+'\');"><h4>';
      innerDiv += src_elmt.readAttribute('auteur');
			innerDiv += '</a>';
			innerDiv += '</h4>';
      innerDiv += '<a href="javascript:goFicheArticle(\''+prod_code+'\');"><h5>';
			innerDiv += src_elmt.readAttribute('titre')+'</h5>';
			innerDiv += '</a>';
			innerDiv += '</div>';
			
			var innerImg = '<img src="'+src_elmt.down('div.inner').down('img').readAttribute('src')+'" ';
			innerImg += 'title="Couverture: '+src_elmt.readAttribute('titre');
			innerImg += ' - '+src_elmt.readAttribute('soustitre')+'" ';
			innerImg += 'alt="Couverture: '+src_elmt.readAttribute('titre');
			innerImg += ' - '+src_elmt.readAttribute('soustitre')+'" />';
			
			cbl_elmt.down('div.texte').replace(innerDiv);
			cbl_elmt.down('div.vignette').down('img').replace(innerImg);
		};
		
		View.prototype.upDateZoomNouv = function(src_elmt, cbl_zoomNouv){
			var visuel = '<img class="visuel" ';
			visuel += 'src="'+src_elmt.readAttribute('bigpicture')+'" ';
			visuel += 'title="'+src_elmt.readAttribute('auteur')+', '+src_elmt.readAttribute('titre')+'" ';
			visuel += 'alt="'+src_elmt.readAttribute('auteur')+', '+src_elmt.readAttribute('titre')+'" />';
			var auteur = '<h4>'+src_elmt.readAttribute('auteur')+'</h4>';
			var titre = '<b><h3>'+src_elmt.readAttribute('titre')+'</h3></b>';
			var chapeau = '<p class="chapeau">'+src_elmt.down('p.chapeau').innerHTML+'</p>';
			var collection = '<p class="collections">'+src_elmt.readAttribute('collection');
			collection += '</p>';
			var annexes = '<div class="annexe">'+src_elmt.down('div.annexe').innerHTML+'</div>';
			var innerZoom = cbl_zoomNouv.down('div.inner');
			innerZoom.down('img.visuel').replace(visuel);
			innerZoom.down('h4').replace(auteur);
			innerZoom.down('h3').replace(titre);
			innerZoom.down('p.chapeau').replace(chapeau);
			innerZoom.down('p.collections').replace(collection);
			innerZoom.down('div.annexe').replace(annexes);
		};
		View.prototype.BlindDownActu = function(elmt) {
			
			var ar_imgBlindActus = $$('#pictos_actualites div.actu_a img.pictoBlind, #pictos_actualites div.actu_b img.pictoBlind');
			ar_imgBlindActus.each(function(elmt){
				elmt.replace('<img class="pictoBlind" src="images/pictos/19/up.gif" title="fermer" alt="fermer" />');
			});
			Effect.BlindDown(elmt, {duration: 0.5});
			Effect.ScrollTo('corps_atusetflash');
		};
		View.prototype.BlindUpActu = function(elmt) {
			var ar_imgBlindActus = $$('#pictos_actualites div.actu_a img.pictoBlind, #pictos_actualites div.actu_b img.pictoBlind');
			ar_imgBlindActus.each(function(elmt){
				elmt.replace('<img class="pictoBlind" src="images/pictos/19/down.gif" title="ouvrir" alt="ouvrir" />');
			});
			Effect.BlindUp(elmt, {duration: 0.5});
			Effect.ScrollTo('corps_atusetflash');
		};
		View.prototype.BlindDown = function(picto, blinder) {
			picto.replace('<img class="pictoBlind" src="images/pictos/19/up.gif" title="fermer" alt="fermer" />');
			Effect.BlindDown(blinder, {duration: 0.5});
		};
		View.prototype.BlindUp = function(picto, blinder) {
			picto.replace('<img class="pictoBlind" src="images/pictos/19/down.gif" title="ouvrir" alt="ouvrir" />');
			Effect.BlindUp(blinder, {duration: 0.5});
		};
	}	
};
function Controler(){
	if (typeof Controler.initialized == "undefined"){
		var ar_linkScroll = $$('#corps_nouveautes h2.partie','#corps_collections h2.partie','#head_atusetflash h2.partie','#head_gdthemettop h2');
		ar_linkScroll.each(function(elmt){
			Event.observe(elmt, 'click', function(event){
				var elmt = event.element().up('div');
				view.scrollTo(elmt);
				view.hideZoomNouv();
				event.stop();
			});
		});
		var ar_nouveautes = $$('#corps_nouveautes div.nouveaute');
		ar_nouveautes.each(function(elmt){
			var vignette = elmt.down('div.vignette');
			Event.observe($(vignette), 'click', function(event){
				model.showZoomNouv(event);
				event.stop();
			});
		   model.newDroppable(elmt);
		});
		var ar_hiddenBulle = $('zoomNouv1', 'zoomNouv2', 'zoomNouv3', 'zoomNouv4', 'zoomNouv5');
		ar_hiddenBulle.each(function(elmt){
			var pictoClose = elmt.down('img.pictoClose');
			Event.observe($(pictoClose), 'click', function(event){
				model.hideZoomNouv(event);
				event.stop();
			});
		});
		
//		Event.observe('help', 'click', function(event){
//			view.helpDragAndDropOpen();
//			view.hideZoomNouv();
//			event.stop();
//		});
//		var pictoClose = $('bulleHelp');
//		Event.observe(pictoClose, 'click', function(event){
//			view.helpDragAndDropClose();
//			event.stop();
//		});
//		var btnsuppCookies = $$('#bulleHelp span.suppCookies')[0];
//		Event.observe(btnsuppCookies, 'click', function(event){
//			model.suppCookies();
//			event.stop();
//		});
		Event.observe(document, "mousemove", model.controlMouse, false);
		Event.observe('pictos_actualites', 'click', function(event){
			model.BlindActus();
			event.stop();
		});
		/*
		var blindGdThemes = $$('#corps_gdthemettop div.blindGdTheme')[0];
		Event.observe(blindGdThemes, 'click', function(event){
			model.BlindGdThemes(event);
			event.stop();
		});
		*/
		/*
		var blindTop = $$('#corps_gdthemettop div.blindTop')[0];
		Event.observe(blindTop, 'click', function(event){
			model.BlindTop(event);
			event.stop();
		});
		*/
	}
};
function starter(e){
	view = new View();
	model = new Model();
	controler = new Controler();
	e.stop();
};
Event.observe(window, 'load', starter);


