/*
Copyright: 2011 The Open Window School of Visual Communication
Author: Mark Zeller
Revision: 1 (05/2011)
*/
/*-----------------------Beta Graphic--------------------------*/

            $(window).ready(function() {
               
                /* $("body").append("<div id=\"globSide\"><a class=\"rollDown\" href=\"about/news/talent-scout-competition/\"></a></div>");
                */
                $("#MemberLoginForm_LoginForm_error.message.bad").append("<strong>The login attempt was unsuccessful.</strong> Please check the credentials you are entering and try again.");
                $("#MemberLoginForm_LoginForm_error.message.bad").show();
                
      

$('#globSide').hoverIntent(
	function(){
		$(this).children('.rollDown').animate({
			height:'156px'
		}, 500)
	},
	function(){
		$(this).children('.rollDown').animate({
			height:'70px'
		}, 500)
	}
);
            });
            

            
/*--------------Home Page Loader, Slideshow, Rotator-----------------*/
			
             $(window).ready(function() {
    
                $('.slideshow').cycle({
                    fx: 'fade'
                });
    });
            
            $(window).ready(function()
			{
				setupRotator();
				
			});	
			
            function setupRotator()
                {
                    if($('.annonceItem').length > 1)
                        {
                    $('.annonceItem:first').addClass('current').fadeIn(1000);
					setInterval('textRotate()', 8000);
                        } else {
                            $('.annonceItem:first').addClass('current');
                            $('.annonceItem:first').css("display", "block");
                            }
                }
			
                function textRotate()
                    {
                        var current = $('#annonce > .current');
                        if(current.next().length == 0)
                            {
                                current.removeClass('current').fadeOut(1000);
                                $('.annonceItem:first').addClass('current').fadeIn(1000);
                            }
                                else
                                    {
                                        current.removeClass('current').fadeOut(1000);
                                        current.next().addClass('current').fadeIn(1000);
                                    }
                    }
                    
   $(document).ready(function()
                    {
                $('#loading').fadeOut(350);
                $('.slideshow-holder').fadeIn(500);
                $('#midConsole').fadeIn(500);
                $('#col2').fadeIn(500);
                $('#col3').fadeIn(500);
                $('#col1').fadeIn(500);
        }); 
        
		
/*----------------------- Twitter Feed --------------------------*/
getTwitters('tweet', {
  id: 'openwindowpta',
  count: 1,
  enableLinks: true,
  ignoreReplies: true,
  clearContents: true,
  template: '“%text%”',
  dataType: "json"
});


/*----------------------- Search Field --------------------------*/
function clickclear(thisfield, defaulttext) {
if (thisfield.value == defaulttext) {
thisfield.value = "";
}
}
function clickrecall(thisfield, defaulttext) {
if (thisfield.value == "") {
thisfield.value = defaulttext;
}
}    

/*--------------- Footer Fix for 'i' navigators ------------------*/

if(navigator.platform == 'iPad' || navigator.platform == 'iPhone' || navigator.platform == 'iPod')
{
     $("#footer").css("position", "static");
     $("#bottomBar").css("margin-top","-29px");
     $("#bottomBar").css("position", "static");

};

if (($("#navSub").length > 0)){
} else {
     $('#mainContainer').attr('id', 'primaryContainer');
     $('#pageTitle').hide();
     $('.pageShadow').hide();
}
