$(document).ready(function(){$('#leftMenuList li').click(function(e){e.stopPropagation();$t=$(this);$_x=$('div#leftMenuDiv');$x1=parseInt($_x.height());if($('#_'+$t.attr('id')).css('display')=='none')$('#_'+$t.attr('id')).show();else $('#_'+$t.attr('id')).hide();$x2=parseInt($_x.height())});$('#nextNews').click(function(){nextNews()});$('#prevNews').click(function(){prevNews()});var prevNews=function(){$('#nextNews').unbind();$('#prevNews').unbind();$($("#newsContainer3").children()[0]).animate({marginLeft:-378},1000,"linear",function(){$($("#newsContainer3").children()[0]).css("margin-left",0);$("#newsContainer3").append($($("#newsContainer3").children()[0]));$('#nextNews').bind('click',nextNews);$('#prevNews').bind('click',prevNews)})};var nextNews=function(){$('#nextNews').unbind();$('#prevNews').unbind();newsCount=$("#newsContainer3").children().length;$("#newsContainer3").prepend($($("#newsContainer3").children()[newsCount-1]).css('margin-left',-378));$($("#newsContainer3").children()[0]).animate({marginLeft:0},1000,"linear",function(){$($("#newsContainer3").children()[0]).css("margin-left",0);$('#nextNews').bind('click',nextNews);$('#prevNews').bind('click',prevNews)})};$('#changeOrderBy').change(function(){document.location=_ROOT+$('#chLink').val()+'/'+$(':selected','#changeOrderBy').val()});$('#welcomeLeft').hover(function(){$('#userMenu').show()},function(){$('#userMenu').hide()});$('._dpd').click(function(){$('div[id^="_dp"]').hide();$('#_dp'+$(this).val()).show()});$('._ipd').click(function(){$('div[id^="_ip"]').hide();$('#_ip'+$(this).val()).show()});$('.pyty').click(function(){$selected=$(':checked').val();$('div[id^="paymentType_"]').hide();$('#paymentType_'+$selected).show();if($selected=='bankEFT'){$('#cardInfo').hide();$('#eftInfo').show()}else{$('#cardInfo').show();$('#eftInfo').hide()}});$('#contactForm').submit(function(){$i=$('#contactLoader');$d=$('#contactInfo');$d.hide();e=0;$('#name, #email, #categoryId, #message').each(function(){$t=$(this);if($.trim($t.val())==''||$.trim($t.val())==0){$t.addClass('redBorder');e++}else $t.removeClass('redBorder')});if(e>0){$d.attr('class','infoError').html('Lütfen zorunlu alanları doldurunuz.').show();return false}$.ajax({type:'POST',url:_ROOT2+'/site/iletisim',data:$('#contactForm').serialize()+'&t='+_t,beforeSend:function(){$i.show()},success:function(_return){var response=_return.split('|||');$i.hide();if(response[0]=='ok')$d.attr('class','infoOkey').html(response[1]).show();else if(response[0]=='error')$d.attr('class','infoError').html(response[1]).show()},error:function(html){$i.hide();$d.attr('class','infoError').html('Bir hata meydana geldi! Lütfen tekrar deneyiniz.').show()}})});$('#q1').focus(function(){$t=$(this);if($.trim($t.val())=='arama...')$t.val('')}).blur(function(){$t=$(this);if($.trim($t.val())=='')$t.val($('#q1h').val())});$('#topSearchForm').submit(function(e){$q=$('#q1');$qv=$.trim($q.val());if($qv=='arama...'||$qv.length<3){alert('Lütfen en az 3 karakter giriniz!');$q.focus();return false}else document.location=_ROOT+'/arama/'+encodeURI($qv)});$('#searchForm').submit(function(){$q=$('#q2');$qv=$.trim($q.val());if($qv=='arama...'||$qv.length<3){alert('Lütfen en az 3 karakter giriniz!');$q.focus();return false}advancedSearch('n')});$('.proTabs li').hover(function(){$(this).addClass('liHover')},function(){if($('#_'+$(this).attr('id')).css('display')=='none')$(this).removeClass('liHover')});$('#addBasketButton').click(function(){$.ajax({type:'POST',url:_ROOT2+'/sepete-ekle',data:'pId='+encodeURIComponent($('#proIdIn').val())+'&t='+_t,beforeSend:function(){$('#basketTopDiv').html('<img src="/images/loader3.gif" align="left" /><strong>&nbsp;&nbsp;Ürün sepete ekleniyor</strong>').show()},success:function(_return){var response=_return.split('|||');if(response[0]=='ok'){$('#basketTopDiv').html(response[1]);$('#topBasket').html('Sepetim ('+response[2]+')')}else if(response[0]=='error')$('#basketTopDiv').html('<div class="basketError">'+response[1]+'</div>')},error:function(html){$('#basketTopDiv').html('<div class="basketError">Bir hata meydana geldi! Lütfen tekrar deneyiniz</div>')}})});$('#addCompareListButton').click(function(){$.ajax({type:'POST',url:_ROOT2+'/karsilastir',data:'pId='+encodeURIComponent($('#proIdIn').val())+'&type=add&t='+_t,beforeSend:function(){$('#compareTopDiv').html('<img src="'+_ROOT2+'/images/loader3.gif" align="left" /><strong>&nbsp;&nbsp;Ürün karşılaştırma listesine ekleniyor</strong>').show()},success:function(_return){var response=_return.split('|||');if(response[0]=='ok'){$('#compareTopDiv').html(response[1]);$('#topCompare').html('Karşılaştırdıklarım ('+response[2]+')')}else if(response[0]=='error')$('#compareTopDiv').html('<div class="basketError">'+response[1]+'</div>')},error:function(html){$('#compareTopDiv').html('<div class="basketError">Bir hata meydana geldi! Lütfen tekrar deneyiniz</div>')}})});$('#topBasket').click(function(){$b=$('#basketTopDiv');$.ajax({type:'GET',url:_ROOT2+'/sepeti-goruntule',beforeSend:function(){$b.html('<img src="/images/loader3.gif" align="left" /><strong>&nbsp;&nbsp;Sepet bilgileri yükleniyor</strong>').show()},success:function(_return){var response=_return.split('|||');$b.html(response[0]).show();$('#topBasket').html('Sepetim ('+response[1]+')')},error:function(html){$b.html('<div class="basketError">Bir hata meydana geldi! Lütfen tekrar deneyiniz</div>').show()}})});$('#topCompare').click(function(){$c=$('#compareTopDiv');$.ajax({type:'POST',url:_ROOT2+'/karsilastir',data:'type=get&t='+_t,beforeSend:function(){$c.html('<img src="/images/loader3.gif" align="left" /><strong>&nbsp;&nbsp;Karşılaştırma listesi yükleniyor</strong>').show()},success:function(_return){var response=_return.split('|||');$c.html(response[1]).show();$('#topCompare').html('Karşılaştırdıklarım ('+response[2]+')')},error:function(html){$c.html('<div class="basketError">Bir hata meydana geldi! Lütfen tekrar deneyiniz</div>').show()}})});$('#forgotPasswordForm').submit(function(e){$x=$('#femail');$email=$.trim($x.val());if($email==''){$x.addClass('redBorder');return false}$x.removeClass('redBorder');$b=$('#femailButton');$b.attr('disabled','disabled');$.ajax({type:"POST",data:'femail='+$email+'&t='+_t,url:_ROOTS+'/uye/sifre-hatirlat',beforeSend:function(){$('#femailLoader').show();$('#femailInfo').hide()},success:function(_return){var response=_return.split('|||');if(response[0]=='error')$('#femailInfo').html(response[1]).attr('class','infoError').show();else if(response[0]=='ok')$('#femailInfo').html(response[1]).attr('class','infoOkey').show();$('#femailLoader').hide();$b.removeAttr('disabled')},error:function(html){$('#femailInfo').html('Bir hata meydana geldi! Lütfen tekrar deneyiniz').attr('class','infoError').show();$b.removeAttr('disabled')}})});$('#activationEmailForm').submit(function(e){$x=$('#aemail');$email=$.trim($x.val());if($email==''){$x.addClass('redBorder');return false}$x.removeClass('redBorder');$b=$('#aemailButton');$b.attr('disabled','disabled');$.ajax({type:"POST",data:'aemail='+$email+'&t='+_t,url:_ROOTS+'/uye/aktivasyon-istek',beforeSend:function(){$('#aemailLoader').show();$('#aemailInfo').hide()},success:function(_return){var response=_return.split('|||');if(response[0]=='error')$('#aemailInfo').html(response[1]).attr('class','infoError').show();else if(response[0]=='ok')$('#aemailInfo').html(response[1]).attr('class','infoOkey').show();$('#aemailLoader').hide();$b.removeAttr('disabled')},error:function(html){$('#aemailInfo').html('Bir hata meydana geldi! Lütfen tekrar deneyiniz').attr('class','infoError').show();$b.removeAttr('disabled')}})})});function advancedSearch(_x){if(_x=='n'){_o='a-dan-z-ye';_p=1;_i=$('#searchLoader1')}else if(_x=='c'){_o=$('#changeSearchOrderBy').val();_p=1;_i=$('#searchLoader2')}else{_o=$('#changeSearchOrderBy').val();_p=parseInt(_x);_i=$('#searchLoader3')}$.ajax({type:'POST',url:_ROOT+'/arama',data:$('#searchForm').serialize()+'&o='+_o+'&p='+_p+'&t='+_t,beforeSend:function(){_i.css('visibility','visible')},success:function(_return){_i.css('visibility','hidden');$('#searchResultsDiv').html(_return)},error:function(html){_i.css('visibility','hidden');$('#searchResultsDiv').html('<strong>Bir hata meydana geldi! Lütfen tekrar deneyiniz</strong>')}})}function newP(_type){$f=$('#npForm');$b=$('#npButton');$l=$('#npLoader');$i=$('#npInfo');$data=$f.serialize()+'&np=1&t='+_t;if(_type=='d')$url=_ROOTS+'/uye/teslimat-profilleri';else if(_type=='i')$url=_ROOTS+'/uye/fatura-profilleri';$b.attr('disabled','disabled');$.ajax({type:"POST",data:$data,url:$url,beforeSend:function(){$l.show()},success:function(_return){var response=_return.split('|||');if(response[0]=='error')$i.html(response[1]).attr('class','infoError').show();else if(response[0]=='ok'){$i.html('Yeni profil başarıyla eklendi').attr('class','infoOkey').show();$('#pList').append(response[1]);$('#nodp').remove();$('input:text, textarea',$f).val('');$('input:radio',$f).removeAttr('checked')}$b.removeAttr('disabled');$l.hide()},error:function(html){$i.html('Bir hata meydana geldi! Lütfen tekrar deneyiniz.').attr('class','infoError').show();$b.removeAttr('disabled');$l.hide()}})}function mutatioP(_pid,_type){if(!_type)_type=1;$('#epInfo'+_pid).hide();$f=$('#epForm'+_pid);if(_type==1){if($f.css('display')=='none')$f.show();else $f.hide()}else if(_type==2)$f.hide()}function deleteP(_pid,_type){if(confirm('Bu profili silmek istediğinizden emin misiniz?')){if(_type=='d'){$url=_ROOTS+'/uye/teslimat-profilleri';var _type2='teslimat'}else if(_type=='i'){$url=_ROOTS+'/uye/fatura-profilleri';var _type2='fatura'}$.ajax({type:"POST",data:'id='+_pid+'&dp=1&t='+_t,url:$url,beforeSend:function(){$('#pLinks'+_pid).prepend('<img src="/images/loader38.gif" align="absmiddle" />&nbsp;&nbsp;')},success:function(_return){var response=_return.split('|||');if(response[0]=='error')alert(response[1]);else if(response[0]=='ok'){var order=parseInt($('#pOrder'+_pid).text());$('.pOrder').each(function(){var old=parseInt($(this).text());if(old>order)$(this).text(old-1)});$('#pDiv'+_pid).remove();if($('.pOrder').size()<1)$('#pList').html('<div id="nodp" class="infoError">Hesabınızda kayıtlı herhangi bir '+_type2+' profili bulunmamaktadır!</div>')}},error:function(){alert('Bir hata meydana geldi! Lütfen tekrar deneyiniz.')}})}}function editP(_pid,_type){$f=$('#epForm'+_pid);$b=$('#epButton'+_pid);$l=$('#epLoader'+_pid);$i=$('#epInfo'+_pid);$data=$f.serialize()+'&ep=1&id='+_pid+'&t='+_t;if(_type=='d')$url=_ROOTS+'/uye/teslimat-profilleri';else if(_type=='i')$url=_ROOTS+'/uye/fatura-profilleri';$b.attr('disabled','disabled');$.ajax({type:"POST",data:$data,url:$url,beforeSend:function(){$l.show()},success:function(_return){var response=_return.split('|||');if(response[0]=='error')$i.html(response[1]).attr('class','infoError').show();else if(response[0]=='ok'){$i.html('Bilgiler başarıyla güncellendi').attr('class','infoOkey').show();$('#pp'+_pid).text($('#profile',$f).val())}$b.removeAttr('disabled');$l.hide()},error:function(html){$i.html('Bir hata meydana geldi! Lütfen tekrar deneyiniz.').attr('class','infoError').show();$b.removeAttr('disabled');$l.hide()}})}function favorites(_type,_pId,_w){if(!_w)_w=1;if(_type=='add')$b=$('#addFavoriteButton');else $b=$('#removeFavoriteButton');$i=$('#fbi_'+_pId);$b.attr('disabled','disabled');$.ajax({type:"POST",data:'type='+_type+'&t='+_t+'&id='+_pId,url:_ROOT+'/uye/favoriler',beforeSend:function(){$i.css('visibility','visible')},success:function(_return){var response=_return.split('|||');if(response[0]=='error')alert();else if(response[0]=='ok'){if(_type=='add'){$b.hide();$('#removeFavoriteButton').show()}else if(_type=='remove'){if(_w==1){$b.hide();$('#addFavoriteButton').show()}else $('#li_'+_pId).hide()}}$i.css('visibility','hidden');$b.removeAttr('disabled')},error:function(html){$i.css('visibility','hidden');$b.removeAttr('disabled');alert('Bir hata meydana geldi! Lütfen tekrar deneyiniz')}})}function pTab(_id){$('.proTabs li').removeClass('liHover');$('#t'+_id).addClass('liHover');$('div[id^="_t"]').hide();$('#_t'+_id).show();if(_id!=1&&$('#_t'+_id+' .div11').length>0){_url=_ROOT+'/urun/resim-listele';if(_id==3)_url=_ROOT+'/urun/video-listele';else if(_id==4)_url=_ROOT+'/urun/taksit-listele';$.ajax({type:"POST",data:'t='+_t+'&pId='+$('#pIdIn').val(),url:_url,success:function(_return){var response=_return.split('|||');if(response[0]=='ok')$('#_t'+_id).html(response[1]).attr('class','proTab');else if(response[0]=='error')$('#_t'+_id).html(response[1]).attr('class','infoError')},error:function(html){$('#_t'+id).html('Bir hata meydana geldi! Lütfen tekrar deneyiniz').attr('class','info_error')}})}}function getImage(_id){if($('img[id^="im_"]').attr('id').substr(3)!=_id){$.ajax({type:"POST",data:'t='+_t+'&pId='+$('#pIdIn').val()+'&id='+_id,url:_ROOT+'/urun/resim-detay',beforeSend:function(){$('#proImgDetail').hide();$('#proImgLoader').show()},success:function(_return){$('#proImgLoader').hide();$('#proImgDetail').html(_return).show()},error:function(html){$('#proImgLoader').hide();$('#proImgDetail').show();alert('Bir hata meydana geldi! Lütfen tekrar deneyiniz')}})}}function removeBasket(productId){$.ajax({type:'POST',url:_ROOT2+'/sepetten-cikar',data:'pId='+encodeURIComponent(productId)+'&t='+_t,beforeSend:function(){$('#r_'+productId).attr('src','/images/loader3.gif')},success:function(_return){var response=_return.split('|||');if(response[0]=='error'){$('#r_'+productId).attr('src','/images/iconRemove1.gif');alert(response[1])}else if(response[0]=='ok'){$('#basketTopDiv').html(response[1]);$('#topBasket').html('Sepetim ('+response[2]+')')}},error:function(html){$('#r_'+productId).attr('src','/images/iconRemove1.gif');alert('Bir hata meydana geldi! Lütfen tekrar deneyiniz')}})}function compare(_id){var $x=$(':checked','#compareForm'+_id);if($x.length<2)alert('Lütfen en az 2 adet ürün seçiniz');else{var q='';$x.each(function(){q+=$(this).val()+'|'});document.location=_ROOT+'/karsilastir/'+_id+'/'+q}}function abscondo(e1){$('#'+e1).hide()}function inclino(){$('#prevNews').click();setTimeout("inclino()",10000)}inclino();function inclino2(_id){$(document).ready(function(){$t=$('#c'+_id);$('#mainCamList1 li').hide();$('#_'+$t.attr('id')).show();$('#mainCamList2 a').removeClass('ahover');$t.addClass('ahover')})}function inclino3(_id){inclino2(_id);_id++;if(_id>5)_id=1;setTimeout("inclino3('"+_id+"')",10000)}inclino3('1');function popup(_url,_w,_h){_top=($(window).height()-_h)/2;_left=($(window).width()-_w)/2;window.open(_ROOT+'/'+_url,'tech'+Math.floor(Math.random()*100),'width='+_w+'px, height='+_h+'px, top='+_top+'px, left='+_left+'px, scrollbars=0, menubar=0, resizable=0')}function mutatio(e1){var $x=$('#'+e1);if($x.css('display')=='none')$x.show();else $x.hide()}