$(document).ready(function(){

//Prevent right click menu
/*
	$(this).bind("contextmenu", function(e) {
  	e.preventDefault();
  	alert('Copyright www.TheMoldingArchive.com');
  });
*/

//Larger thumbnail preview 
$("img.parts_search_results_image_left").click(function() {	
	if ((this.width) == '250') {
		vID = ($(this).attr('id'));
		vID = "d-" + vID.substr(2);
		$($('#' + vID)[0]).css({'visibility' : 'hidden'});
		$(this).css({'z-index' : '10'});
		$(this).css({'border' : '1px solid #000000'});
		$(this).css({'margin-top' : '-150px'});
		$(this).css({'margin-left' : '-15px'});
		$(this).css({'background-color' : '#ffffff'});
		$(this).css({'width' : '500px'});
	}else{
		vID = ($(this).attr('id'));
		vID = "d-" + vID.substr(2);
		$($('#' + vID)[0]).css({'visibility' : 'visible'});
		$(this).css({'z-index' : '0'});
		$(this).css({'border' : 'none'});
		$(this).css({'margin-top' : '0'});
		$(this).css({'margin-left' : '0'});
		$(this).css({'background-color' : 'transparent'});
		$(this).css({'width' : '250px'});
	}
}, 'slow');


$("img.parts_search_results_image_center").click(function() {
	if ((this.width) == '250') {
		vID = ($(this).attr('id'));
		vID = "d-" + vID.substr(2);
		$($('#' + vID)[0]).css({'visibility' : 'hidden'});
		$(this).css({'z-index' : '10'});
		$(this).css({'border' : '1px solid #000000'});
		$(this).css({'margin-top' : '-150px'});
		$(this).css({'margin-left' : '-15px'});
		$(this).css({'background-color' : '#ffffff'});
		$(this).css({'width' : '500px'});
	}else{
		vID = ($(this).attr('id'));
		vID = "d-" + vID.substr(2);
		$($('#' + vID)[0]).css({'visibility' : 'visible'});
		$(this).css({'z-index' : '0'});
		$(this).css({'border' : 'none'});
		$(this).css({'margin-top' : '0'});
		$(this).css({'margin-left' : '0'});
		$(this).css({'background-color' : 'transparent'});
		$(this).css({'width' : '250px'});
	}
}, 'slow');

$("img.parts_search_results_image_right").click(function() {
	if ((this.width) == '250') {
		$(this).css({'z-index' : '10'});
		$(this).css({'border' : '1px solid #000000'});
		$(this).css({'margin-top' : '-150px'});
		$(this).css({'margin-left' : '-230px'});
		$(this).css({'background-color' : '#ffffff'});
		$(this).css({'width' : '500px'});
	}else{
		$(this).css({'z-index' : '0'});
		$(this).css({'border' : 'none'});
		$(this).css({'margin-top' : '0'});
		$(this).css({'margin-left' : '0'});
		$(this).css({'background-color' : 'transparent'});
		$(this).css({'width' : '250px'});
	}
}, 'slow');

});

