
//-- knopkes voor volgende/vorige moblog--
$(document).ready(function(){
var url='http://www.polskaya.be/wp-content/themes/polskaya';
$('body').mouseover(function(event){
	if ($(event.target).is('.next')){
		var id=event.target.id.split('m');
		var id=id[1];
		var divid=id[0];
		$('.next').css({"cursor":"hand"});
		$('.next').css({"cursor":"pointer"});
		$('.next').attr("alt", "volgende foto");
		$('.next').attr('src', url+'/grafix/nextmobover.png');
	}
	if ($(event.target).is('.prev')){
		var id=event.target.id.split('m');
		var id=id[1];
		var divid=id[0];
		$('.prev').css({"cursor":"hand"});
		$('.prev').css({"cursor":"pointer"});
		$('.prev').attr("alt", "vorige foto");
		$('.prev').attr('src', url+'/grafix/prevmobover.png');
	}
});
$('body').mouseout(function(event){
	if ($(event.target).is('.next')){
		var id=event.target.id.split('m');
		var id=id[1];
		var divid=id[0];
		$('.next').attr('src', url+'/grafix/nextmob.png');
	}
	if ($(event.target).is('.prev')){
		var id=event.target.id.split('m');
		var id=id[1];
		var divid=id[0];
		$('.prev').attr('src', url+'/grafix/prevmob.png');
	}
});



$('body').click(function(event){
	if ($(event.target).is('.next')){
	var id=event.target.id.split('m');
	var id=id[1];
	var divid=id[0];
	 $('#moblogpic').html("<img src="+url+"/grafix/ajax-loader.gif border=0/ id='loader'>");
	 $("#moblogpicinfo").html("");
	mpic(id);
	}
	
	
	if ($(event.target).is('.prev')){
	var id=event.target.id.split('m');
	var id=id[1];
	var divid=id[0];
	 $('#moblogpic').html("<img src="+url+"/grafix/ajax-loader.gif border=0/ id='loader'>");
	 $("#moblogpicinfo").html("");
	mpic(id);
	}
});






function mpic(id){
var img = new Image();
// wrap our new image in jQuery, then:
$(img)
// once the image has loaded, execute this code
.load(function () {
      // set the image hidden by default    
      $(this).hide();
    
      // with the holding div #loader, apply:
      $('#moblogpic')
        // remove the loading class (so no background spinner), 
        .html('')
        // then insert our image
        .append(this);
    
      // fade our image in to create a nice effect
      $(this).fadeIn();
	  //get the picture info and show it
	  $("#moblogpicinfo").load(url+"/moblogpicinfo.php?id="+id).fadeIn("slow");
    })
    
    // if there was an error loading the image, react accordingly
.error(function () {
      // notify the user that the image could not be loaded
    })
	
.click(function(){//onclick go to moblogpage
	top.location="http://moblog.polskaya.be/archief.php?id="+id;
})
.mouseover(function(){
	$(img).css({"cursor":"hand"});
	$(img).css({"cursor":"pointer"});
	$(img).attr("title", "moblog.polskaya.be");
	$(img).attr("alt", "moblog.polskaya.be");
	
})
    
// *finally*, set the src attribute of the new image to our image
.attr('src', url+'/moblogpic.php?id='+id);

}








//---- get en toon moblog pic----


var img = new Image();
// wrap our new image in jQuery, then:
$(img)
// once the image has loaded, execute this code
.load(function () {
      // set the image hidden by default    
      $(this).hide();
    
      // with the holding div #loader, apply:
      $('#moblogpic')
        // remove the loading class (so no background spinner), 
        .html('')
        // then insert our image
        .append(this);
    
      // fade our image in to create a nice effect
      $(this).fadeIn();
	  //get the picture info and show it
$("#moblogpicinfo").load(url+"/moblogpicinfo.php").fadeIn("slow");
    })
    
    // if there was an error loading the image, react accordingly
    .error(function () {
      // notify the user that the image could not be loaded
    })
	
	.click(function(){//onclick go to moblogpage
	top.location="http://moblog.polskaya.be";
})
	.mouseover(function(){
	$(img).css({"cursor":"hand"});
	$(img).css({"cursor":"pointer"});
	
	$(img).attr("title", "moblog.polskaya.be");
	$(img).attr("alt", "moblog.polskaya.be");
	
})

// *finally*, set the src attribute of the new image to our image
.attr('src', url+'/moblogpic.php');

	
	
	
	
	
	
	
	
	
	
//-- end moblog--






//--green button---
//--show info
$('#green').mouseover(function(){
	$('#green').css({"cursor":"hand"});
	$('#green').css({"cursor":"pointer"});
	$('#green').attr("title", "lees meer");
});
$('#green.up').click(function(){
	$('#greenbox').slideDown("slow");
});

//--hide info
$('#greeninfo').mouseout(function(){	
	$('#greenbox').slideUp("slow");
});





//--end loop
});




// xtra functions

$.fn.image = function(src, f){
    return this.each(function(){
      $("<img />").appendTo(this).each(function(){
         this.src = src;
         this.onload = f;
      });
    });
} //wtf is this?