function cargarCategoria(categoria){
	new Ajax.Request("videos.php?cat="+categoria+"&catActual="+$('categoriaActual').value+"&vid="+$('indexActual').value+"&orden="+$('orden').value,{
		onSuccess: function(transport){
			response = transport.responseText;
			$("contentCategorias").innerHTML = response;
		}
	});
}

function cambiarOrden(cat, tipo){
	$('orden').value = tipo;
	cargarCategoria(cat);
}

function cargarVideo(categoria, indice, orden){
	new Ajax.Request("categoria.php?cat="+categoria+"&vid="+indice+"&orden="+orden,{
		onSuccess: function(transport){
			response = transport.responseText;
			$("contentTabla").innerHTML = response;
		}
	});
}







function ocultarCapaTransparente(){
	$('divContentCapaTransp').innerHTML = "";
	$('divCapaTransparente').style.display = "none";
	$('divContentCapaTransp').style.display = "none";
}

function ocultarError(nombreDiv){
	$(nombreDiv).style.visibility = 'hidden';
}

window.onscroll = function(){
	if($("divCapaTransparente").style.display == "block"){
		$("divCapaTransparente").style.top = document.documentElement.scrollTop+"px";
	}
}

function fbs_click_video(idvideo){
	u = "http://www.subituesposible.com/ranking/index.php?vid="+idvideo;
	t=document.title;
	window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
	return false;
}

function fbs_click_video_especial(idvideo, image_url, tipo_video) {
	if(parseInt(tipo_video) == 3){
		swf = "cocafacevimeo.swf";
	}else{
		swf = "cocafacetube.swf";
		
	}
	var attachment = {	'media': [{'type': 'flash', 'swfsrc': 'http://www.subituesposible.com/ranking/facebook/'+swf+'?idvideo='+idvideo, 'imgsrc': 'http://www.subituesposible.com/ranking/facebook/imagen.php?path_img='+image_url, 'width': '130', 'height': '98', 'expanded_width': '400', 'expanded_height': '300'}]
				,'description':'Coca-Cola Zero te invita a participar del concurso Subí tu es posible. Subí tu video, participá del concurso y ganate increibles premios. www.subituesposible.com'};
				
	var actionLinks = [{ "text": "Votame", "href": "http://www.subituesposible.com/ranking/index.php?vid="+idvideo}];
	FB.Connect.streamPublish('', attachment, actionLinks, null, 'Contale a tus amigos el concurso y consegu&iacute; m&aacute;s votos', null, true);
}

function twitter_click_video(idvideo){
	window.open('share_twitter.php?vid='+idvideo,'sharer','toolbar=0,status=0,width=626,height=436');
}

function ponerBorde(imagen){
	imagen.style.border = "1px solid #959192";
}

function sacarBorde(imagen){
	imagen.style.border = "1px solid #2a2525";
}