function closeTabs(){
    var chosenTab ='noTab'
    jQuery("#tabbedArea").hide()
    jQuery(".tabcontent").hide()
    jQuery(".chosenTabFirst , .chosenTabSecond , .chosenTabThird  , .chosenTabFourth").each(function(i){
        if (jQuery(this).is(".chosenTabFirst"))
        {
            chosenTab='chosenTabFirst';jQuery(this).attr('class','tabl')
            }
        else if(jQuery(this).is(".chosenTabSecond"))
        {
            chosenTab='chosenTabSecond';jQuery(this).attr('class','tabm')
            }
        else  if(jQuery(this).is(".chosenTabThird"))
        {
            chosenTab='chosenTabThird';jQuery(this).attr('class','tabr')
            }
        else
        {
            chosenTab='chosenTabFourth';jQuery(this).attr('class','tabsend')
            }
    })
    return chosenTab;
}
function showTab(element,tab){
    var elementClass = jQuery(element).attr('class')
    var selectedTab=closeTabs()
    if (elementClass!=selectedTab){
        jQuery('#'+tab).show()
        jQuery("#tabbedArea").show()
        return true;
    }
    else{return false}
}