<!--
// Attach event listeners to searchbigbox
function searchBigBoxListener() {

	
	if(!document.getElementById || !document.getElementById('searchbigbox_submit_btn') || !document.createElement) return;

   var btn = document.getElementById('searchbigbox_submit_btn');
 		btn.onclick = function(){ searchBigBox(); hide(document.getElementById('hidden_search')); return false};
		
}

function searchBigBox() {
	
	var ajaxRequest;  // The variable that makes Ajax possible!
//Browser Support Code
   var node = document.getElementById('videoboxliner');
  var va, sv, zn, ca, limit, page, queryString, url;	
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				
				return false;
			}
		}
	}
	
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		
		if(ajaxRequest.readyState == 4){
			
			node.innerHTML = ajaxRequest.responseText;
			
			
		}
		
	}
	page = 0;
	tb = document.getElementById('searchbigbox_submit_btn').name.substr(4);
	
	limit = document.getElementById('searchbigbox_limit').value;
	 sv = document.getElementById('searchbigbox_sv').value;
	 va = document.getElementById('searchbigbox_va').value;
	 queryString = '?page=' + page + '&limit=' + limit + '&va=' + va + '&sv=' + sv + '&tb=' + tb;

  	if (document.getElementById('searchbigbox_ca')) {
		
		ca = document.getElementById('searchbigbox_ca').value;
		queryString = queryString + '&ca=' + ca;

	}

	 if (document.getElementById('searchbigbox_av')) {
		
		av = document.getElementById('searchbigbox_av').value;
		queryString = queryString + '&av=' + av;

	 }
	 if (document.getElementById('searchbigbox_ref')) {
		
		ref = document.getElementById('searchbigbox_ref').value;
		queryString = queryString + '&ref=' + ref;

	 }

	 if (document.getElementById('searchbigbox_zn')) {
		
		zn = document.getElementById('searchbigbox_zn').value;
		queryString = queryString + '&zn=' + zn;

	 }


	 if (document.getElementById('vidplayer_ref')) {
		
		np = document.getElementById('vidplayer_ref').value;
		queryString = queryString + '&np=' + np;

	 }


	url =  "http://www.djtutor.com/ajax/display.php";
	ajaxRequest.open("GET", url + queryString, true);
	ajaxRequest.send(null); 
	
}

function showMenu(my_id) {
	if (document.all&&document.getElementById(my_id)) {
	ul = document.getElementById(my_id);
	ul.style.display = 'block';
	}
	}

function hideMenu(my_id) {
	if (document.all&&document.getElementById(my_id)) {
	ul = document.getElementById(my_id);
	ul.style.display = 'none';
	}
	}
function expand(thistag){
  styleObj=document.getElementById(thistag).style;
  if(styleObj.display==='none'){styleObj.display='';}
  else {styleObj.display='none';}
}
function ajaxComments(comment_box_number, youtuberef){
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			var ajaxDisplay = document.getElementById('commentbox');
			ajaxDisplay = ajaxDisplay.getElementsByTagName('div');
			ajaxDisplay = ajaxDisplay[1];
			ajaxDisplay.innerHTML = ajaxRequest.responseText;
		}
	}
	
	
	var queryString = "?youtuberef=" + youtuberef + "&comment_box_number=" + comment_box_number;
	ajaxRequest.open("GET", "/phillip/ajax-comments.php" + queryString, true);
	ajaxRequest.send(null); 
}

//Browser Support Code

function ajaxPostComments(youtuberef, comment_id, author, content_hint){
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			var ajaxDisplay = document.getElementById('post_comment_0');
			ajaxDisplay.innerHTML = '<h3>...............</h3>'; //ajaxRequest.responseText;
		}
	}
	
	//content_hint = escape(content_hint).replace('+', '%2B');
	//var queryString = "?youtuberef=" + youtuberef + "&comment_id=" + comment_id + "&author=" + author + "&content_hint=" + content_hint;
	//ajaxRequest.open("GET", "/phillip/ajax-post_comments.php" /*+ queryString*/, true);
	//ajaxRequest.send(null); 
	var queryString = "?youtuberef=" + youtuberef + "&comment_box_number=" + 0;
	ajaxRequest.open("GET", "/phillip/ajax-comments.php" + queryString, true);
	ajaxRequest.send(null); 

}

