var videos = [], initVid, which = 0, pid = gQV("pid"), which = 0, q;
var eyeframe = '/kids/stacks/include/video.html?pID=';
	
addDOMLoadEvent(function(){
	jQuery('#schlVideoCategory a').each(function(index){
		videos[index] = { title:  this.title  , pid:  this.href.split("/").pop()  };		
		jQuery(this).click(function(){
			var q = eyeframe + videos[index].pid;
			jQuery('#schlVideos').attr('src', q);
			jQuery('#schlVideoCategory a').removeClass();
			jQuery('#vGames').remove();
			jQuery(this).addClass('on');
			return false;
		});									 
	});	
	
	
	if ( pid != null ) {
		for (var i=0; i<videos.length; i++) { 
			if ( pid == videos[i].pid ) { 
				which = i;				
				break;
			} 			
		}			
	}
	
	
	//q = eyeframe + videos[which].pid;
	q = '/kids/stacks/include/video.html' + location.search;
	jQuery('#schlVideoCategory a').eq(which).addClass('on');
	jQuery('#schlVideos').attr('src', q);		
		
});

