function initDisplayEffects(element) { //list of target elements var list = (element != null) ? $$("#"+element+" .cCollapsible") : $$('.cCollapsible'); //list elements to be clicked on var headings = (element != null) ? $$("#"+element+" .cToggler") : $$('.cToggler'); //array to store all of the collapsibles var collapsibles = new Array(); //TogglesHash = new Hash.Cookie('MenuToggle', {duration: 86400}); headings.each( function(heading, i) { //for each element create a slide effect // var collapsible = new Fx.Slide(list[i], { // duration: 300, // transition: Fx.Transitions.linear // }); //and store it in the array // collapsibles[i] = collapsible; // // //add event listener // heading.removeEvent('click'); // heading.addEvent('click', function(e){ // collapsible.toggle(); // //return false; // }); // //collapse all of the list items // collapsible.hide(); var collapsible = new Fx.Slide(list[i], { duration: 500, transition: Fx.Transitions.linear }); //and store it in the array collapsibles[i] = collapsible; //add event listener heading.onclick = function(){ //open current element collapsible.toggle(); //hide the rest for(var j = 0; j < collapsibles.length; j++){ if(j!=i) collapsibles[j].slideOut(); } return false; } //collapse all of the list items collapsible.hide(); }); } //New Accordeon Collapse Menu Tırtıked By Ahmet function loadAccordion() { var CookieAutoAccordion = Accordion.extend({ initialize: function(togglers, elements, options) { this.options.cookieName = 'collapse-place'; this.options.cookieOptions = {path: '/', duration: 30}; this.setOptions(options); this.options.allowMultipleOpen = false; this.options.opacity = false; this.options.openAll = false; this.options.wait = false; var cookieValue = Cookie.get(this.options.cookieName); if (cookieValue != false) { this.options.show = cookieValue.toInt(); this.addEvent('onActive', function(toggler, element) { //toggler.addClass('webnav_active'); }); } else { this.addEvent('onActive', function(toggler, element) { //toggler.addClass('webnav_active'); }); } this.parent.apply(this, arguments); this.addEvent('onActive', function(toggler, element) { Cookie.set(this.options.cookieName, this.togglers.indexOf(toggler), this.options.cookieOptions); toggler.addClass('mLnk1'); }); this.addEvent('onBackground', function(toggler, element) { if (toggler.hasClass('mLnk1')) { toggler.removeClass('mLnk1'); } }); } }); var accordion = new CookieAutoAccordion($$('a.webnav'), $$('ul.web_content')); } function getRate(photoId,increareViewCount) { new Ajax('index.php?a=_getRate&photoId=' + photoId + '&increareViewCount=' + increareViewCount, { method: 'get', evalScripts:true }).request(); } function rate(photoId, point, userId) { new Ajax('index.php?a=_rate&photoId=' + photoId + '&point=' + point + '&userId=' + userId, { method: 'get', evalScripts:true }).request(); } // ürün resim galerisi fade in function fadeIn () { linkFx = new Fx.Styles('imgDiv', {duration:600, wait:false}); linkFx.start({ 'opacity': [0,1] }) } function imageLoad(photoId) { fadeIn (); new Ajax('imageGet.php?photoId=' + photoId, { method: 'get', update: $('imgDiv') }).request(); } function rateOver(rateIndex) { for(i=1;i<=rateIndex;i++) { $('rateStar'+i).src='img/starOnBlackBg.gif'; } for(i=rateIndex+1;i<=5;i++) { $('rateStar'+i).src='img/starOffBlackBg.gif'; } } window.addEvent('load', function() { new SmoothScroll(); mooWindow = $(window); //initDisplayEffects(); loadAccordion(); }); function promotionEffect() { var list = $$('.promotionIndex'); var linkFx = []; list.each( function(link,i) { link.removeEvent('click'); link.addEvent('click', function(e) { e = new Event(e).stop(); linkFx[i] = new Fx.Styles('promotionBannerImage', {duration:250, wait:false}); updatePromotionBannerIndex(i+1); linkFx[i].start({ 'opacity': [1,0] }).chain(function() { $('promotionBannerImage').src = link.getProperty('imgSrc'); linkFx[i].start({ 'opacity': [0,1] }); }); }); }); } function updatePromotionBannerIndex(i) { $each($('promotionIndexContainer').childNodes, function(item_) { item_.setStyle('background-image','url(img/bannerIndexBgPassive.gif)'); item_.setStyle('color','#fff'); }); $('promotionIndexContainer').childNodes[i-1].setStyle('background-image','url(img/bannerIndexBgActive.gif)'); $('promotionIndexContainer').childNodes[i-1].setStyle('color','#212121'); //$('promotionContainerText').setText($('promotionIndexContainer').childNodes[i-1].getAttribute('promoText')); $('promotionLink').href = $('promotionIndexContainer').childNodes[i-1].getAttribute('linkUrl'); }