function ajaxPostCommentText(youtuberef, comment_id){
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			var ajaxDisplay = document.getElementById('post_comment_0');
			var target = 'post_comment_' + comment_id ;
			var targetDisplay = document.getElementById(target);
			targetDisplay.innerHTML = '';
			ajaxDisplay.innerHTML = ajaxRequest.responseText;
		}
	}
	
	var post_comment_text = escape(document.getElementById('post_comment_text').value).replace('+', '%2B');
	var queryString = "?youtuberef=" + youtuberef + "&comment_id=" + comment_id + "&post_comment_text=" + post_comment_text ;
	ajaxRequest.open("GET", "http://www.djtutor.com/authorization_files/authsubcomment.php" + queryString, true);
	ajaxRequest.send(null); 
}
function discardComments(youtuberef, comment_id) {
	
			var aDisplay = document.getElementById('post_comment_0');
			aDisplay.innerHTML = '<h3 id="commentbox_heading">Comments: <a id="post_comment" href="#" onclick="ajaxPostComments(\'' + youtuberef + '\', \'0\'); hide(document.getElementById(\'descbox\')); setLong(document.getElementById(\'commentbox\').getElementsByTagName(\'div\')[1]); return false" >Post a comment</a></h3>';
}

function ajaxSendComment(target, youtuberef, comment_id, limit){
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			var commentText = document.getElementById('post_comment_text');
			target.innerHTML = ajaxRequest.responseText;
		}
	}
	
	
	var commentText= escape(document.getElementById('post_comment_text').value).replace('+', '%2B');
	var queryString = "?youtuberef=" + youtuberef + "&comment_id=" + comment_id + "&post_comment_text=" + commentText + "&limit=" + limit ;
	ajaxRequest.open("GET", "http://www.djtutor.com/authorization_files/authsubcomment2.php" + queryString, true);
	ajaxRequest.send(null); 
}

/*
// Attach event listeners to the buttons
function descboxListener() {

	if(!document.getElementById || !document.createElement ||!document.getElementById('descbox') )return;
  var descbox, commentbox, css, cutdesc1, cutdesc2, descrip;
  
  	css = document.createElement('link');
	css.setAttribute('href','/cutdesc.css');
	css.setAttribute('rel','stylesheet');
	css.setAttribute('type','text/css');
	document.getElementsByTagName('head')[0].appendChild(css);

	if(!document.getElementById || !document.createElement|| !document.getElementById('descbox')) return;
  
  // Get the menu element to access the btn divs
  descbox = document.getElementById('descbox');
  hdesc = descbox.getElementsByTagName('h4');
  cutdesc1 = document.getElementById('cutdesc1');
  cutdesc2 = document.getElementById('cutdesc2');
  //sdesc = adesc[0].getElementsByTagName('span');
  descrip = document.getElementById('descbody');
  desctextp = descrip.getElementsByTagName('p');
  desctext = desctextp[0].getElementsByTagName('span');
  commentbox = document.getElementById('commentbox');
  
  
  buylittlebody = document.getElementById('buylittlebody');
  show_desc_body = document.getElementById('show_desc_body');


	if(document.getElementById('buylittlebody') && document.getElementById('show_desc_body')) {

      cutdesc1.onclick = function(){ upsize(descbox); downsize(commentbox); hide(desctext[0]); unhide(desctext[1]); hide(cutdesc1); unhide(cutdesc2); hide(buylittlebody); unhide(show_desc_body); return false};
      cutdesc2.onclick = function(){ downsize(descbox); upsize(commentbox); unhide(desctext[0]); hide(desctext[1]); hide(cutdesc2); unhide(cutdesc1); unhide(buylittlebody); hide(show_desc_body); return false};
	} else {
		
      cutdesc1.onclick = function(){ upsize(descbox); downsize(commentbox); hide(desctext[0]); unhide(desctext[1]); hide(cutdesc1); unhide(cutdesc2); return false};
      cutdesc2.onclick = function(){ downsize(descbox); upsize(commentbox); unhide(desctext[0]); hide(desctext[1]); hide(cutdesc2); unhide(cutdesc1); return false};
		
	}
	
	
	}
// Attached to the buttons and ready to roll
function downsize(o) {
		o.className = 'box_short';
}
function upsize(o) {
		o.className = 'box_long';
}
function cut(o) {
	o.className == 'cutdesc';
} 
function uncut(o) {
    o.className = 'showdesc';
}

*/
// Attach event listeners to the buttons
function showSidebarListener() {

	
	if(!document.getElementById || !document.getElementById('sidebardetails') || !document.getElementById('wrapper') || !document.getElementById('container1') || !document.createElement)return;

  var sidebardetails, wrapper, container1;
  
  
  // Get the menu element to access the btn divs
  sidebardetails = document.getElementById('sidebardetails');
  pethau = sidebardetails.getElementsByTagName('ul');
  peth = pethau[0].getElementsByTagName('li');
  dolen = peth[0].getElementsByTagName('a');
  wrapper = document.getElementById('wrapper');
  containers = wrapper.getElementsByTagName('div');
  container1 = document.getElementById('container1');
  wts = container1.getElementsByTagName('div');
  
	for ( i=0; i<containers.length; i++ ) {

		if ( containers[i].className == 'containerextrawide' || containers[i].className == 'containernotsowide') {
		container = containers[i];
		}
		  peth[0].onclick = function(){ showSidebar(dolen[0]); showSidebar(dolen[1]); showSidebar(pethau[1]); showSidebar(pethau[2]); showSidebar(container); showSidebar(wts[1]); return false};
	
	
	}

	
}
// Attached to the buttons and ready to roll

