﻿var homeAlert={
    elAlert:null,
    elAlertText:null,
    elAlertTitle:null,
    elAlertBody:null,
    elMore:null,
    elClose:null,
    
    htmlMore:"",
    htmlClose:null,
    
    
    msgAlert:null,
    msgAlertTitle:null,
    
    msgAlertSliced:"",
    msgAlertExpanded:"",
    htmlAlertTitle:"",
    msgAlertTooltip:""
};

homeAlert.init=function(){
    if(typeof(this.msgAlertTitle)!="string"||this.msgAlertTitle=="") return;
    //try{
        this.elAlert=document.getElementById("home-alert");
        this.elAlertText=document.getElementById("home-alert-text");
        this.elAlertTitle=document.getElementById("home-alert-title");
        this.elAlertBody=document.getElementById("home-alert-body");
        this.elMore=document.getElementById("home-alert-more");
        this.htmlMore=this.elMore.innerHTML;
        this.elClose=document.getElementById("home-alert-close");
        this.htmlClose=this.elClose.innerHTML;
        
        //this.msgAlertSliced=this.msgAlert.slice(0,40)+this.htmlMore;
        
        this.htmlAlertTitle=this.msgAlert!=""?this.msgAlertTitle+this.htmlMore:this.msgAlertTitle;
        this.elAlertTitle.innerHTML=this.htmlAlertTitle;
        
        this.msgAlertBody=this.msgAlert+this.htmlClose;
        this.elAlertBody.innerHTML=this.msgAlertBody;
        
        this.elAlert.title=this.msgAlertTitle+"\n"+this.msgAlert;
        
        
        
        this.elAlert.style.display="block";
    //}catch(e){}
}

homeAlert.expand=function(){
    this.elAlert.className="home-alert-expand";
    //this.elAlertTitle.innerHTML=this.htmlAlertTitle;
    //this.elAlert.title="";
    
    //this.elAlert.style.overflow="visible";
    //this.elAlertBody.style.display="block";
    //var elAlertHeight;
    /*try{
        elAlertHeight=document.defaultView.getComputedStyle(this.elAlertText, null).getPropertyValue("height");
        //this.elAlertText.style.height=parseInt(elAlertHeight)-27+"px";
        //this.elAlertTitle.style.height=parseInt(elAlertHeight)-27+"px";
    }catch(e){}*/
}
homeAlert.close=function(){
    this.elAlert.className="";
    //this.alertTextDiv.innerHTML=homeAlertText.slice(0,40)+this.moreHtml;
    //this.elAlertTitle.innerHTML=this.htmlAlertTitle;
    //this.elAlert.title=this.msgAlertTitle+"\n"+this.msgAlertSliced;
    
    //this.elAlert.style.overflow="hidden";
} 


