$(document).ready(function() {

	// Search input field default text change
	$('.search_input').focus(function ()
		{ 
		var currentText = this.value;
		if (currentText == "Search...")
			{
			this.value = "";
			};
		});
	$('.search_input').blur(function ()
		{ 
		var currentText = this.value;
		if (currentText == "")
			{
			this.value = "Search...";
			};
		});
	
	
	// Tabs navigation for code examples
	$(function ()
		{
		
		myItem = '.tabs_boxes1';
		var tabLinks1 = $(myItem + ' ul a');
		var tabContainers1 = $(myItem + ' .code_padding > div');
		tabLinks1.click(function ()
			{
			tabContainers1.hide().filter(this.hash).show();
			tabLinks1.removeClass('selected');
			$(this).addClass('selected');
			return false;
			}).filter(':first').click();
		
		myItem = '.tabs_boxes2';
		var tabLinks2 = $(myItem + ' ul a');
		var tabContainers2 = $(myItem + ' .code_padding > div');
		tabLinks2.click(function ()
			{
			tabContainers2.hide().filter(this.hash).show();
			tabLinks2.removeClass('selected');
			$(this).addClass('selected');
			return false;
			}).filter(':first').click();
		
		myItem = '.tabs_boxes3';
		var tabLinks3 = $(myItem + ' ul a');
		var tabContainers3 = $(myItem + ' .code_padding > div');
		tabLinks3.click(function ()
			{
			tabContainers3.hide().filter(this.hash).show();
			tabLinks3.removeClass('selected');
			$(this).addClass('selected');
			return false;
			}).filter(':first').click();
		
		myItem = '.tabs_boxes4';
		var tabLinks4 = $(myItem + ' ul a');
		var tabContainers4 = $(myItem + ' .code_padding > div');
		tabLinks4.click(function ()
			{
			tabContainers4.hide().filter(this.hash).show();
			tabLinks4.removeClass('selected');
			$(this).addClass('selected');
			return false;
			}).filter(':first').click();
		
		myItem = '.tabs_boxes5';
		var tabLinks5 = $(myItem + ' ul a');
		var tabContainers5 = $(myItem + ' .code_padding > div');
		tabLinks5.click(function ()
			{
			tabContainers5.hide().filter(this.hash).show();
			tabLinks5.removeClass('selected');
			$(this).addClass('selected');
			return false;
			}).filter(':first').click();
		
		myItem = '.tabs_boxes6';
		var tabLinks6 = $(myItem + ' ul a');
		var tabContainers6 = $(myItem + ' .code_padding > div');
		tabLinks6.click(function ()
			{
			tabContainers6.hide().filter(this.hash).show();
			tabLinks6.removeClass('selected');
			$(this).addClass('selected');
			return false;
			}).filter(':first').click();
		
		myItem = '.tabs_boxes7';
		var tabLinks7 = $(myItem + ' ul a');
		var tabContainers7 = $(myItem + ' .code_padding > div');
		tabLinks7.click(function ()
			{
			tabContainers7.hide().filter(this.hash).show();
			tabLinks7.removeClass('selected');
			$(this).addClass('selected');
			return false;
			}).filter(':first').click();
		
		myItem = '.tabs_boxes8';
		var tabLinks8 = $(myItem + ' ul a');
		var tabContainers8 = $(myItem + ' .code_padding > div');
		tabLinks8.click(function ()
			{
			tabContainers8.hide().filter(this.hash).show();
			tabLinks8.removeClass('selected');
			$(this).addClass('selected');
			return false;
			}).filter(':first').click();
		
		myItem = '.tabs_boxes9';
		var tabLinks9 = $(myItem + ' ul a');
		var tabContainers9 = $(myItem + ' .code_padding > div');
		tabLinks9.click(function ()
			{
			tabContainers9.hide().filter(this.hash).show();
			tabLinks9.removeClass('selected');
			$(this).addClass('selected');
			return false;
			}).filter(':first').click();
		
		myItem = '.tabs_boxes10';
		var tabLinks10 = $(myItem + ' ul a');
		var tabContainers10 = $(myItem + ' .code_padding > div');
		tabLinks10.click(function ()
			{
			tabContainers10.hide().filter(this.hash).show();
			tabLinks10.removeClass('selected');
			$(this).addClass('selected');
			return false;
			}).filter(':first').click();
		
		});
	
	
	// CORRECT PRE TAGS WITHOUT ANY CLASS
	
	$('pre:not(.code_text)').each(function(){
		{
		$(this).wrap('<div class="code_box"><div class="textarea_repeater"><div class="textarea_top"><div class="textarea_bottom"><div class="code_padding"></div></div></div></div></div>');
		$(this).addClass('code_text');
		};
	});

});