﻿ $(document).ready(function () {
        $(".paging_div").show();
        $(".paging_div a:first").addClass("active");
        var spanwidth = $(".window").width();
        var spansum = $(".content_div span").size();
        var content_div_width = spanwidth * spansum;
        $(".content_div").css({ 'width': content_div_width });
        rotate = function () {
            var triggerid = $active.attr("rel") - 1;
            var span_position = triggerid * spanwidth;
            $(".paging_div a").removeClass('active');
            $active.addClass('active');
            $(".content_div").animate(
		{
		    left: -span_position
		}, 500);
        };
        rotateSwitch = function () {
            play = setInterval(function () {
                $active = $('.paging_div a.active').next();

                if ($active.length == 0) {

                    $active = $('.paging_div a:first');

                }
                rotate();
            }, 5000);
        };
        rotateSwitch();
        $(".content_div span").hover(function () {
            clearInterval(play);
        }, function () {
            rotateSwitch();
        });
        $(".paging_div a").click(function () {
            $active = $(this);
            clearInterval(play);
            rotate();
            rotateSwitch();
            return false;
        });
    });
    
    
     $(document).ready(function () {
            //hide the all of the element with class msg_body
            $(".msg_body").hide();
            //toggle the componenet with class msg_body
            $("p#msg_headP").click(function () {
               if($(this).next(".msg_body").is(':visible')){
               	$(this).next(".msg_body").hide(100);
               	$(this).removeClass("msg_head1");
				$(this).addClass("msg_head");
               }
               else
               {
					$(this).next(".msg_body").show(100);
					$(this).removeClass("msg_head");
					$(this).addClass("msg_head1");
               }                    
            });
           var i=0;
           $("p#msg_headP").each(function()
           {
           		if(i != 2)
           		{
					$(this).next(".msg_body").show(100);
					$(this).removeClass("msg_head");
					$(this).addClass("msg_head1");
           		}
           		i++;
           });
        });
        
       
       
       $(document).ready(function () {
            //hide the all of the element with class msg_body
            $(".msg_body_Tender").hide();
            //toggle the componenet with class msg_body
            $("p#msg_headP_Tender").click(function () {
               if($(this).next(".msg_body_Tender").is(':visible')){
               	$(this).next(".msg_body_Tender").hide(100);
               	$(this).removeClass("msg_head1_Tender");
				$(this).addClass("msg_head_Tender");
               }
               else
               {
					$(this).next(".msg_body_Tender").show(100);
					$(this).removeClass("msg_head_Tender");
					$(this).addClass("msg_head1_Tender");
               }                    
            });
        });

