/*
Custom js file for midnight theme for clipshare.
Written by: testuser
testuser@phpizabi.net
The code written herein is copyrighted and only to be used with the midnight cs theme

*/
$(document).ready(function(){	

	$(".homecat_img a").easyTooltip();

	$("#bluetop_lt li a").each(function(){
	      	  
      if( window.location.href.indexOf( $(this).attr('href') ) >= 0 && $(this).attr('href').length > 1 ) {
      
		$("#bluetop_lt li a").removeClass("activeLbtn");
		
		$("#bluetop_rt li a").removeClass("activeRbtn");
      
      $(this).addClass("activeLbtn");
       		
      } 
      
    });

$("#bluetop_rt li a").each(function(){
	      	  
      if( window.location.href.indexOf( $(this).attr('href') ) >= 0 && $(this).attr('href').length > 1 ) {
      
		$("#bluetop_lt li a").removeClass("activeLbtn");
		
		$("#bluetop_rt li a").removeClass("activeRbtn");
		
      $(this).addClass("activeRbtn");
       		
      }
      
    });

	
	$("#hometabs li a").click(function() {
		$("#hometabs li a").removeClass("activeHbtn");
		$(this).addClass("activeHbtn");
	});
	
	$("div#searchwords li a#list-videos").click(function() {
	$("div#searchwords li a#list-videos").css( {backgroundPosition: "-0 -18"} );
	$("div#searchwords li a#list-users").css( {backgroundPosition: "-80 -0"} );
	$("div#searchwords li a#list-cat").css( {backgroundPosition: "-160 -0"} );
	$("#search_type").val('search_videos');	
	});
	
	$("div#searchwords li a#list-users").click(function() {
	$("div#searchwords li a#list-users").css( {backgroundPosition: "-80 -18"} );
	$("div#searchwords li a#list-videos").css( {backgroundPosition: "-0 -0"} );
	$("div#searchwords li a#list-cat").css( {backgroundPosition: "-160 -0"} );
 	$("#search_type").val('search_users');	
	});

	$("div#searchwords li a#list-cat").click(function() {
	$("div#searchwords li a#list-cat").css( {backgroundPosition: "-160 -18"} );
	$("div#searchwords li a#list-users").css( {backgroundPosition: "-80 -0"} );
	$("div#searchwords li a#list-videos").css( {backgroundPosition: "-0 -0"} );
	$("#search_type").val('search_categories');
	});
	
	$('#postcommentDiv').hide();
	
	$("#pcommlink").click(function() {
	$('#postcommentDiv').toggle('slow');
	});
	
function hidediv(){

var thedivs = new Array();

thedivs[0]= 'rated_div';

thedivs[1]= 'viewed_div';

thedivs[2]= 'random_div';

var arLen=thedivs.length;


for ( var i=0, len=arLen; i<len; ++i ){

//alert(thedivs[i] + '<-> ' + menusub);

  
  $('#'+thedivs[i]).hide();	

	
}

}

hidediv();

	function hideVdiv(){

var thedivs = new Array();

thedivs[0]= 'hc_info';

thedivs[1]= 'hc_comments';

thedivs[2]= 'hc_user';

var arLen=thedivs.length;


for ( var i=0, len=arLen; i<len; ++i ){

//alert(thedivs[i] + '<-> ' + menusub);

 // alert(thedivs[i]);
  
  $('#'+thedivs[i]).hide();	

	
}

}

hideVdiv();

});
 	function showdiv(mysel){

var thedivs = new Array();

thedivs[0]= 'featured_div';

thedivs[1]= 'rated_div';

thedivs[2]= 'viewed_div';

thedivs[3]= 'random_div';

var arLen=thedivs.length;


for ( var i=0, len=arLen; i<len; ++i ){

//alert(thedivs[i] + '<-> ' + menusub);

  if(thedivs[i] != mysel) {
  
  $('#'+thedivs[i]).hide();	
  
} else $('#'+mysel).show();

	
}

}

 	function showVdiv(mysel){

var thedivs = new Array();

thedivs[0]= 'hc_vid';

thedivs[1]= 'hc_info';

thedivs[2]= 'hc_comments';

thedivs[3]= 'hc_user';

var arLen=thedivs.length;


for ( var i=0, len=arLen; i<len; ++i ){

//alert(thedivs[i] + '<-> ' + menusub);

  if(thedivs[i] != mysel) {
  
  $('#'+thedivs[i]).hide();	
  
} else $('#'+mysel).show();

	
}

}