function showSidebar(o) {
  // btn is our off state, so turn it on
  if (o.className == 'show_ref') {
    o.className = 'hide_ref';
  // Otherwise, turn it off
  } else {
  
	  if (o.className == 'hide_ref') {
		o.className = 'show_ref';
	  }
  }

  // btn is our off state, so turn it on
  if (o.className == 'show_ref_link') {
    o.className = 'hide_ref_link';
  // Otherwise, turn it off
  } else {
  
	  if (o.className == 'hide_ref_link') {
		o.className = 'show_ref_link';
	  }
  }

  if (o.className == 'containerextrawide') {
    o.className = 'containernotsowide';
  // Otherwise, turn it off
  } else {
  
	  if (o.className == 'containernotsowide') {
		o.className = 'containerextrawide';
	  }
  }

}


// Attach event listeners to the buttons
function dropSidebarListener() {

	
	if(!document.getElementById || !document.createElement)return;

  var flagnumber, i;
  var list = new Array();
  
  // Get the menu element to access the btn divs
  
  for (i=1; i<=12; i++) {
	  flagnumber = document.getElementById("flagnumber"+i);

	 
			  flagnumber.onclick = function(){  dropSidebar(this.getElementsByTagName('ul')[0]);};
  }

	
}
// Attached to the buttons and ready to roll

function dropSidebar(o) {
  // btn is our off state, so turn it on
  if (o.className == 'show_drop') {
    o.className = 'hide_drop';
  // Otherwise, turn it off
  } else {
  
	  if (o.className == 'hide_drop') {
		o.className = 'show_drop';
	  }
  }


}


function CountLeft(field, count, max) {
if (field.value.length > max) {
field.value = field.value.substring(0, max);
count.value = 0;
}//
else {
count.value = max - field.value.length;
}
}


