$(document).ready(function(){
    $("#tooltip").hide();
    $(".product_image").mousemove(function(e){
        $("#tooltip img").attr("src", $("img", this).attr("src"));
        $("#tooltip").show();
        $("#tooltip").css({
            top: (e.pageY + 15) + "px",
            left: (e.pageX + 15) + "px"
        });
    });
    $(".product_image").mouseout(function(e){
        $("#tooltip").hide();
    });
	$('a[rel="news_images"]').colorbox({
	    'maxWidth': '90%',
	    'maxHeight': '90%'
	}); 
	$('a[rel="address"]').colorbox({
	    'maxWidth': '90%',
	    'maxHeight': '90%'	
	}); 
});

var Evimetal = {
	'alert': function(messageTitle, messageText) {
		$('<div>').dialog({
            modal: true,
            open: function () { $(this).html('<p>' + messageText + '</p>') },
            close: function(e, i) { $(this).remove(); },
            height: 300,
            width: 400,
            title: messageTitle,
			buttons: {
				"Onayla": function() {
					$( this ).dialog( "close" );
				}
			}
        });
	},
	'confirm': function(messageText, targetUrl) {
		$('<div>').dialog({
            open: function () { $(this).html('<p>' + messageText + '</p>') },
            close: function(e, i) { $(this).remove(); },
			resizable: true,
            height: 300,
            width: 400,
            title: 'Onayla',
			modal: true,
			buttons: {
				"Onayla": function() {
					window.location = targetUrl;
					$( this ).dialog( "close" );
				},
				"İptal": function() {
					$( this ).dialog( "close" );
				}
			}
        });
	}
}
