
function showVideo(url,videoDiv,top,left,width,height) {
	url= url.replace(/&/g, "%26");
	width=$defined(width)?width:"320";
	height=$defined(height)?height:"256";
	var div = $(videoDiv);
    var cont = $(videoDiv+"Div");
    var so = new SWFObject(url, videoDiv+"Swf", ""+width+"px", ""+height+"px", "8", "#000000");
	so.addParam("quality", "high");
	so.addParam("wmode", "opaque");
	so.addParam("style", "z-index:2;");
    so.write(cont);
    if($defined(top))
    	div.style.top=top+"px";
    if($defined(left))
    	div.style.left=left+"px";
	div.style.display="block";
    
}

function showImage(url,imgDiv,top,left) {
	url= url.replace(/&/g, "%26");
	var div = $(imgDiv);
    var cont = $(imgDiv+"Div");
    cont.innerHTML='<a href="javascript:;"><img  src="'+url+'" onclick="hideImg();"></a>';
    if($defined(top))
    	div.style.top=top+"px";
    if($defined(left))
    	div.style.left=left+"px";
    else
    	div.style.left="";
	div.style.display="block";
    
}

function hideVideo(videoDiv){
	var div = $(videoDiv);
	var cont = $(videoDiv+"Div");
	if(div){
	  		div.style.display="none";
	  		cont.innerHTML = "";
   	}
}

function hideSwf(){
	hideVideo("video");
}

function hideImg(){
	hideVideo("img");
}


function showSwf(event,url) {
	var event = new Event(event);
	var target = $(event.target);
	showVideo(url,"video",$(target).getCoordinates().bottom-220,$(target).getCoordinates().left-220);
}

function showImg(event,url) {
	var event = new Event(event);
	var target = $(event.target);
	showImage(url,"img",$(target).getCoordinates().bottom-220,$(target).getCoordinates().left-220);
}
function showFP(event,url) {
	var event = new Event(event);
	var target = $(event.target);
	showImage(url,"img",20+window.getScrollTop(),null);
}
