//
// Function add_image
// image is the full path of the image... It is not derived as customer images come from a different location.
// These scripts require jquery.js to run properly....
// <script src="http://code.jquery.com/jquery-latest.min.js"></script>
//
function add_sell_image(image,id_val, height, width,landing)
{
remove_image();
//alert("image is " + image);
image = image + "";
//var dir = image.substr(0,2);
//alert("Past substr");
var src_image = image;
//alert ( src_image);
if ( height >= width )
 {
 jQuery('<div class=\"photo3\" > <img class=\"new_image\" /></div>').find('img').attr(
 {
          src: src_image,
          title: "Book", 
          height: height,
          width: width, 
          onMouseOver: "remove_image();",
          onClick: "remove_image();"        
          
}).end().insertBefore('#'+ landing);

 }
else
 { 
  jQuery('<div class=\"photo3\" > <img class=\"new_image2\" /></div>').find('img').attr(
 {
          src: src_image,
          title: "Book", 
          height: height,
          width: width, 
          onMouseOver: "remove_image();",
          onClick: "remove_image();"        
          
}).end().insertBefore('#' + landing);

}	


}




function add_image(image,id_val, height, width)
{
remove_image();
//alert("image is " + image);
image = image + "";
//var dir = image.substr(0,2);
//alert("Past substr");
var src_image = image;
var middle_image = jQuery('#search_page img').filter(':eq(8)');
//alert ( src_image);
if ( height >= width )
 {
 jQuery('<div class=\"photo\" > <img class=\"new_image\" /></div>').find('img').attr(
 {
          src: src_image,
          title: "Book", 
          height: height,
          width: width     
 
}).end().insertBefore('#' + id_val);
//var new_image_off = jQuery('.new_image').offset();
//var destination = new_image_off.top;
//jQuery(document).scrollTop(destination);
 }
else
 { 
  jQuery('<div class=\"photo\" > <img class=\"new_image2\" /></div>').find('img').attr(
 {
          src: src_image,
          title: "Book", 
          height: height,
          width: width
            
          
}).end().insertBefore('#' + id_val);
//var new_image_off2 = jQuery('.new_image2').offset();
//var destination2 = new_image_off2.top;
//jQuery(document).scrollTop(destination2);
}	

//jQuery('.new_image').attr({left: 2.5em;});
}
function remove_image()
{
window.status = "Java Script activated";
jQuery('.new_image').remove();
jQuery('.new_image2').remove();
jQuery('.photo').remove();
}
