/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


function toggleBox(box){
    var exdate=new Date();
    exdate.setDate(exdate.getDate() + 10);

    if($(box + " .content").is(":visible")){
        $(box + " .heading .text").addClass("hidden");
        $(box + " .content:visible").slideUp("slow");      
        document.cookie="form_builder_"+box +"=0;expires="+exdate.toGMTString();
    }
    else{
        $(box + " .heading .text").removeClass("hidden");
        $(box + " .content:hidden").slideDown("slow");
        document.cookie="form_builder_"+box +"=1;expires="+exdate.toGMTString();
    }
}


function imposeMaxLength(Object, MaxLen){
    if(Object.value.length >= MaxLen){
        Object.value[MaxLen - 1] = '';
        Object.value = Object.value.toString().substr(0, MaxLen);
    }
}


function bannerOnclick(domain, id){
    jQuery.ajax({
        type: "POST",
        url:  domain+"banner-click-count/",
        data: "id=" + id
    });
}

