var xTimer;
var xSlideTop=0;
var xWaitTimeline=7000;
var xAnimate=1;
function xResumeAnimation(){
    xAnimate=1;
    xSlideTopF();
}
function xSlideTopFB(){
    jQuery('.xDotA').removeClass('xDotSelected');
    jQuery('.xDotB').removeClass('xDotSelected');
    jQuery('.xDotC').removeClass('xDotSelected');

    switch(xSlideTop){
        case 0:
            jQuery('.xDotA').addClass('xDotSelected');
            break;
        case 268:
            jQuery('.xDotB').addClass('xDotSelected');
            break;
        case 536:
            jQuery('.xDotC').addClass('xDotSelected');
            break;
        default:
            jQuery('.xDotA').addClass('xDotSelected');
            break;
    }

    if(xAnimate == 0){
        clearTimeout(xTimer);
        xTimer = 0;
        jQuery('.xSliderB').animate({
            marginTop:-xSlideTop
        },500,'swing',xResumeAnimation);
    }else{
        jQuery('.xSliderB').animate({
            marginTop:-xSlideTop
        },500);
        xSlideTopF();
    }
}
function xSlideTopF(){
    if(xSlideTop >=268*2){
        xSlideTop=0;
    }else{
        xSlideTop = xSlideTop + 268;
    }
    clearTimeout(xTimer);
    xTimer = setTimeout('xSlideTopFB()', xWaitTimeline);

}

jQuery(document).ready(function($){

$('#s').click(function(){
    if($('#s').val()=="Search here..."){
        $('#s').val('');
    }
});
    $('.xDotA').addClass('xDotSelected');
    $('.xDotA').click(function(){
        xWaitTimeline=0;
        xAnimate=1;
        xSlideTop=1072;
        xSlideTopF();
        xWaitTimeline=14000;
    });
    $('.xDotB').click(function(){
        xWaitTimeline=0;
        xAnimate=1;
        xSlideTop=0;
        xSlideTopF();
        xWaitTimeline=14000;
    });
    $('.xDotC').click(function(){
        xWaitTimeline=0;
        xAnimate=1;
        xSlideTop=268;
        xSlideTopF();
        xWaitTimeline=14000;
    });
    xSlideTopF();
});



// DropDown

startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
}
node.onmouseout=function() {
this.className=this.className.replace(" over", "");
}
}
}
}
}
window.onload=startList;
//activate this if you don't put it into the body tag <body onload="startList();"> 
