var browserName = BrowserDetect.browser;
var browserVersion = BrowserDetect.version;
var browserOS = BrowserDetect.OS;
var inactive = "inactive";
var active = "active";
var focused = "focused";

this.label2value = function(){	

	$("label").each(function(){		
		obj = document.getElementById($(this).attr("for"));
		if(($(obj).attr("type") == "text") || (obj.tagName.toLowerCase() == "textarea")){			
			$(obj).addClass(inactive);			
			var text = $(this).text();
			$(this).css("display","none");			
			$(obj).val(text);
			$(obj).focus(function(){	
				$(this).addClass(focused);
				$(this).removeClass(inactive);
				$(this).removeClass(active);								  
				if($(this).val() == text) $(this).val("");
			});	
			$(obj).blur(function(){	
				$(this).removeClass(focused);													 
				if($(this).val() == "") {
					$(this).val(text);
					$(this).addClass(inactive);
				} else {
					$(this).addClass(active);		
				};				
			});				
		};	
	});		
};

$(document).ready(function() {
	$('div.corneredBanner').corner("7px");
	$('div.corneredGeneral').corner("round 5px");
	$('div.corneredBox').corner("5px");
	$('div.corneredImages').corner("7px");
	label2value();	
	$("img[@src$=png]").pngfix();
});

function LoadVideoBar() {
	var vbr;
	var vbt;
	if ( $("#videoBar").length > 0 ) {
		var options = {
			string_allDone : "CLOSE THIS PLAYER",
			largeResultSet : false,
			horizontal : true,
			thumbnailSize : GSvideoBar.THUMBNAILS_SMALL,
			autoExecuteList : {
				cycleTime : GSvideoBar.CYCLE_TIME_MEDIUM,
				cycleMode : GSvideoBar.CYCLE_MODE_LINEAR,
				executeList : ["ytchannel:bodog"]
			}
		}
		vbr = new GSvideoBar(
					document.getElementById("videoBar"),
					GSvideoBar.PLAYER_ROOT_FLOATING,
					options
		);
	}
	if ( $("#videoBarTop").length > 0 ) {
		if ( $("#videoBar").length > 0 ) {
			options = {
				master : vbr,
				string_allDone : "CLOSE THIS PLAYER",
				largeResultSet : false,
				horizontal : true,
				thumbnailSize : GSvideoBar.THUMBNAILS_MEDIUM,
				autoExecuteList : {
					cycleTime : GSvideoBar.CYCLE_TIME_MEDIUM,
					cycleMode : GSvideoBar.CYCLE_MODE_LINEAR,
					executeList : ["ytchannel:bodog"]
				}
			}
			vbt = new GSvideoBar(
						document.getElementById("videoBarTop"),
						null,
						options
			);
		} else {
			options = {
				string_allDone : "CLOSE THIS PLAYER",
				largeResultSet : false,
				horizontal : true,
				thumbnailSize : GSvideoBar.THUMBNAILS_MEDIUM,
				autoExecuteList : {
					cycleTime : GSvideoBar.CYCLE_TIME_MEDIUM,
					cycleMode : GSvideoBar.CYCLE_MODE_LINEAR,
					executeList : ["ytchannel:bodog"]
				}
			}
			vbt = new GSvideoBar(
					document.getElementById("videoBarTop"),
					GSvideoBar.PLAYER_ROOT_FLOATING,
					options
			);
		}
	}
	//vbr.execute("ytchannel:bodog");
}
/**
* Arrange for LoadVideoBar to run once the page loads.
*/
GSearch.setOnLoadCallback(LoadVideoBar);
