var dialogDiv = null;
var dialogRowId = -1;
var sourceData = [];
var selectedData = {id:0};
var PostUrl=location.href;
if(PostUrl==""){PostUrl="?";}
var $_GET = {};
if ( !$.curCSS ) { $.curCSS = $.css; }
Array.range= function(a, b, step){
var A= [];
if(typeof a== 'number'){
A[0]= a;
step= step || 1;
while(a+step<= b){
A[A.length]= a+= step;
}
}
else{
var s= 'abcdefghijklmnopqrstuvwxyz';
if(a=== a.toUpperCase()){
b=b.toUpperCase();
s= s.toUpperCase();
}
s= s.substring(s.indexOf(a), s.indexOf(b)+ 1);
A= s.split('');
}
return A;
}
document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g, function () {
function decode(s) {
return decodeURIComponent(s.split("+").join(" "));
}
$_GET[decode(arguments[1])] = decode(arguments[2]);
});
function showMessage(msg,title,width,height)
{
var _title = title || "Uyarı";
var _width = width || 500;
var _height = height || 100;
$(".msg_dialog").remove();
$("
"+msg+"
").dialog({
title:_title,
width:_width,
height:_height,
hide: "explode",
modal: true,
});
$( ".msg_dialog" ).parents(".ui-dialog:first").css({ position:"fixed", left:"37%", top:"50%" });
}
function gidenform(form,trigger){
var summary =[];
form.find(':input').each(function () {
if(typeof( $(this).attr("req")) == "undefined"){return;}
req = $(this).attr("req").split("|");
if(req[0]!="")
{
if($(this).val()=="" ||
(req[0]=="checkbox" && !$(this).is(':checked')) ||
(req[0]=="email" && ($(this).val().indexOf("@")==-1 || $(this).val().indexOf(".")==-1 || $(this).val().length<6)) ||
(req[0]=="pass" && $(this).val().length<6) ||
(req[0]=="pass2" && $(this).val()!=form.find("[name='"+req[2]+"']").val()) )
{
new $.flavr(req[1]);
summary.push(1);
var hata=1;
$(this).focus();
return false;
}
}
if(hata==1){
summary.push(1);
}
});
if(summary!=1){
if(typeof($(form).data("submiting")) == "undefined")
{
$(form).data("submiting",1);
if($(form).data("manuel")==true){
$(form).data("afterSubmit",function(params){ $(form).removeData("submiting"); trigger(params); });
$(form)[0].submit();
}else{
$(this).find("[type='submit']").button('loading');
$.post(PostUrl,$(form).serialize(),function(r){
$(form).removeData("submiting");
if(typeof(r.ok) != "undefined")
{
var container = $('body').find('.flavr-container').last();
var instance = container.data('flavr').instance;
if( true == container.hasClass('shown') ) instance.close();
}
if(r.message){$(".flavr-containe").hide(); new $.flavr(r.message);}
if(typeof(trigger)=="function")
{
trigger(r);
}
},"json");
}
}
return false;
}
}
function showpoup(msg,title,width,height)
{
var _title = title || "Uyarı!!";
var _width = width || 500;
var _height = height || 100;
new $.flavr({
title:title,
content :msg,
height:"500px",
closeOverlay : true,
closeEsc : true,
modal : true,
buttonDisplay : 'hide',
});
}
function bookmarksite(title,url){
if(document.all)// ie
{
window.external.AddFavorite(url, title);
}
else if (window.sidebar && window.sidebar.addPanel) // firefox
{
window.sidebar.addPanel(title, url, "");
}
else if(window.opera && window.print){ // opera
var elem = document.createElement('a');
elem.setAttribute('href',url);
elem.setAttribute('title',title);
elem.setAttribute('rel','sidebar');
elem.click();
}
}
function setHomepage(url){
if (document.all)
{
document.body.style.behavior='url(#default#homepage)';
document.body.setHomePage(url);
}
else if (window.sidebar)
{
if(window.netscape)
{
try
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
}
catch(e)
{
alert("Tarayıcınız veya siz bu eyleme izin vermediniz. Üst köşeden Araçlar >> Seçenekler'i tılayın ve gelen penceredeki Konum Satırına adresimizi ("+url+") yazıp Tamam'a basarakta aynı işlevi yerine getirebilirsiniz.");
}
}
var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
prefs.setCharPref('browser.startup.homepage',url);
}
}
function submitForm(form,trigger){
$(form).submit(function(){
$('[type="submit"]').attr("data-loading-text", "Lütfen Bekleyiniz..");
for(var i=0;i '); }
if($("#mainNotice").length==1)
{
$("#mainNotice").append("
");
$("body").append('');
}
$(".clickme").click();
$("#mainNotice").width("auto").css("min-width","auto");
/*
$('.mainNotice').dialog({title:"UYARI",width:500,height:250,buttons:{
"Tekrar Gösterme" : function(){
$.post("?","act=closeNotice");
$(".mainNotice").dialog("close");
},
"Kapat" : function(){
$(".mainNotice").dialog("close");
}
}});
*/
guncelle();
if($(".otherPages").length>0 && $(".otherPages").text()!="")
{
var html = '';
$(".otherPages").html(html);
}
$("#loginform [name=email]").keypress(function(e){ if(e.keyCode==13){ $("#loginform [name=pass]").focus(); } });
$("#loginform [name=pass]").keypress(function(e){ if(e.keyCode==13){ login(); } });
$(document).on("keyup",".integer",function(){ this.value = this.value.replace(/[^0-9]/g,''); });
$(document).on("keyup",".decimal",function(){ this.value = this.value.replace(/,/g,'.').replace(/[^0-9\.]/g,''); });
$('input.field').
focus(function() {
if(this.title==this.value) {
this.value = '';
}
}).
blur(function(){
if(this.value=='') {
this.value = this.title;
}
});
$(document).on("click","a.sonteklif",function(){
var url='http://www.sonteklif.com/guvenli-giris?fp_kullanici='+phpdcData.userData.id+'&fp_urun[]='+$(this).attr("urun")+'&fp_adet_secim[]='+$('.sonteklif_urunadet').val()+'&fp_eposta='+phpdcData.userData.email+'&fp_ad='+phpdcData.userData.adsoyad+'&fp_soyad='+phpdcData.userData.adsoyad+'&fp_token='+phpdcData.sonteklifHash+'&ip='+phpdcData.ip;
open(url,'_blank','');
});
var currentPage = 1;
var sondu = false;
$(".blank_control").each(function(){
var a = $(this).attr("href").replace("http://","").split("/")[0];
var b = location.href.replace("http://","").split("/")[0];
if(a!=b && a!=""){
$(this).attr("target","_blank");
}
});
$("._blank").attr("target","_blank").removeClass("_blank");
$(".border-radius10").css("border-radius","10px");
$(".border-radius5").css("border-radius","5px");
$('.bildirimform select, .bildirimform textarea, .bildirimform input[type="text"], .bildirimform input[type="password"], .iletisimform textarea, .iletisimform input[type="text"], .uyeform input[type="text"], .uyeform input[type="password"]').css({
"padding":"3px",
"font-size":"15px",
"background":"#bcbfc6",
"border-radius":"4px"
});
$('.rating').each(function(a,b){
var sp = parseInt($(b).attr("id").split("_")[1],10);
var i=0;
var html = "";
var cls = "";
for(i=0;i<5;i++)
{
cls = (i>sp-1)?"empty-star":"full-star";
html += ' ';
}
$(b).prepend(html);
});
setTimeout(function(){
if(phpdcData.isLogin)
{
setInterval(function(){ $.post(location.href,'sonuc=kredi',function(r){
if(r.code==1){ $(".kredi").text(r.message); }else{
top.location.replace('anasayfa.html');
}
},"json");
},8000);
$('.memberPanel').show();
$('.login').remove();
$('.iflogin').show();
a=phpdcData.userData.songiris;
if(a!=""){
$('#songiris').html("Son Giris Tarihi: "+a+" ");
$(".songiris").html(a);
}
}else
{
$("li.yorum_yap").remove();
$('.login').show();
if($.cookie("email")!=null){
$("[name=email]").val($.cookie("email"));
}
submitingform($("[name='loginform']"),function(r){
if(r==1)
{
$.cookie("email",$("[name=email]").val(),{expires: 150});
top.location=top.location;
}
if(r.code && r.code==-2)
{
$.cookie("email",$("[name=email]").val(),{expires: 150});
}
});
}
},500);
}
function epara_yukle(f){
var p = "onayla=1&kod="+f.kod.value+"&guvenlik="+f.guvenlik.value;
$.post(location.href,p,function(r){
if($.isNumeric(r) && r>0){
$(".eparaBody").html("TEBRİKLER Mobil Odeme üzerinden hesabınıza "+r+" TL bakiye eklenmiştir.
");
$(".line>strong").text( parseFloat(phpdcData.userData.kredi) + parseFloat(r) );
}else if(r==-1){
showMessage("Güvenlik kodunu hatalı girdiniz.\nLütfen kontrol ediniz.\n\nSorun olması halinde güvenlik resmine tıklayarak yeni kod üretilmesini sağlayabilirsiniz.");
$(".ui-dialog:visible").height(130);
$(".msg_dialog:visible").height("auto");
}else{
showMessage("Geçersiz e-para kodu veya teknik hata oluştu.\nLütfen bilgilerinizi kontrol ediniz.\n\nSorun olması halinde sayfayı yenileyip tekrar deneyiniz.");
$(".ui-dialog:visible").height(130);
$(".msg_dialog:visible").height("auto");
}
});
}
jQuery._parseJSON = jQuery.parseJSON;
jQuery.parseJSON = function( data ) {
if ( !data || typeof data !== "string") {
return null;
}
return jQuery._parseJSON( data );
}
function sepete_ekle(mod,form)
{
var yer =$("#"+form.id);
var id=yer.attr("urunno");
var adet=$("#alan"+id).val();
var uyarı=yer.attr("uyari");
var isim=yer.attr("isim");
var min_alis=yer.attr("min_alis");
var max_alis=yer.attr("max_alis");
var siparis_istekler=jQuery.parseJSON(yer.attr("siparis_istekler"));
var icerik="";
var sepetform=" ";
if(mod==2)
{
var data = form.serializeArray();
$.post("sepet", data, function(r){
if(r.class==2){
new $.flavr(r.islem);
}
},"json");
guncelle();
}
if(siparis_istekler=="" && uyarı==""){
$.post("sepet",{
"durum":'1',
"id":id,
"adet":adet
},function(r){
if(r.class==2){
new $.flavr(r.islem);
}
guncelle();
},"json");
}
if(siparis_istekler!="" && uyarı!=""){
$.each(siparis_istekler,function(a,isim){
if(isim!=""){
var myArray = isim.split('|');
if(!myArray[1]){
var tip="text";
var sablon = '';
}else{
var sablon = '';
}
sablon = sablon.replace(/{isim}/g,myArray[0]);
icerik+=sablon;
$(".sendorder").after(" Sepete Ekle ").remove();
}
});
new $.flavr({
title : isim,
closeOverlay : true,
closeEsc : true,
dialog : 'form',
form : { content: uyarı, method: 'post', },
buttons : {
Sepete : { text:'Devam Et',style: 'success', action: function( $container, $form ){
new $.flavr({
title : isim,
closeOverlay : true,
closeEsc : true,
width :500,
dialog : 'form',
form : { content: icerik+sepetform, method: 'post',id:"sepetform" },
buttons : {
Sepete : { text:'Devam Et',style: 'success', action: function( $container, $form ){
var summary =[];
$form.find(':input').each(function () {
if(typeof( $(this).attr("req")) == "undefined"){return;}
req = $(this).attr("req").split("|");
if(req[0]!="")
{
if($(this).val()=="" ||
(req[0]=="email" && ($(this).val().indexOf("@")==-1 || $(this).val().indexOf(".")==-1 || $(this).val().length<6)) ||
(req[0]=="pass" && $(this).val().length<6) ||
(req[0]=="pass2" && $(this).val()!=form.find("[name='"+req[2]+"']").val()) )
{
new $.flavr(req[1]);
summary.push(1);
var hata=1;
$(this).focus();
return false;
}
}
if(hata==1){
summary.push(1);
}
});
if(summary!=1){
this.hide(); sepete_ekle(2,$form);
}
me.width(500);
return false;
}},
close : { text:'Vazgeç',style: 'danger' }
}
});
}},
close : { text:'Vazgeç',style: 'danger' }
}
});
return false;
}
if(siparis_istekler!=""){
$.each(siparis_istekler,function(a,isim){
if(isim!=""){
var myArray = isim.split('|');
if(!myArray[1]){
var tip="text";
var sablon = '';
}else{
var sablon = '';
}
sablon = sablon.replace(/{isim}/g,myArray[0]);
icerik+=sablon;
$(".sendorder").after(" Sepete Ekle ").remove();
}
});
new $.flavr({
title : isim,
closeOverlay : true,
closeEsc : true,
dialog : 'form',
form : { content: icerik+sepetform, method: 'post',name:"bildirimform" },
buttons : {
Sepete : { text:'Devam Et',style: 'success', action: function( $container, $form ){
var summary =[];
$form.find(':input').each(function () {
if(typeof( $(this).attr("req")) == "undefined"){return;}
req = $(this).attr("req").split("|");
if(req[0]!="")
{
if($(this).val()=="" ||
(req[0]=="email" && ($(this).val().indexOf("@")==-1 || $(this).val().indexOf(".")==-1 || $(this).val().length<6)) ||
(req[0]=="pass" && $(this).val().length<6) ||
(req[0]=="pass2" && $(this).val()!=form.find("[name='"+req[2]+"']").val()) )
{
new $.flavr(req[1]);
summary.push(1);
var hata=1;
$(this).focus();
return false;
}
}
if(hata==1){
summary.push(1);
}
});
if(summary!=1){
this.hide(); sepete_ekle(2,$form);
}
return false;
}},
close : { text:'Vazgeç',style: 'danger' }
}
});
}
if(uyarı!=""){
new $.flavr({
title : isim,
closeOverlay : true,
closeEsc : true,
dialog : 'form',
form : { content: uyarı+sepetform, method: 'post', },
buttons : {
Sepete : { text:'Devam Et',style: 'success', action: function( $container, $form ){
this.hide();
if(siparis_istekler==""){
sepete_ekle(2,$form);
}
}},
close : { text:'Vazgeç',style: 'danger' }
}
});
}
}
$("body").on("click", "#drawbutton", function() {
$("#cekilis-list").toggleClass("active", 500, "easeOutSine");
$("#drawbutton").toggleClass("active", 500, "easeOutSine");
});
$(document).ready(function(){
// external links to new window
$('a[href^="http://"],a[href^="https://"]').not('a[href*=mntgame]').attr('rel','external');
if(typeof(phpdcData)!="undefined"){ onLoad(); }
});