
	$(window).bind('load', function() {  
     	$('.protected_images').protectImage();  
 	});


$(document).ready( function() {
    // run the code in the markup!
    $('td pre code').each(function() {
        eval($(this).text());
    });
	
	//call the image protector function
	//trapclick();

	
	$('#slidedown').cycle({
    fx:    'fade',
    timeout: 4000
	});
	
	/*paused is hidden at the beginning using css.... */
    $('#gallery_slide').after('<div style="height:0px; clear:both; width:100%"/><div id="nav" class="nav"><div id="paused"><img src="images/pause.gif"/></div><div id="resumed"><img src="images/pause.gif"/></div>').cycle({
        fx:     'fade',
        timeout: 4000,
        pager:  '#nav',
        before: function() { if (window.console) console.log(this.src); }
    });
	
	$('#paused').click(function(){
		$('#gallery_slide').cycle('pause');
		$("#resumed").show();
		$(this).hide();
	 });
	
	$('#resumed').click(function(){
		$('#gallery_slide').cycle('resume');
		$("#paused").show();
		$(this).hide();
	 });
	
	$(".tellafriend").hover(
      function () {
        $(this).attr("href","mailto:?subject=A Professional Photographer&body=This is an interesting photography website . Please visit http://www.phoenixphotography.co.uk.");
      }, 
      function () {
        //do nothing..
      }
    );


});



//delete confirmation function 
function confirmDelete()
{
    var answer = confirm("All the image related to this category will be deleted. Delete Selected Item? ");
    if (!answer){
        return false;
    }
	else
	return true;  
} 


function right(e) {
	var msg = "right-clicking on images is not permitted.";
	if (navigator.appName == 'Netscape' && e.which == 3) {
	alert(msg);
	return false;
	}
	if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2) {
	alert(msg);
	return false;
	}
	else return true;
}

function trapclick()
{
	if(document.images)
	{
	for(i=0;i<document.images.length;i++)
	{
	document.images[i].onmousedown = right;
	document.images[i].onmouseup = right;
	}
	}
}