function hide(o) {
    o.className = 'hidden';
}
function unhide(o) {
    o.className = '';
}
function setLong(o) {
    o.className = 'box_long';
}
function resetLength(o, c) {
  if (c.className == 'box_short') {
    o.className = 'box_long';
  // Otherwise, turn it off
  } else {
    o.className = 'box_short';
  }
}
function highlight_reply(o) {
	if(!document.getElementById || !document.getElementById('commentbox') ||!document.createElement)return false;
	

	var commentbox = document.getElementById('commentbox');
	liner = commentbox.getElementsByTagName('div');
	comments = liner[1].getElementsByTagName('div');
	for ($i=0; $i<comments.length; $i++){

			if (comments[$i].className =='comment') {
				
				links = comments[$i].getElementsByTagName('p');
			
			
				links = links[1].getElementsByTagName('a');
				
				if (links.length > 0) {
					
					reply_link = links[0];
				
				
				
					if (reply_link.className == 'highlight') {
						
							reply_link.className = '';
						
					}
				}
				
			}
	}

		o.className = 'highlight';

}
function posScrap(o, x, y, bigpic) {
	var posx, posy ;
	
	
	if (bigpic == 1) {
		posy = y *0.6
		posarrow = y * 0.4;
		posadj = 436;
	} else {
		posy = y * 0.2 ;		
		posarrow = y * 0.8;
		posadj = 218;
	}
	
	if (x < posadj) {
		posx = x + 25;
		o.style.background = 'transparent url(/images/gear/arrow-left.gif) left ' + posarrow + 'px no-repeat';

	} else {
		posx = x -150;
		o.style.background = 'transparent url(/images/gear/arrow-right.gif) right ' + posarrow + 'px no-repeat';
	}
	
	o.className = 'show_gearscrap';	
	o.style.left = posx + 'px';
	o.style.top = posy + 'px';

}

//Browser Support Code

function bannerlog(pagename, advertiser){
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				
				return false;
			}
		}
	}

	var queryString = "?pagename=" + pagename + "&advertiser=" + advertiser ;
	ajaxRequest.open("GET", "/phillip/ajax_bannerlog.php" + queryString, true);
	ajaxRequest.send(null); 
}

function ajaxPopProfile(name, target){
	var ajaxRequest;
// The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			target = target.parentNode.parentNode;
			target = target.getElementsByTagName('div');
			ajaxDisplay = target[0];
			ajaxDisplay.innerHTML = ajaxRequest.responseText;
		}
	}
	

	var queryString = "?name=" + name;
	ajaxRequest.open("GET", "/phillip/hd_fill.php" + queryString, true);
	ajaxRequest.send(null); 
}


function ajaxGeneral(node, page, queryString, separator){
	
	var node;
	var page;
	var queryString;
	var separator;
	
	if (!node) { return;}
	
	var ajaxRequest;  // The variable that makes Ajax possible!
//Browser Support Code
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				
				return false;
			}
		}
	}
	
	//separator?
	var sep;
	
	if (separator == 1) {
		
		sep = '<div class="separator"><!- xxxxxxxxxxx -></div>';
		
	} else {
		
		sep = '';
	
	}
	
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		
		if(ajaxRequest.readyState == 4){
			
			node.innerHTML = ajaxRequest.responseText + sep;
			
		}
		
	}
	var url =  "http://www.djtutor.com/ajax/" + page + ".php";
	ajaxRequest.open("GET", url + queryString, true);
	ajaxRequest.send(null); 
}

function setClass(node, dosbarth){
	
	node.className = dosbarth;

}



function confirmBox($confirmText) 
{

	if (confirm($confirmText)) {
		return true ;
	}
	else {
		return false ;
	}
}


function confirmPop($confirmText, destination) 
{

	if (confirm($confirmText)) {
		window.location= destination ;
	}
}

function ajaxGearpic(id){
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			var ajaxDisplay = document.getElementById('gearscrap');
			ajaxDisplay.innerHTML = ajaxRequest.responseText;
		}
	}
	
	
	var queryString = "?id=" + id ;
	ajaxRequest.open("GET", "/phillip/ajax_gearpic.php" + queryString, true);
	ajaxRequest.send(null); 
}


function clicklog(pagename, link_id){
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				
				return false;
			}
		}
	}

	var queryString = "?pagename=" + pagename + "&link_id=" + link_id ;
	ajaxRequest.open("GET", "/phillip/ajax_clicklog.php" + queryString, true);
	ajaxRequest.send(null); 
}

