
type="text/javascript">
addthis_pub = 'ioffer';
addthis_url = location.rel="nofollow" href;
addthis_title = document.title;
addthis_options = 'favorites, email, digg, delicious, google, facebook, live, more';
>
var itemDetailMaxImageWidth = 435;
preloadImagesArray = new Array;
function preloadImages(){
if(document.images){
for(var i = 0; i < preloadImagesArray.length; i++){
eval("preloadedImage" + i + ".src = '" + preloadImagesArray[i] + "';");
}
}
}
function setMainImage(url,video){
var str = url.substring(url.lastIndexOf('/')+1, url.lastIndexOf('/')+3);
var container = $('main_picture');
if (container == null) { return };
var containerHeight = container.offsetHeight;
var share_button_height = 36;
addThisDiv = $("item_add_this_div");
addThisDivDock = $("item_add_this_div_dock");
addThisDivDock.appendChild(addThisDiv);
//Clear the image div
container.innerHTML = '';
if (video == 0) {
//Look through all preloaded images. If one is found with the same image name, set new_fill to that image object.
for(var i = 0; i < preloadImagesArray.length; i++){
if(eval("typeof(preloadedImage" + i + ")") != "undefined"){
var preloadedImageName = eval("preloadedImage" + i + ".src");
preloadedImageName = preloadedImageName.substring(preloadedImageName.lastIndexOf('/')+1, preloadedImageName.length);
var urlImageName = url.substring(url.lastIndexOf('/')+1, url.length);
if(preloadedImageName == urlImageName){
var new_fill = eval("preloadedImage" + i);
}
}
}
//If the new_fill variable has already been set by the preload logic
if(typeof(new_fill) == "undefined"){
var new_fill = document.createElement('img');
new_fill.src = url;
}
//Create zoom icon image object
var zoom_image = document.createElement('img');
zoom_image.src = "/images/icons/zoom_16.gif";
zoom_image.style.marginTop = "4px";
if(new_fill.width > itemDetailMaxImageWidth){
new_fill.style.height = new_fill.height = new_fill.height * (itemDetailMaxImageWidth / new_fill.width);
new_fill.style.width = new_fill.width = itemDetailMaxImageWidth;
}
//If the image and the zoom icon have both been downloaded, set the container height
if(new_fill.complete){
if(containerHeight < (new_fill.height + share_button_height)){
container.style.height = (new_fill.height + share_button_height) + "px";
}else{
container.style.height = containerHeight + "px";
}
}
if (str == 'o_') {
line_break = document.createElement('br');
new_fill.alt = 'Click to View Full-Size Image';
zoom_image.alt = 'Click to View Full-Size Image';
var temp_str = url.substring(0,url.lastIndexOf('/')+1);
temp_str += url.substring(url.lastIndexOf('/')+3,url.length);
new_fill.src = url;
var new_link = document.createElement('a');
new_link.setAttribute('title','Click to View Full-Size Image');
new_link.rel="nofollow" href = "JavaScript:void(0);";
new_link.onclick = function() { window.open('/fs_img.html?' + temp_str + '','full_sized_image','resizable=1,scrollbars=yes');return false; };
new_link.appendChild(new_fill);
new_link.appendChild(line_break);
new_link.appendChild(zoom_image);
image_div = document.createElement("div");
if(new_fill.width == 0){
image_div.style.width = new_fill.style.width;
}else{
image_div.style.width = new_fill.width + "px";
}
image_div.style.textAlign = "right";
image_div.style.margin = "auto";
image_div.appendChild(new_link);
addThisDiv.style.top = "-17px";
image_div.appendChild(addThisDiv);
container.appendChild(image_div);
} else {
new_fill.alt = 'Main Image';
container.appendChild(new_fill);
addThisDiv.style.top = "3px";
container.appendChild(addThisDiv);
}
} else if(video == 1){
if(containerHeight < 290){
container.style.height = "290px";
}else{
container.style.height = containerHeight + "px";
}
var so = new SWFObject('/flvplayer.swf', 'flash_video', '435', '290', '7');
so.addParam("allowfullscreen", "false");
so.addParam("wmode", "opaque");
so.addVariable("file", url);
so.addVariable("autostart", "true");
so.addVariable("displayheight","290");
so.addVariable("overstretch","none");
so.write('main_picture');
addThisDiv.style.top = "3px";
container.appendChild(addThisDiv);
}
}
var i = 0;
function initSetMainImage(){
setMainImage("http://i3.iofferphoto.com/img/item/352/872/91/EXZ1080BK.jpeg", 0);
}
>
addEvent(window, "load", initSetMainImage, false);