/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
var no =0;
var imgId =0;
var fadeTime = 1500;
var changTime = 1000;

$(function(){

    /*
    $("div#background").everyTime(changTime,'timer01',function(){
        changeBackgroundImg();
    });
    */
    $('div#menu div').mouseout(function(){
        /*
        $("div#background").everyTime(changTime,'timer01',function(){
            changeBackgroundImg();
        });
        */
    });

$('div#menu a').mouseover(function(){
    //$("div#background").stopTime('timer01');
    $("div#background" + no ).clearQueue();
    $("div#background"+ no).animate({opacity: 0}, 1500 );

    var name = $(this).attr("id");
        switch (name ) {
            case "wineMap":
                no ="01"
                break
            case "leanFrom":
                no ="02"
                break
            case "vineyards":
                no ="03"
                break
            case "advanceSearch":
                no ="04"
                break;
            default:
                 no ="04"
        }
        $("div#background"+ no).animate({opacity: 1}, 1500 );
    });

	$('#keywordText')
		.focus(function(){
			$(this).select();
		})
		.click(function(){
			$(this).select();
			return false;
		});

    function changeBackgroundImg(){
        $("div#background"+ "0" + imgId).animate({opacity: 0}, 1500 );
        if (++imgId > 4){
            imgId =1;
        }
        $("div#background"+ "0" + imgId).animate({opacity: 1}, 1500 );
    }


    /**
     * Scroll
     */
    // detail privacyContents
   $('div#reslut div#detailInfo').jScrollPane({showArrows:true, scrollbarWidth:11});
   $('div#privacyContents div#message').jScrollPane({showArrows:true, scrollbarWidth:11});
   $('div#contactContents div#contactDetail').jScrollPane({showArrows:true, scrollbarWidth:11});
   $('div#contactContents div#inputConfirm').jScrollPane({showArrows:true, scrollbarWidth:11});
   $('div#companyInfoArea div#companyContentsBase').jScrollPane({showArrows:true, scrollbarWidth:11});
   $('div#suggestionContents div#message').jScrollPane({showArrows:true, scrollbarWidth:11});
   $('div#newsContents div#newsLists').jScrollPane({showArrows:true, scrollbarWidth:11});
   $('div#newsContents div#detail').jScrollPane({showArrows:true, scrollbarWidth:11});

});
