function gayWarning(e) {
	//killVideoThumbs();
	document.getElementById('GayWarn').style.display = 'block';
	document.getElementById('TrannyWarn').style.display = 'none';

	scroll(0,0)
	return false
}

function trannyWarning(e) {
	//killVideoThumbs();
	document.getElementById('TrannyWarn').style.display = 'block';
	document.getElementById('GayWarn').style.display = 'none';

	scroll(0,0)

	return false
}


function scanLinks(elementID,word,event,callback) {
	if(document.getElementById(elementID) != null) {
		var links = document.getElementById(elementID).getElementsByTagName('a');
		if (links != null) {
			for (var i = 0, l = links.length; i < l; i++) {
				if(links[i].innerHTML.toLowerCase().indexOf(word) > -1) {
					if (links[i].addEventListener) { //W3C
						links[i].addEventListener(event, callback,false);
					} else if (links[i].attachEvent) { //IE 
						links[i].attachEvent( "on"+event,function() {return callback(this);});
					}
				}
			}
		}
	}
}


function initWarning() {
  if (arguments.callee.complete) return;
  arguments.callee.complete = true;
  if (_timer) clearInterval(_timer);
  if (/msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent)){

  	if(document.cookie.indexOf('gay') > -1) {
  		//leftColumn for left category menu
		scanLinks('categoriesList','gay','click', gayWarning);
		
		//centerColumn for center pictures menu from categories.php page
		if(location.pathname.indexOf('categories.php') == 1){
			//we are for sure on channels.php page
			scanLinks('categories','gay','click', gayWarning);
		}
	}
  
  	if(document.cookie.indexOf('tranny') > -1) {
		scanLinks('categoriesList','shemale','click', function() {return trannyWarning(this);});
		
		//centerColumn for center pictures menu from categories.php page
		if(location.pathname.indexOf('categories.php') == 1){
			//we are for sure on channels.php page
			scanLinks('categories','shemale','click', function() {return trannyWarning(this);});
		}
	}
	
	//Not filter set up
	if(document.cookie.indexOf('content_filter=') == -1) {
		scanLinks('categoriesList','gay','click', gayWarning);
		scanLinks('categoriesList','shemale','click', function() {return trannyWarning(this);});
		
		//centerColumn for center pictures menu from categories.php page
		if(location.pathname.indexOf('categories.php') == 1){
			//we are for sure on channels.php page
			scanLinks('categories','gay','click', gayWarning);
			scanLinks('categories','shemale','click', function() {return trannyWarning(this);});
		}		
	}
  
  } else {
	if(document.cookie.indexOf('gay') > -1) {
		scanLinks('categoriesList','gay','click',   function(e) {e.preventDefault(true); return gayWarning(this);});
		
		//centerColumn for center pictures menu from categories.php page
		if(location.pathname.indexOf('categories.php') == 1){
			//we are for sure on channels.php page
			scanLinks('categories','gay','click',   function(e) {e.preventDefault(true); return gayWarning(this);});
		}
	}
  
  	if(document.cookie.indexOf('tranny') > -1) {
		scanLinks('categoriesList','shemale','click',function(e) {e.preventDefault(true); return trannyWarning(this);});
		
		//centerColumn for center pictures menu from categories.php page
		if(location.pathname.indexOf('categories.php') == 1){
			//we are for sure on channels.php page
			scanLinks('categories','shemale','click',function(e) {e.preventDefault(true); return trannyWarning(this);});
		}
	}
	
	//Not filter set up
	if(document.cookie.indexOf('content_filter=') == -1) {
		scanLinks('categoriesList','gay','click',   function(e) {e.preventDefault(true); return gayWarning(this);});
		scanLinks('categoriesList','shemale','click',function(e) {e.preventDefault(true); return trannyWarning(this);});
		
		//centerColumn for center pictures menu from categories.php page
		if(location.pathname.indexOf('categories.php') == 1){
			//we are for sure on channels.php page
			scanLinks('categories','gay','click',   function(e) {e.preventDefault(true); return gayWarning(this);});
			scanLinks('categories','shemale','click',function(e) {e.preventDefault(true); return trannyWarning(this);});
		}	
	}
  
  }
  
  
  

 
};


//Opera / Moz
if (document.addEventListener) {
  document.addEventListener("DOMContentLoaded", initWarning, false);
}

//IE
/*@cc_on @*/
/*@if (@_win32)
  document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
  var script = document.getElementById("__ie_onload");
  script.onreadystatechange = function() {
    if (this.readyState == "complete") {
      initWarning(); // call the onload handler
    }
  };
/*@end @*/

//Safari
if (/WebKit/i.test(navigator.userAgent)) {
  var _timer = setInterval(function() {
    if (/loaded|complete/.test(document.readyState)) {
      initWarning(); 
    }
  }, 10);
}

//the rest
window.onload = initWarning;