function Manuspecs() { this.initialize(); } Manuspecs.prototype.initialize = function() { this.makeSameHeight(); this.showMore(); }; Manuspecs.prototype.makeSameHeight = function() { if(!$j('.manuspecs_image img').length) { $j('.manuspecs_image')[0].style.height = '220px'; $j('.manuspecs_image').append(html.img(PageInfo.getParam('spacer'))); } UI.MakeSameHeight('manuspecs_image', 'manuspecs_text', 'manuspecs_image', 230); }; Manuspecs.prototype.showMore = function() { var manuspecs_more = $j('#manuspecs_more'); if(!manuspecs_more.length) { var str = html.div( '', { style: 'height: 1px; clear: both' } ); str += html.span( this.getMoreText('more'), { id: 'manuspecs_more', onclick: 'manuspecs.toggleMore()' } ); str = html.div(str, {style: 'display: inline-block; margin-top: 0; margin-' + (PageInfo.boolRTL ? 'right' : 'left') + ': 20px'}); var origHeight = $j.data($j('.manuspecs_text')[0], 'original_height'); var currentHeight = $j('.manuspecs_text')[0].offsetHeight; if(origHeight > currentHeight) { $j('.manuspecs_container').append(str); this.setTogglerImage('down'); } if(origHeight <= 220) { $j('#manuspecs_gradient').hide(); } //alert($j('#manuspecs_more')[0].offsetWidth); } }; Manuspecs.prototype.toggleMore = function() { var origHeight = $j.data($j('.manuspecs_text')[0], 'original_height'); var currentHeight = $j('.manuspecs_text')[0].offsetHeight; if(origHeight > currentHeight) { $j('#manuspecs_gradient').hide(); $j('.manuspecs_text')[0].style.height = ''; $j('#manuspecs_more').html(this.getMoreText('less')); this.setTogglerImage('up'); } else { if(origHeight >= 220) { $j('#manuspecs_gradient').show(); } else { $j('#manuspecs_gradient').hide(); } this.makeSameHeight(); $j('#manuspecs_more').html(this.getMoreText('more')); this.setTogglerImage('down'); } }; Manuspecs.prototype.getMoreText = function(id) { return PageInfo.getText(id); }; Manuspecs.prototype.setTogglerImage = function(direction) { $j('#manuspecs_more').css('background', this.getTogglerImageCss(direction)); }; Manuspecs.prototype.getTogglerImageCss = function(direction) { return 'url(' + PageInfo.GFXPath + 'ver2/' + direction + '_arrow_blue.png) no-repeat scroll ' + (PageInfo.boolRTL ? '0%' : '100%') + ' 50% transparent'; }; $j(document).ready(function() { window.manuspecs = new Manuspecs(); }); function fnSetItemSlider(arrParams){ if (!$(arrParams.rotationObject)) { return; } /** Created By Amir Saleh Sample Params Array var arrParams = { "rotationObject":"more_results", "btnNextElement":"mr_up_arrow", "btnBackElement":"mr_down_arrow", "btnNextClassName":"mr_up_ar", "btnNextDisabledClassName":"mr_up_disabled", "btnBackClassName":"mr_down_ar", "btnBackDisabledClassName":"mr_down_disabled", "MaxResults":75, "MaxStep":24, "StepLength":699 }; **/ $(arrParams.rotationObject).current_step=0; $(arrParams.rotationObject).max_results=arrParams.MaxResults; $(arrParams.rotationObject).max_step=arrParams.MaxStep; $(arrParams.rotationObject).scrolling=0; $(arrParams.rotationObject).scrollingy=0; $(arrParams.rotationObject).mr_intervalID; $(arrParams.rotationObject).scrollingspeed=20; $(arrParams.rotationObject).step_length=arrParams.StepLength; $(arrParams.rotationObject).m_opacity=1; $(arrParams.rotationObject).opacity_speed=0.1; $(arrParams.rotationObject).scrolling=false; $(arrParams.rotationObject).btnNextClassName=arrParams.btnNextClassName?arrParams.btnNextClassName:'mr_up_ar'; $(arrParams.rotationObject).btnBackClassName=arrParams.btnBackClassName?arrParams.btnBackClassName:'mr_down_ar'; if(arrParams.MaxStep > 0) { $(arrParams.rotationObject).btnNextDisabledClassName=arrParams.btnNextDisabledClassName?arrParams.btnNextDisabledClassName:'mr_up_disabled'; $(arrParams.rotationObject).btnBackDisabledClassName=arrParams.btnBackDisabledClassName?arrParams.btnBackDisabledClassName:'mr_down_disabled'; } if($(arrParams.rotationObject).max_step<1){ $(arrParams.btnNextElement).className=$(arrParams.rotationObject).btnNextDisabledClassName; $(arrParams.btnBackElement).className=$(arrParams.rotationObject).btnBackDisabledClassName; } $(arrParams.btnNextElement).onclick=function(){if(!$(arrParams.rotationObject).scrolling) $(arrParams.rotationObject).mr_go(1);}; $(arrParams.btnBackElement).onclick=function(){if(!$(arrParams.rotationObject).scrolling) $(arrParams.rotationObject).mr_go(-1);}; $(arrParams.rotationObject).fade_scroller = function (dir){ $(arrParams.rotationObject).use_step=$(arrParams.rotationObject).current_step+(-1*dir); if($(arrParams.rotationObject).current_step<0){ $(arrParams.rotationObject).step=-1*$(arrParams.rotationObject).current_step; } else { $(arrParams.rotationObject).step=$(arrParams.rotationObject).current_step; } $(arrParams.rotationObject).step=$(arrParams.rotationObject).step*3+1; $(arrParams.rotationObject).step2=$(arrParams.rotationObject).step+2; if($(arrParams.rotationObject).step2>$(arrParams.rotationObject).max_results){ $(arrParams.rotationObject).step2=$(arrParams.rotationObject).max_results; } // $('paging_for_items').innerHTML= step + ' - '+ step2; if($(arrParams.rotationObject).max_step>1 && document.getElementById('paging_for_items')) { $('paging_for_items').innerHTML= $(arrParams.rotationObject).step + ' - '+ $(arrParams.rotationObject).step2; } clearInterval($(arrParams.rotationObject).mr_intervalID); newOffset=(($(arrParams.rotationObject).use_step*$(arrParams.rotationObject).step_length)+dir*$(arrParams.rotationObject).step_length)+'px'; if (PageInfo.boolRTL) { $(arrParams.rotationObject).style.right=newOffset; } else { $(arrParams.rotationObject).style.left=newOffset; } $(arrParams.rotationObject).scrollingy=0; if($(arrParams.rotationObject).current_step<0){ $(arrParams.btnNextElement).className=$(arrParams.rotationObject).btnNextClassName; } else { $(arrParams.btnNextElement).className=$(arrParams.rotationObject).btnNextDisabledClassName; } if($(arrParams.rotationObject).current_step<=(-$(arrParams.rotationObject).max_step)){ $(arrParams.btnBackElement).className=$(arrParams.rotationObject).btnBackDisabledClassName; } else { $(arrParams.btnBackElement).className=$(arrParams.rotationObject).btnBackClassName; } } $(arrParams.rotationObject).fnFadeOut=function (dir){ $(arrParams.rotationObject).m_opacity=$(arrParams.rotationObject).m_opacity-$(arrParams.rotationObject).opacity_speed; if($(arrParams.rotationObject).m_opacity<0){ $(arrParams.rotationObject).m_opacity=0; Common.fnSetOpacity(arrParams.rotationObject,$(arrParams.rotationObject).m_opacity) $(arrParams.rotationObject).fade_scroller(dir); clearInterval($(arrParams.rotationObject).mr_intervalID); $(arrParams.rotationObject).mr_intervalID=setInterval("$('"+arrParams.rotationObject+"').fnFadeIn("+dir+")",50); } else { Common.fnSetOpacity(arrParams.rotationObject,$(arrParams.rotationObject).m_opacity) } } $(arrParams.rotationObject).fnFadeIn = function (dir){ $(arrParams.rotationObject).m_opacity+=$(arrParams.rotationObject).opacity_speed; if($(arrParams.rotationObject).m_opacity>1){ $(arrParams.rotationObject).m_opacity=1; Common.fnSetOpacity(arrParams.rotationObject,$(arrParams.rotationObject).m_opacity) $(arrParams.rotationObject).scrolling=0; clearInterval($(arrParams.rotationObject).mr_intervalID); } else { Common.fnSetOpacity(arrParams.rotationObject,$(arrParams.rotationObject).m_opacity) } } $(arrParams.rotationObject).mr_go=function(dir){ if($(arrParams.rotationObject).max_step<1){ return 1; } if($(arrParams.rotationObject).scrolling) return; if($(arrParams.rotationObject).current_step==0 && dir==1) { return; } if($(arrParams.rotationObject).current_step==(-$(arrParams.rotationObject).max_step) && dir==-1) { return; } $(arrParams.rotationObject).scrolling=1; $(arrParams.rotationObject).current_step=$(arrParams.rotationObject).current_step+dir; if(Common.Browser.is_ff()){ $(arrParams.rotationObject).mr_intervalID=setInterval("$('"+arrParams.rotationObject+"').fnFadeOut("+dir+")",50); } else { $(arrParams.rotationObject).mr_intervalID=setInterval("$('"+arrParams.rotationObject+"').mr_scrolltop("+dir+")",10); } } $(arrParams.rotationObject).mr_scrolltop= function (dir){ $(arrParams.rotationObject).use_step=$(arrParams.rotationObject).current_step+(-1*dir); $(arrParams.rotationObject).scrollingy+=$(arrParams.rotationObject).scrollingspeed; if($(arrParams.rotationObject).scrollingy>$(arrParams.rotationObject).step_length-$(arrParams.rotationObject).scrollingspeed){ if($(arrParams.rotationObject).current_step<0){ $(arrParams.rotationObject).step=-1*$(arrParams.rotationObject).current_step; } else { $(arrParams.rotationObject).step=$(arrParams.rotationObject).current_step; } $(arrParams.rotationObject).step=$(arrParams.rotationObject).step*3+1; $(arrParams.rotationObject).step2=$(arrParams.rotationObject).step+2; if($(arrParams.rotationObject).step2>$(arrParams.rotationObject).max_results){ $(arrParams.rotationObject).step2=$(arrParams.rotationObject).max_results; } if($(arrParams.rotationObject).max_step>1 && document.getElementById('paging_for_items')) { $('paging_for_items').innerHTML= $(arrParams.rotationObject).step + ' - '+ $(arrParams.rotationObject).step2; } clearInterval($(arrParams.rotationObject).mr_intervalID); newOffset=(($(arrParams.rotationObject).use_step*$(arrParams.rotationObject).step_length)+dir*$(arrParams.rotationObject).step_length)+'px'; if (PageInfo.boolRTL) { $(arrParams.rotationObject).style.right=newOffset; } else { $(arrParams.rotationObject).style.left=newOffset; } $(arrParams.rotationObject).scrollingy=0; $(arrParams.rotationObject).scrolling=0; if($(arrParams.rotationObject).current_step<0){ $(arrParams.btnNextElement).className=$(arrParams.rotationObject).btnNextClassName; } else { $(arrParams.btnNextElement).className=$(arrParams.rotationObject).btnNextDisabledClassName; } if($(arrParams.rotationObject).current_step<=(-$(arrParams.rotationObject).max_step)){ $(arrParams.btnBackElement).className=$(arrParams.rotationObject).btnBackDisabledClassName; } else { $(arrParams.btnBackElement).className=$(arrParams.rotationObject).btnBackClassName; } } else { newOffset = (($(arrParams.rotationObject).use_step*$(arrParams.rotationObject).step_length)+dir*$(arrParams.rotationObject).scrollingy)+'px'; if (PageInfo.boolRTL) { $(arrParams.rotationObject).style.right=newOffset; } else { $(arrParams.rotationObject).style.left=newOffset; } } } }