var imgSource="";
var imgHeight=0;
var imgWidth=0;
var imgLeft=0;
var imgTop=0;

$(document).ready(function(){
						   
						 var p=$('.left_part_inner_div').find('span a img');
						 var position=p.position();
						 
						 imgSource = $('.left_part_inner_div').find('span a').attr('href'); 
						 imgHeight = $('.left_part_inner_div').find('span a img').height();
						 imgWidth = $('.left_part_inner_div').find('span a img').width();
						 imgLeft = position.left;
						 imgTop = position.top;
						 
						 $('.left_part_inner_div').find('span a').bind('mouseover',mouseControl);
						 
						 
						 setInitialCond(); 
});

function setInitialCond()
{
	var CONTENT="<div class='popBox'><img src='"+imgSource+"' width='"+imgWidth+"' height='"+imgHeight+"'/></div>";
	$('body').append(CONTENT);
	
	$(".popBox img").bind('mouseout', mouseControl);
	
	$(".popBox").css({
					 	'left'		:		imgLeft,
						'top'		:		imgTop
					 });
	
}

function mouseControl(e)
{
	switch (e.type)
	{
		case "mouseover":
			showPop();
		break;
		
		case "mouseout":
			hidePop();
		break;
	
	
	}
}

function showPop()
{
	
	
	$(".popBox").show();
	
	$(".popBox img").animate({
							 width:600,
							 height:352
							 
						 })
	$(".popBox").animate({
							 width:600,
							 height:352,
							 left:0,
							 top:imgTop-180
						 })
}

function hidePop()
{
	$(".popBox").animate({
							 width:imgWidth,
							 height:imgHeight,
							 left:imgLeft,
							 top:imgTop
						 })
	$(".popBox img").animate({
							 width:imgWidth,
							 height:imgHeight
						 },function (){$(".popBox").hide();})
}
