$(document).ready(function(){
   
   $("a img").css("border","none");
    $("#faq a").click(function(){
       var p=$(this).find("p"); 
       if(p.is(":visible"))
       {
            p.hide("slide");
       }
       else
       {
            p.show("slide");
       }
    });
    $("#mainMenu a").hover(function(){
       if($(this).attr("class")!="clicked")
       {
           img=$(this).find("img");
        src=img.attr("id");
        
       
        img.attr("src","img/mainMenu/"+src+"2.png");
       }
        
        
        
        
    },
    function()
    {
        if($(this).attr("class")!="clicked")
        {
          img=$(this).find("img");
        src=img.attr("id");
        img.attr("src","img/mainMenu/"+src+".png");  
        }
         
    }
    ).click(function(){
        var src=$(".clicked").find("img").attr("id");
        $(".clicked").find("img").attr("src","img/mainMenu/"+src+".png"); 
        $(".clicked").removeClass("clicked");
        var img=$(this).find("img");
         src=img.attr("id");
        
        img.attr("src","img/mainMenu/"+src+"2.png");  
        
        
        $("#mainImage>div").hide("slide");
       
        $("."+src).show("slide");
        $(this).addClass("clicked");
    });
    $("#serviceMenu li").click(function(){
      
        id=$(this).attr("id");
        window.location.hash=id;
        showClient(id);
        
    });
     if(window.location.hash!="")
    {
       
        a=window.location.hash.substr(1);
        
        showClient(a);
    }
    else
    {
       
        id=$("#text div").first().attr("id");
        id=id.split('').reverse().join('');
        id=id.substr(4);
        id=id.split('').reverse().join('');
        if(id!="")
         showClient(id);
       
        window.location.hash="#"+id;
        
    }
    
    $(".close").hover(function(){
       
        $(this).attr("src","img/close2.png");
        },
        function(){
       
        $(this).attr("src","img/close.png");
        }
        
    ).click(function(){
        $(this).parent().parent().hide("puff",500);
       
    });
   
    
});
function slideThis(id)
{
  if($("#"+id).is(":hidden"))
  {
    $("#"+id).show('slide',500);
  }
  else
  {
    $("#"+id).hide("slide",500);
  }
    
}
function DevelopBy()
{
    
    $("#legal").before('<div id="DevBy" class="overlay box"><img class="close" src="img/close.png"><p>With the introduction of smart phones & tablet computers, more and more people look for services on-line.  As traditional advertising costs rise, more companies are seeing the benefits a professional website can bring in terms of new customers, professional image or 24/7 advertising at a realistic price.</p><p>GS Studio is proud to be able to offer a range of packages  starting with our introductory website design service from just &pound;455.</p><p>Whether you are looking for your first website or to update an existing site, we are confident our prices and level of service will not be beaten.<p>To view some of our latest clients sites please click on the links below:</p><ul><li><a href="www.social-care.org">www.social-care.org</a></li><li><a href="http://magrussiantranslations.com/">www.magrussiantranslations.com</a></li></ul><p>For more information or to arrange a free consultation please contact as <a href="mailto:gs.webstudio@gmail.com">gs.webstudio@gmail.com</a></p></div>');
    $("#DevBy").show("slide");
    $(".close").hover(function(){
       
        $(this).attr("src","img/close2.png");
        },
        function(){
       
        $(this).attr("src","img/close.png");
        }
        
    ).click(function(){
        $("#DevBy").hide("puff",500);
        $("#DevBy").remove();
       
    });
}
function showClient(id)
{
    if($("#text>div").is(":visible"))
    {
         $("#text>div").hide("slide");
    }
     
    $(".tab").attr("class","");
        $("#"+id).attr("class","tab");
        
        $("#"+id+"text").show("slide");
}
