/*-------------------------------------------------------------------------*/ // D21-Sliding Menu Affect // 2005 Dean (D-Scripting) /*-------------------------------------------------------------------------*/ var menu_slide = true; var menu_slide_close = true; var menu_slide_int = 0; var menu_slide_speed = 15; var menu_slide_timer; function d21_sma_initiate_slide_open(id) { var obj = document.getElementById(id); menu_slide_int = Math.ceil(obj.offsetHeight / menu_slide_speed); d21_sma_slide_da_menu(obj.id, 0, false); } function d21_sma_initiate_slide_close(id) { var obj = document.getElementById(id); menu_slide_int = Math.ceil(obj.offsetHeight / menu_slide_speed); d21_sma_slide_da_menu(obj.id, obj.offsetHeight, true); } function d21_sma_slide_da_menu(id, h, r) { var o = document.getElementById(id); var r = (typeof(r) != 'undefined' && r == true) ? true : false; if (r) { if (h > 0) { h -= menu_slide_int; o.style.clip = 'rect(auto, auto, '+h+'px, auto)'; menu_slide_timer = setTimeout("d21_sma_slide_da_menu('"+id+"', "+h+", "+r+");", 0); } else { d21_sma_stop_sliding(id, r); } } else { if (h < o.offsetHeight) { h += menu_slide_int; o.style.clip = 'rect(auto, auto, '+h+'px, auto)'; menu_slide_timer = setTimeout("d21_sma_slide_da_menu('"+id+"', "+h+", "+r+");", 0); } else { d21_sma_stop_sliding(id, r); } } } function d21_sma_stop_sliding(id, r) { clearTimeout(menu_slide_timer); if (r) { document.getElementById(id).style.display = 'none'; } else { document.getElementById(id).style.clip = 'rect(auto, auto, auto, auto)'; } }