Event.observe(window, 'load', init, false); function init(evt){ Effect.Appear($('home_left')); $('home_link').observe('click', home_view, false); $('contact_link').observe('click', contact_view, false); $('conditions_link').observe('click', condition_view, false); /* $('about_link').observe('click', about_view, false); */ /* $('ezone_link').observe('click', ezone_view, false); */ $('portfolio_link').observe('click', portfolio_view, false); home_view(); } // init function home_view() { $('top_position').update("Home"); new Ajax.Updater($('home_right'),'inc_home/home_view.php', { evalScripts:true }); } function about_view(evt) { $('top_position').update("About"); new Ajax.Updater($('home_right'),'inc_about/about_view.php',{ evalScripts:true }); Event.stop(evt); } function ezone_view(evt) { $('top_position').update("e-zone"); new Ajax.Updater($('home_right'),'inc_ezone/ezone_view.php',{ evalScripts:true }); Event.stop(evt); } function showTestButton(){ mondiv = $('mychoice'); if (mondiv.style.display=='') mondiv.hide(); else Effect.Appear(mondiv); } function makeItShake(){ Effect.Shake($('home_left')); } function contact_view() { $('top_position').update("Contact"); new Ajax.Updater($('home_right'),'inc_contact/contact_view.php', { evalScripts:true, onComplete: function() { } }); } function portfolio_view() { include('inc_portfolio/portfolio.js'); $('top_position').update("Portfolio"); new Ajax.Updater($('home_right'),'inc_portfolio/portfolio_view.php', { evalScripts:true, onComplete: function() { $('motoracing').observe('mouseover', motoracing.bindAsEventListener($('motoracing')), false); $('motoracing').observe('mouseout', motoracing.bindAsEventListener(''), false); $('clubmotoracing').observe('mouseover', motoracing.bindAsEventListener($('clubmotoracing')), false); $('clubmotoracing').observe('mouseout', motoracing.bindAsEventListener(''), false); } }); } function condition_view() { $('top_position').update("Conditions"); new Ajax.Updater($('home_right'),'inc_conditions/condition_view.php', { evalScripts:true, onComplete: function() { } }); } function include(url) { // FONCTION JS PAS PHP => permet l'utilisation du fichier .js par "include('nomdufichier.js')" //Inclusion d'un autre fichier javascript var my_js=document.createElement('script'); my_js.setAttribute('type', 'text/javascript'); my_js.setAttribute('src',url); document.getElementsByTagName('head')[0].appendChild(my_js); } function includeCSS(url) { // FONCTION JS PAS PHP => permet l'utilisation du fichier .CSS par "include('nomdufichier.CSS')" //Inclusion d'une feuille de style css var css_style=document.createElement("link"); css_style.setAttribute("rel", "stylesheet"); css_style.setAttribute("type", "text/css"); css_style.setAttribute("href", url); css_style.setAttribute("media", "screen"); document.getElementsByTagName("head")[0].appendChild(css_style); }