

function getStyle(el,styleProp){
	var x = el;//document.getElementById(el);
	if (x.currentStyle)
		var y = x.currentStyle[styleProp];
	else if (window.getComputedStyle)
		var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);
	return y;
}



function getPos(obj){
  var curleft = 0;
  var curtop = 0;

	if (obj.offsetParent){

		while (obj.offsetParent){

			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;

			obj = obj.offsetParent;

		}

	}

	else if (obj.x){

		curleft += obj.x;
		curtop += obj.y;
	}

	return {'x':curleft,'y':curtop};

}	

if(!Array.indexOf){ // IE really suxxxxxx :((
  Array.prototype.indexOf = function(obj){
   for(var i=0; i<this.length; i++){
    if(this[i]===obj){
     return i;
    }
   }
   return -1;
  }
}



var selthumb=null;
function zoom(obj,path){
	if(selthumb!=null)selthumb.style.border='1px dotted #808080';
	selthumb=obj;
	pos=getPos(obj);
	zd=document.getElementById('zoomdiv');
	zi=document.getElementById('zoomimg');//alert(zi.src.indexOf(path));
	if(zd.style.visibility=='visible' && zi.src.indexOf(path)!=-1){
		zd.style.visibility='hidden';
		zi.src="img/loading.gif";
		return;
	}
	zi.src=path;
	zd.style.top=(pos.y-315)+"px";
	zd.style.visibility='visible';
	obj.style.border='2px solid #cc0000';	
}




function openVideo(path){
	var html='<div style="position:absolute;top:-5px;left:-5px;float:left;height:30px;"><a class=sbtn style="z-index:9999" href="javascript:void(0)" onclick="document.getElementById(\'divVideo\').innerHTML=\'\';document.getElementById(\'divVideo\').style.visibility=\'hidden\'"><img border=0  src="/img/close.png"> </a></div><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="722" height="584" align="middle"><param name="allowScriptAccess" value="sameDomain"><param name="movie" value="/player.swf?v=/videos/'+path+'.flv"><param name="quality" value="high"><param name="bgcolor" value="#ffffff"><param name="allowFullScreen" value="true"><embed src="/player.swf?v=/videos/'+path+'.flv" quality="high" align="middle" bgcolor="#ffffff" width="722" height="584" allowFullScreen="true" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></object>';
	d=document.getElementById('divVideo');
	d.style.visibility="visible";
	d.style.top=( (window.pageYOffset || document.body.scrollTop)-190)+'px'; 
	d.innerHTML=html;
	
}
