function addSubscriber() {
  
    if(!$('#popupContact').length){
        $.ajax({
          url: "templates/common/utility/mail_subscribe.html",
          cache: false,
          success: function(html){
            $("#template_contents").append(html);
          },
        async:   false 
        });
    }
    DG_initValidator ();
    if($('#popupContact').is(':hidden')){
        $('#popupContact').slideDown('slow');
    } else {
       $('#popupContact').slideUp('slow');
    }

}

function closePopupWindow(){
    $('#popupContact').slideUp('slow');  
}

function submit_subscriber(){
    var form = document.forms['addsubscriber_form'];
    if(!form.subscriber_name.value || !form.subscriber_email.value){
        return false;
    
    }else{
            return true;        
    }
}

function toggleError(form){
    if(!form.subscriber_name.value){$('#subscriber_name').css('background-image','url(graphics/projob/star_image.png)').css('background-position', 'right center').css('background-repeat', 'no-repeat');
    } else {$('#subscriber_name').css('background-image','none');}
    if(!form.subscriber_email.value){ $('#subscriber_email').css('background-image','url(graphics/projob/star_image.png)').css('background-position', 'right center').css('background-repeat', 'no-repeat');
    } else {$('#subscriber_email').css('background-image','none');}
    if(!form.subscriber_position.value){$('#subscriber_position').css('background-image','url(graphics/projob/star_image.png)').css('background-position', 'right center').css('background-repeat', 'no-repeat');
    } else {$('#subscriber_position').css('background-image','none');}
    if(!form.subscriber_organisation.value){$('#subscriber_organisation').css('background-image','url(graphics/projob/star_image.png)').css('background-position', 'right center').css('background-repeat', 'no-repeat');
    } else {$('#subscriber_organisation').css('background-image','none');}
}