function suggestReplace (node, name) {
	
	var val = node.firstChild.nodeValue;
        document.getElementById('searchbigbox_' + name).value = val;
        node.parentNode.parentNode.parentNode.removeChild(node.parentNode.parentNode);
        
}

function ajaxSuggest(node, nm) {
   
    var val = node.value;
   var suggest = document.createElement('ul');
   var querystring;
   var page = 'suggest';
   var uls = node.parentNode.getElementsByTagName('ul');
   
   
   //AJAX 
	var ajaxRequest;  
//Browser Support Code
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				
				return false;
			}
		}
	}
	
	
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		
		if(ajaxRequest.readyState == 4){
                    
                    //if less than 20 results but no list, create one
                    
                        if(uls.length == 0 && ajaxRequest.responseText.length > 0) {
                            
                            node.parentNode.appendChild(suggest);
                        }
                        
                    //if more than 20 results, remove list
                        
                        if(ajaxRequest.responseText.length < 1 && uls.length > 0) {
                            
                                node.parentNode.removeChild(uls[0]);    

                        }
                        
                    //if less than 20 results, populate list
    
                        if( ajaxRequest.responseText.length > 0) {
			
                            uls[0].innerHTML = ajaxRequest.responseText;

                        }

		}
		
	}
        if (document.getElementById('searchbigbox_zn') && (!document.getElementById('searchbigbox_tb') || (document.getElementById('searchbigbox_tb') && document.getElementById('searchbigbox_tb') == 'videos' ))) {
		var zn = document.getElementById('searchbigbox_zn').value;
		querystring = '?val=' + val + '&zn=' + zn;
	} else {
		querystring = '?val=' + val;		
	}
	querystring = querystring + '&name=' + nm;
	var url =  "http://www.djtutor.com/ajax/" + page + ".php" + querystring;
	ajaxRequest.open("GET", url, true);
	ajaxRequest.send(null); 


}

function ajaxNewInput (node, zn, nm){
    
   	var node;
	var page;
        var zn;
        var sel;
        
       sel = document.getElementById('hidden_search').getElementsByTagName('div')[0].getElementsByTagName('select');
	
	if (!node) { return;}
	
	var ajaxRequest;  // The variable that makes Ajax possible!
//Browser Support Code
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				
				return false;
			}
		}
	}
	
	
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		
		if(ajaxRequest.readyState == 4 ){
                    
                    if(zn == 'tutor' && sel.length == 0) {
                        
			node.innerHTML = ajaxRequest.responseText ;
			//node.innerHTML = ;
			
                        
                    }
                    if(zn != 'tutor' && sel.length != 0) {
                        
                        node.innerHTML = '<label for="searchbigbox_va">Videos by: </label><input id="searchbigbox_va" name="va" type="text" autocomplete="off" onkeyup="ajaxSuggest(this, \'' + nm + '\')">';

                    }
                    
			
		}
		
	}
        page = 'droplist'
	var url =  "http://www.djtutor.com/ajax/" + page + ".php?name=" + name;
	ajaxRequest.open("GET", url, true);
	ajaxRequest.send(null); 
 
    
}


function ajaxShoplist(pagename, id, rows){
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			var ajaxDisplay = document.getElementById('shoplist');
			ajaxDisplay.innerHTML = ajaxRequest.responseText;
		}
	}
	
	
	var queryString = "?pagename=" + pagename + "&id=" + id + "&rows=" + rows;
	ajaxRequest.open("GET", "/phillip/ajax_shoplist.php" + queryString, true);
	ajaxRequest.send(null); 
}

//Browser Support Code
function ajaxAttendee(){
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			var target = document.getElementById('contactboxliner');
			target = target.getElementsByTagName('p');
			ajaxDisplay = target[0];
			ajaxDisplay.innerHTML = ajaxRequest.responseText;
		}
	}
	
	var event_id = document.getElementById('event_id').value;
	var queryString = "?event_id=" + event_id;
	ajaxRequest.open("GET", "/phillip/ajax-attendee.php" + queryString, true);
	ajaxRequest.send(null); 
}

