var browse = navigator.appName;
var basePath = "";

if (browse == 'Netscape') {
    $(".ali").css("margin-left","0px");
} else if (browse == 'Microsoft Internet Explorer') {
    var version = navigator.appVersion;
    if (version.indexOf('MSIE 6.0')) {
        
    } else if(version.indexOf('MSIE 7.0')) {
        $(".ali").css("margin-left","0px");
    } else{
        $(".ali").css("margin-left","0px");
    }
}
    
$(document).ready(function() {        
    var browse = navigator.appName;
    if (browse == 'Netscape') {
        $(".ali").css("margin-left", "0px");
    } else if(browse == 'Microsoft Internet Explorer') {
        var version = navigator.appVersion;
        if (version.indexOf('MSIE 6.0')) {
        } else if(version.indexOf('MSIE 7.0')) {
            $(".ali").css("margin-left", "0px");
        } else {
            $(".ali").css("margin-left", "0px");
        }
    }
});

$(document).ready(function() {
    $(".click").removeClass('sel');
    $(".prew").click(page); 
    $(".next").click(page);
    $('.rollOver').click(function () {
        $('.selectedBar').slideUp('slow', function () {
            $('#navigation').removeClass('secNavWrapOff').addClass('secNavWrapOn');
            $('#navigation ul').css('display', 'none').slideDown('slow');
        });
    });
    $('#ch').click(function () {
        //, function () {
		//$('#wrapper2').slideUp('slow');
		$('#bar').slideDown('slow');
        $('#navigation').removeClass('secNavWrapOn').addClass('secNavWrapOff');
        $('#navigation ul').slideUp('slow').css('display', '');
		$('.selectedBar').slideDown('slow');
        //});
    });

    $(".click").click(test);
	
	
    function test() {
        $(".click").removeClass("sel");
        var id = $(this).attr("id");
        id = id.slice(1);
        $("#" + $(this).attr('id')).addClass('sel');
        ajax(basePath + 'ajax_service.html', 'fetchDescription=1&serviceId=' + id, 'con');
        ajax(basePath + 'ajax_service.html', 'fetchDescription=2&serviceId=' + id, 'a2selected');
        ajax(basePath + 'ajax_service.html', 'fetchDescription=3&serviceId=' + id, 'ch');
        ajax(basePath + 'ajax_service.html', 'fetchDescription=4&serviceId=' + id, 'serviceSkip');
        ajax(basePath + 'ajax_service.html', 'fetchDescription=5&serviceId=' + id, 'col1');
    }
     
    function ajax(url, dataString, divId) {
        $('#thumbs').html('');
        
        $.ajax({
            type: "POST",  
            url: url,  
            data: dataString,  
            success: function(response) {
                $("#load").hide();
                $('#' + divId).html(response);
                $(".prew").click(page); 
                $(".next").click(page); 
                $(this).addClass('selected2');
            }
        });

        $('.selectedBar').css('display', 'none');

        $('#navigation ul').css('display', 'block').slideUp(1200, function() {
            $('#navigation').removeClass('secNavWrapOn').addClass('secNavWrapOff');
            $('#navigation').addClass('secNavWrapOff');
            $('.selectedBar').slideDown('slow');
        });
    }
});
            
function page() {
 /*   var id = $(this).attr("id");
    id = id.slice(1);
    var type = $(this).attr("class");
    ajax2(basePath + 'ajax_service.html', 'fetchDescription=1&serviceId=' + id + '&type=' + type, 'con');
    ajax2(basePath + 'ajax_service.html', 'fetchDescription=2&serviceId=' + id + '&type=' + type, 'a2selected');
    ajax2(basePath + 'ajax_service.html', 'fetchDescription=3&serviceId=' + id + '&type=' + type, 'ch');
    ajax2(basePath + 'ajax_service.html', 'fetchDescription=4&serviceId=' + id + '&type=' + type, 'serviceSkip');
    ajax2(basePath + 'ajax_service.html', 'fetchDescription=5&serviceId=' + id + '&type=' + type, 'col1');*/
}

function ajax2(url, dataString, divId) {
    $('#thumbs').html('');

    $.ajax({
        type:    "POST",
        url:     url,
        data:    dataString,
        success: function(response) {
            $("#load").hide();
            $('#' + divId).html(response);
            $(".prew").click(page);
            $(".next").click(page);
        }
    });
}

