/****************************************************************************** * Module: custom.js.php * Author: Bmalloc Studio * Email: support@bmalloc.com * Web: http://www.bmalloc.com (Bmalloc Studio) * Date: Oct 04, 07 * Purpose: * Modified History: null *******************************************************************************/ function auto_tip_load(){ if(auto_tip_i >= auto_tip_max) auto_tip_i = 0; $('design_tip_contents_up').innerHTML = tip_contents[auto_tip_i]; $('design_tip_contents_down').innerHTML = tip_contents[auto_tip_i+1]; new Effect.SlideUp('design_tip_contents_up', {duration: 1.5, scaleFrom: 100, scaleTo: 5}); new Effect.SlideDown('design_tip_contents_down', {duration: 1.5, scaleFrom: 100, scaleTo: 100}); auto_tip_i++; auto_tip_timer = setTimeout("auto_tip_load()",12000); } function stop_timer(timer){ if(timer != null) clearTimeout(timer); } function load_home(page){ var opt = { postBody:'q=home', onSuccess: function(t){ $('main_content').innerHTML = t.responseText; auto_tip_load(); } } new Ajax.Request('/request.php', opt); } function load_page(page){ new Ajax.Updater('main_content', '/request.php', {postBody:'q=' + page}); } /** Handles history change events. */ function handleHistoryChange(newLocation, historyData) { // if there is no location then display // the default, which is the inbox if (newLocation == "") { newLocation = "home"; } // update the browser to respond to this // DHTML history change displayLocation(newLocation, historyData); } /** Displays the given location in the right-hand side content area. */ function displayLocation(newLocation, sectionData) { /* alert(newLocation); alert(sectionData); */ var funcs = { home: load_home, services: load_page, custom_pd: load_page, resellers: load_page, about_us: load_page, contact_us: load_page, members: load_page } funcs[newLocation](newLocation); } function switch_page(id){ dhtmlHistory.add(id, null); displayLocation(id, null); } function popup(page, width, height){ var yScrolltop; if (self.pageYOffset) { yScrolltop = self.pageYOffset; } else if (document.documentElement && document.documentElement.scrollTop){ // Explorer 6 Strict yScrolltop = document.documentElement.scrollTop; }else if (document.body) {// all other Explorers yScrolltop = document.body.scrollTop; } var middle = screen.width/2; var left_pos = middle - width/2; $('popup').setStyle({ height: height + 'px', width: width + 'px', left: left_pos + 'px', top: yScrolltop+25 + 'px' }); var opt = { from:1.0, to: 0.3, afterFinish: function(){ new Ajax.Updater('popup_content', '/request.php', {postBody: 'q=' + page}); new Effect.Appear('popup'); new Draggable('popup'); } }; new Effect.Opacity('box', opt); } function close_popup(){ var opt = { from: 0.3, to: 1.0 } new Effect.Fade('popup', {afterFinish: function(){ new Effect.Appear('box', opt)}}); } function change_list_box_color(color_class){ $('list_box').immediateDescendants().each(function(s){ s.className = 'layout ' + color_class; }); } function auto_load_custom_images(){ if(auto_custom_i > auto_custom_max) auto_custom_i=0; $('custom_images').innerHTML = ""; var effects = [ Effect.Fade, Effect.SlideUp, Effect.DropOut]; new effects[auto_custom_i%3]('custom_images', {afterFinish: function(){ auto_custom_i++; $('custom_images').innerHTML = ""; new Effect.Appear('custom_images', {delay:1}); }, duration: 2 }); setTimeout("auto_load_custom_images()",10000); }