//Browser Support Code
function ajaxFunction(){
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			var ajaxDisplay = document.getElementById('ajaxDiv');
			ajaxDisplay.innerHTML = ajaxRequest.responseText;
		}
	}
	
	var istart = document.getElementById('istart').value;
	for ($i=istart; $i<=10; $i++){
		if (document.getElementById("rating_" + $i).checked == true) {
			var rating = $i;
		}
	}
	var ref = document.getElementById('ref').value;
	var username = document.getElementById('username').value;
	var queryString = "?ref=" + ref + "&rating=" + rating + "&username=" + username;
	ajaxRequest.open("GET", "/phillip/ajax-rate.php" + queryString, true);
	ajaxRequest.send(null); 
}

//Browser Support Code
function ajaxPersist(){
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				
				return false;
			}
		}
	}
	
	ajaxRequest.open("GET", "/phillip/ajax_persist.php", true);
	ajaxRequest.send(null); 
}


/*
	Image Cross Fade Redux
	Version 1.0
	Last revision: 02.15.2006
	steve@slayeroffice.com

	Rewrite of old code found here: http://slayeroffice.com/code/imageCrossFade/index.html
*/

window.addEventListener?window.addEventListener('load',so_init,false):window.attachEvent('onload',so_init);

var d=document, imgs = new Array(), zInterval = null, current=0, pause=false;

function so_init()
{
	if(!document.getElementById || !document.createElement || !document.getElementById('rotator'))return;

	css = document.createElement('link');
	css.setAttribute('href','/djtutorstyleslideshow2.css');
	css.setAttribute('rel','stylesheet');
	css.setAttribute('type','text/css');
	document.getElementsByTagName('head')[0].appendChild(css);

	imgs = document.getElementById('rotator').getElementsByTagName('img');
	for(i=1;i<imgs.length;i++) imgs[i].xOpacity = 0;
	imgs[0].style.display = 'block';
	imgs[0].xOpacity = .99;

	setTimeout(so_xfade,3000);
}

function so_xfade()
{
	cOpacity = imgs[current].xOpacity;
	nIndex = imgs[current+1]?current+1:0;
	nOpacity = imgs[nIndex].xOpacity;

	cOpacity-=.05;
	nOpacity+=.05;

	imgs[nIndex].style.display = 'block';
	imgs[current].xOpacity = cOpacity;
	imgs[nIndex].xOpacity = nOpacity;

	setOpacity(imgs[current]);
	setOpacity(imgs[nIndex]);

	if(cOpacity<=0)
	{
		imgs[current].style.display = 'none';
		current = nIndex;
		setTimeout(so_xfade,3000);
	}
	else
	{
		setTimeout(so_xfade,50);
	}

	function setOpacity(obj)
	{
		if(obj.xOpacity>.99)
		{
			obj.xOpacity = .99;
			return;
		}

		obj.style.opacity = obj.xOpacity;
		obj.style.MozOpacity = obj.xOpacity;
		obj.style.filter = 'alpha(opacity=' + (obj.xOpacity*100) + ')';
	}
}

