	$("head").append("<link>");
	css = $("head").children(":last");
	css.attr({
    	rel:  "stylesheet",
		type: "text/css",
		href: "/carousel/enabletabs.css"
    });



/*---------------------------------------------MAIN IAMGE JQUERY -----------------------------------*/

	$(document).ready(function() {
        var randomNo = (Math.floor(Math.random()*100) % NOOFBOXES) + 1;
        if (randomNo == 2)
            id2show = "two";
        else if (randomNo == 3){
            id2show = "three";
           /* $(".holder").attr('id','videoholder');
            $("#tab a").each(function(){
                $("#content_" + $(this).attr('id')).css('display','none');
            });*/
        }
        else 
            id2show = "one";
    $(".main-image-homepage").css({backgroundImage:'url('+$("#" + id2show ).attr("content")+')'});
    $("#" + id2show).addClass('selected');
    $("#content_" + id2show).css('display','block');
       
    $("#tab a").click(function() {
            $(".main-image-homepage").css({backgroundImage:'url('+$(this).attr("content")+')'});
            $("#tab a").removeClass('selected').each(function(){
                $("#content_" + $(this).attr('id')).css('display','none');
            });
            $(this).addClass('selected');
           /*   Need for video section
	    
	    if($(this).attr('id') == 'three'){
               $(".holder").attr('id','videoholder');
            }
            else{
               $(".holder").attr('id','novideo');
            }*/
            $("#content_" + $(this).attr('id')).css('display','block');       
        });
    

});





/*---------------------------------------------BOTTOM RIGHT TOUT JQUERY -----------------------------------*/

var main_xml = '';
var items = [];
var item_swap_count = 0;
var timer_1;
var pause_mode = 'pause';

	$(document).ready(function() {
		$.ajax({
			type: "GET",
			url: '/assets/content/tout_right_carousel.xml', 
			/*dataType: ($.browser.msie) ? "text/xml" : "xml",   Used before jquery 1.7*/
			dataType: "xml",
			error: function(e){alert(e);},
			success: function(data) {
	            if (typeof data == "string") {
	                main_xml = new ActiveXObject("Microsoft.XMLDOM");
	                main_xml.async = false;
	                main_xml.loadXML(data);
	            } 
	            else {
	            	main_xml = data;
	            }
				loadSwap();
			}
		});
		/*$("#playPause").click(function() {
			pausePlaySwap(pause_mode);		
		});*/
	});
	
	function loadSwap() {
		var tmp = '';
		var max_height = 0;

		$("#carousel").css("display", "none");
		
		$(main_xml).find("item").each(function() {
			tmp = "<div id='image'><img src='" + $(this).find("image").text() +"' alt='" + $(this).find("alt").text() + "'></div>"; 
		            tmp += "<p><span>" +$(this).find("title").text()+"</span><br/>";
			tmp += $(this).find("description").text()+"</p>";
			items[items.length] = tmp;
			
		});
        for (var x=0; x < items.length; x++) {
			$("#carousel").html(items[x])
            
			if ($("#carousel").height() + 40 > max_height)
				max_height = $("#carousel").height() + 40;
			}

		$("#carousel").css("min-height", max_height + "px");
		$("#carousel").css("display", "block");
		//startSwap();
	}


		
	function startSwap() {
		$("#carousel").html(items[item_swap_count]);
		
		if (item_swap_count == items.length) 
			item_swap_count = 0;
		else
			item_swap_count++;
		/*
       if (pause_mode != 'play') /*what button is showing - to play - or to pause       
		   timer_1 = setTimeout("startSwap()", 7000);*/
	}
	
	function nextPrevSwap(move_image) {
		//clearTimeout(timer_1);
		
		if (move_image == 'next') {
			if (item_swap_count == items.length) 
				item_swap_count = 0;
		}
		else if (item_swap_count-1 == 0) {
			item_swap_count = items.length-1;
		}
 		else {
			item_swap_count = (item_swap_count-2 < 0) ? 0 : item_swap_count-2;
		}
		
          startSwap();	
	}
	/*
	function pausePlaySwap() {
		if (pause_mode == 'pause') {
			$("#playPause").removeClass('pause').addClass('play').unbind('click').click(function() {
				pausePlaySwap();			
			});
           pause_mode = 'play';
           clearTimeout(timer_1);
		}
		else {
        $("#playPause").removeClass('play').addClass('pause').unbind('click').click(function() {
			pausePlaySwap();		
		});
        pause_mode = 'pause';
     //   startSwap();
		}
 	}*/


