var z = 0;
var left_position = 0;
var top_position = 0;
var z_height = 0;
var z_width = 0;
var opacity = 0.00; //opacity of image

var crossobj = document.all ? document.all.staticcontent : document.getElementById("staticcontent");
var iebody = (document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body;
var quick_buy_object;
var dsoctop = document.all ? iebody.scrollTop : pageYOffset;

function get_quick_image_size()
	{
		if(document.getElementById('quick_image')!=undefined)
			{
				z_height = document.getElementById('quick_image').height;
				z_width = document.getElementById('quick_image').width;
			}
	}

function start_quick_view1(sid) {
	//alert(1111)
	close_quick_view()
	//alert(333)
	z = 0;
	z_height = 0;
	z_width = 0;
	opacity = 0; //opacity of image
	
	var the_top = 0, the_scroll = 0;
	
	//find the top
	if(document.innerHeight) {
		the_top = document.innerHeight;
	} else if(document.documentElement.clientHeight) {
		the_top = document.documentElement.clientHeight;
	} else if(document.body) {
		the_top = document.body.clientHeight;
	}
	
	//find the scroll
	if(document.body.scrollTop) {
		the_scroll = document.body.scrollTop;
	} else if(document.scrollTop) {
		the_scroll = document.scrollTop;
	} else if(document.documentElement.scrollTop) {
		the_scroll = document.documentElement.scrollTop;
	}
	
	//alert(the_top)
	//alert(the_scroll)
	top_position = the_scroll + the_top / 2 + 20 // parent.document.body.clientHeight/2 + 20
	left_position = document.body.clientWidth / 2
	//alert(top_position)
	//alert(left_position)
	document.getElementById("quick_view_holder").style.left = left_position + "px"
	document.getElementById("quick_view_holder").style.top = top_position + "px"
	document.getElementById("quick_view_holder").style.display = 'block';
	document.getElementById("my_iframe").src = "/client_includes/get_quick_view.asp?sid=" + sid
}
			
function close_quick_view() {
	//alert(2)
	document.getElementById("quick_view_holder").style.display='none';
	document.getElementById("quick_view_holder").style.left = 0
	document.getElementById("quick_view_holder").style.top = 0
	document.getElementById("quick_view_holder").style.width = 10;
	document.getElementById("quick_view_holder").style.height = 10;
	document.getElementById("quick_view_holder").innerHTML = ""
	unstickIFrame()	
}
	
function expand() {
	z = 575
	document.getElementById("quick_view_holder").style.left = (left_position - z/2) + "px"
	document.getElementById("quick_view_holder").style.top = (top_position - z/2) + "px"
	document.getElementById("quick_view_holder").style.width = z;
	document.getElementById("quick_view_holder").innerHTML = my_iframe.document.getElementById("content").innerHTML
	stickIFrameIn(document.getElementById("quick_view_holder"))
	show_alpha_quick_buy()
}

function show_alpha_quick_buy() {
	quick_buy_object = document.getElementById("the_content").style
	b4_opacity = opacity;
	if(opacity < 1.00) {
		opacity += 0.10;
		
		if (opacity > 1.00) opacity = 1.00;
		quick_buy_object.filter = "alpha(opacity=" + (opacity * 100).toFixed(0) + ")"; // probably IE
		quick_buy_object.MozOpacity = opacity; // Mozilla & Firefox pre CSS3
		quick_buy_object.opacity = opacity; // CSS3 ... the sooner all browsers support this, the better.
		setTimeout("show_alpha_quick_buy()", 50);
	}
	else {
		get_quick_image_size()
	}
}