
;(function($){
	$(function(){

		/************* CODE FOR INPUT EFFECTS  ********/
		$('input:text').focus(function(){
			if(this.value==this.defaultValue){this.value=''}
		})
		$('input:text').blur(function(){
			if(!this.value){this.value=this.defaultValue;}
		})
		$('input:password').focus(function(){
			if(this.value==this.defaultValue){this.value=''}
		})
		$('input:password').blur(function(){
			if(!this.value){this.value=this.defaultValue;}
		})
		$('textarea').focus(function(){
			if(this.value==this.defaultValue){this.value=''}
		})
		$('textarea').blur(function(){
			if(!this.value){this.value=this.defaultValue;}
		})
		/************* END CODE FOR INPUT EFFECTS  ********/
		
		/************* CODE FOR PICTURENAV EFFECTS  ********/
		$('div.picture-nav > ul > li > a > img').hide()
		var $listItem = $('div.picture-nav > ul > li')
		$listItem.mouseenter(function(){
			$imgTomouseOverAndOut = $(this).find('img')
			$(this).css({'z-index':5})
			$imgTomouseOverAndOut.css({ display: 'block'})
			$imgTomouseOverAndOut.animate({width:'179px', height:'179px', left:'-47px', top:'-70px'},150 )
			
		})
		$listItem.mouseleave(function(){
			$imgTomouseOverAndOut = $(this).find('img')
			$imgTomouseOverAndOut.animate({width:'114px', height:'114px', left:'-14px', top:'-14px'},150, function(){
				$(this).css({ display: 'none'})
			} )
			$(this).css({'z-index':3})
		})				
	 	/************ END CODE FOR PICTURENAV EFFECTS  *****/
		
		var changeTheBackgroundAuto = false
		changeTheBackgroundAuto = setInterval( 'backGroundChangeRandomly()', 10000 )// Automatically change the background images.
		
		var autoSliding = false
		autoSliding = setInterval( 'iindevslideShowinIt()', 5000 )// Automatically change the slide images.
			
	})// END OF DOCUMENT READY FUNCTION
	

})(jQuery)

/************* CODE FOR RANDOM BACKGROUND CHANGES   ********/
function backGroundChangeRandomly() {
    var $active = $('#randomBg-container img.active')
    if ( $active.length == 0 ) $active = $('#randomBg-container img:last')
    var $next =  $active.next().length ? $active.next(): $('#randomBg-container img:first')
    $active.addClass('last-active')

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 700, function() {
            $active.removeClass('active last-active')
        })// End of next animate()
}
/*********** END CODE FOR RANDOM BACKGROUND CHANGES ********/

/************* CODE FOR SLIDING IMAGE  CHANGES   ********/
function iindevslideShowinIt() {
    var $active = $('div.slideshow-box div img.active')
    if ( $active.length == 0 ) $active = $('div.slideshow-box div img:last')
    var $next =  $active.next().length ? $active.next(): $('div.slideshow-box div img:first')
    $active.addClass('last-active')

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 700, function() {
            $active.removeClass('active last-active')
        })// End of next animate()
}
/*********** END CODE FOR SLIDING IMAGE  CHANGES ********/

