jQuery.noConflict();

jQuery(document).ready(function(){
    var options = {
        zoomWidth: 300,
        zoomHeight: 300,
        xOffset:10,
        yOffset:0,
        preloadText: 'Yükleniyor..'
    };
    
    jQuery("form[class!=ns]").jqTransform();
    
    jQuery(".zoom").jqzoom(options);

    jQuery(".small-pic").click(function()
    {
        ChangeProductPic(jQuery(this).attr('rel'),jQuery(this).attr('w')); 
        jQuery('.zoom').trigger('changeimage');
    });

    jQuery("#ustBanner").cycle({
        fx:'fade'
    });
    
    jQuery("#dp > div.txt").center();
});
function setCookie(c_name,value,expiredays)
{
    var exdate=new Date();
    exdate.setDate(exdate.getDate()+expiredays);
    document.cookie=c_name+ "=" +escape(value)+
    ((expiredays==null) ? "" : ";expires="+exdate.toUTCString())+";path=/eticaret/";
    location=location.href;
}

function regKontrol(pattern, value){ 
    r = new RegExp(pattern, "g"); 
    return r.test(value); 
} 

function haberkntl(){
    patternEposta   = "^"+"([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0-9_\.\-]+)"+"@"+"([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0-9_\.\-]+)"+"[\.]"+"([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0-9_\.\-]+)"+"$"; 

    if (!regKontrol(patternEposta,document.haberkayit.emailadr.value)) { 
        alert("Lütfen Dogru Bir E-posta Adresi Giriniz..");
        document.haberkayit.emailadr.focus();
        return false; 
    } 
    return true;
}

function sepetOku(){
    jQuery.get('sepet.php?show=left', {}, function(data) {
        jQuery("#sepetim").html(data);
    });
}
function urunSil(u) {
    jQuery("#ur"+u).hide(800,function () {
        jQuery(this).remove();
    });

    var did = 'did='+u;
    jQuery.get('sepet.php?act=destroy&show=left', did, function(data) {
        //jQuery("#sepetim").html(data);
    });
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
    if (restore) selObj.selectedIndex=0;
}

function ChangeProductPic(param,w)
{
    var pic = 'urunler/b/'+param;
    var mega = 'urunler/b/'+param;
    jQuery(".zoom").attr('href',mega).children().attr({'src':pic,'style':w});

}
function shareOnFacebook(t,u) 
{
    window.open('http://www.facebook.com/sharer.php?u=' + encodeURIComponent(u)+ '&t=' + encodeURIComponent(t) , 'sharer', 'toolbar=0,status=0,width=626,height=436'); return false;
}
function shareOnFriendFeed(t,u) 
{
    window.open('http://friendfeed.com/share/bookmarklet/frame#url=' + encodeURIComponent(u), 'sharer', 'toolbar=0,status=0,width=626,height=436'); return false;
}
function shareOnTwitter(t,u) 
{
    window.open('http://twitter.com/home?status=' + encodeURIComponent(u), 'sharer', 'toolbar=0,status=0,width=800,height=600'); return false;
}
jQuery.fn.center = function () {
    this.css("position","absolute");
    this.css("top", ((jQuery(window).height() - this.outerHeight()) / 2) + jQuery(window).scrollTop() + "px");
    this.css("left", ((jQuery(window).width() - this.outerWidth()) / 2) + jQuery(window).scrollLeft() + "px");
    return this;
}