function prepareHiddenInformation() {
	if (!document.getElementsByTagName) return false;	// Checks to make sure this function exists. Halts execution of script if not
	if (!document.getElementById) return false;	// Checks to make sure this function exists. Halts execution of script if not
	if (!document.getElementsByClassName('hidden_content')) return false;	// Checks to make sure this function exists. Halts execution of script if not

	
	var $hidden_content_boxes = document.getElementsByClassName('hidden_content');	// Gets list of all elements with class of 'hidden_content'
	for (var $i=0; $i<$hidden_content_boxes.length; $i++) {	// loops through the whole list...
		var $hidden_content_box = $hidden_content_boxes[$i];	// allocates each element to a variable (for easier reading)
		
		var $link = document.createElement('a');	// creates the toggle action link
		$link.onclick = function() {	// give the link an action when it is clicked. This action is as follows:
			if (this.getAttribute('status') == 'open') {	// if the link has a 'status' (internal variable) of 'open' the continue to close it, otherwise skip next 9 lines
				$hidden_content_box_id = this.getAttribute('rel');	// get the id of the box to be hidden from the link which has been clicked (each link is associated to a box)
				$hidden_content_box = document.getElementById($hidden_content_box_id);	// get the actual element to be hidden by its ID
				$hidden_content_box.style.display = 'none';	// give this element a CSS declaration of display:none; to hide it
				
				this.setAttribute('status','closed');	// update the link's status variable to 'closed'
				var $old_text = this.childNodes[0];	// get the old text (within the link element)
				this.removeChild($old_text);	// delete this old link text
				var $text = document.createTextNode('See last 10 comments');	// create new text saying 'More Information >>>'
				this.appendChild($text);	// Insert the new text within the link element
			}
			else {	// if the link does not have a 'status' (internal variable) of 'open' then it must be closed already. Continue to open it, otherwise skip next 9 lines
				$hidden_content_box_id = this.getAttribute('rel');	// get the id of the box which is no longer to be hidden from the link which has been clicked (each link is associated to a box)
				$hidden_content_box = document.getElementById($hidden_content_box_id);	// get the actual element no longer to be hidden by its ID
				$hidden_content_box.style.display = 'block';	// give this element a CSS declaration of display:block; to show it
				
				this.setAttribute('status','open');	// update the link's status variable to 'open'
				var $old_text = this.childNodes[0];	// get the old text (within the link element)
				this.removeChild($old_text);	// delete this old link text
				var $text = document.createTextNode('Hide comments');	// create new text saying 'Less Information <<<'
				this.appendChild($text);	// Insert the next text within the link element
			}
		}

		$link.setAttribute('title','Information');	// Give the link a non-specific title attribute
		$link.className = 'information_link';	// Give the link a class (for CSS styling)
		var $hidden_content_box_id = 'hidden_content'+$i;	// Create unique string 'hidden_content#' where '#' represents a unique integer and assign it to a variable
		$hidden_content_box.setAttribute('id',$hidden_content_box_id);	// Set the unique ID of the content as the unique value (above).
		$link.setAttribute('rel',$hidden_content_box_id);	// Set the 'rel' attribute with the same unique ID as above. This creates our associative connection between the link and the box it controls.
		var $text = document.createTextNode('See last 10 comments');	// Create a text string 'More Information >>>'. This will act as a default link text when inserted into the link (below)
		$link.appendChild($text);	// Set the link text from the string (above)
		var $parent = $hidden_content_box.parentNode;	// Get the content box's parent element and assign it to a variable
		$parent.insertBefore($link,$hidden_content_boxes[$i]);	// Insert the link into the parent element, directly before the content box which will be hidden



	}
}


// Executes the prepareHiddenInformation function when page loads
window.onload = function() {
	prepareHiddenInformation();
}


// Function to return a list of elements with a specific class attribute
document.getElementsByClassName = function($class) {
	var $results = Array();
	var $elements = document.getElementsByTagName("*");
	for (var $i=0; $i<$elements.length; $i++) {
		var $classes = $elements[$i].className.split(" ");
		for (var $j=0; $j<$classes.length; $j++) {
			if ($classes[$j] == $class) {
				$results[$results.length] = $elements[$i];
			}
		}
	}
	return $results;
}


// In order to pass the safety checks this section must appear AFTER the getElementsByClassName function (above)
if (document.getElementsByTagName && document.getElementsByClassName) {
	// Create a link to the Javascript-only stylesheet, which will primarily hide the hidden text
	var $link_element = document.createElement('link');
	$link_element.setAttribute("rel","stylesheet");
	$link_element.setAttribute("href","/javascript_only.css");
	$link_element.setAttribute("media","screen");
	
	// Append this stylesheet link to the document
	var $head_element = document.getElementsByTagName('head')[0];
	$head_element.appendChild($link_element);
	

}

	window.onload = function() {
	 
	  //searchBigBoxListener();	 
	  showSidebarListener();
	  dropSidebarListener();
	}

// -->