/* ====================================================================== */
/* ==| AUTHOR  : Qasid Mukthar | ECode Lanka Software (Pvt.) Ltd.	  |== */
/* ==| PROJECT : Copro Website                                     	  |== */
/* ==| DATE    : 30 August 2006                      				  |== */
/* ====================================================================== */

/* Added by Tharindu */
/* Show hide navigation menu segments */
function showHide(showHideID)
{
    switch(showHideID)
    {
        case "voorstelling":
        default:            
            document.getElementById("voorstelling").style.display = "block";
            document.getElementById("activiteiten").style.display = "none";
            document.getElementById("search").style.display = "none";
            break;
        
        case "activiteiten":
            document.getElementById("voorstelling").style.display = "none";
            document.getElementById("activiteiten").style.display = "block";
            document.getElementById("search").style.display = "none";
            break;
        
        case "search":
            document.getElementById("voorstelling").style.display = "none";
            document.getElementById("activiteiten").style.display = "none";
            document.getElementById("search").style.display = "block";
            break;
    }
}

/* Added by Tharindu */
/* Input validation */
function validateLength(source, args)
{
    if (args.Value.length < 2)
    {
        args.IsValid = false;
    }
    else
    {
        args.IsValid = true;
    }
}

/* Added by Tharindu */
/* Read Cookie */
function getCookie()
{
    var name = 'Language';
    if (document.cookie.length > 0)
    {
        c_start = document.cookie.indexOf(name + "=");
        if (c_start != -1)
        { 
            c_start = c_start + name.length + 1;
            c_end = document.cookie.indexOf(";", c_start);
            if (c_end == -1)
            {
                c_end = document.cookie.length;
            }
            return unescape(document.cookie.substring(c_start, c_end));
        } 
    }
    return null;
}

/* Added by Tharindu */
/* Save Cookie */
function setCookie(value)
{
    var name = 'Language';
    var exdate = new Date();
    exdate.setDate(exdate.getDate() + 30*365);
    document.cookie = name + "=" + escape(value) + ";expires=" + exdate.toGMTString() + ";path=/;";
}

/* Added by Tharindu */
/* Check Cookie */
function checkCookie()
{
    language = getCookie();
    if (language != null)
    {
        return language;
    }
    else 
    {
        setCookie('-1');
        return '-1';
    }
}

/* Added by Thilina */
/* open the pop up window - Screen 3_41_3.aspx */
function OpenScreen3_41_3(idcompany)
{
   
  window.open("3_41_3.aspx?ID=" + idcompany,"text","height=200,width=250,status=no,toolbar=no,menubar=no,location=no,scrollbars=no");

}

   


function OpenPDF(fPath)
{
    document.getElementById("ContentDIV").style.display = 'none';    
    document.getElementById("pdfContainer").src = fPath;    
    document.getElementById("ContainerDIV").style.display = 'block';    
    
    return false;
}


function ClosePDF()
{

    document.getElementById("ContentDIV").style.display = 'block';    
     
    document.getElementById("ContainerDIV").style.display = 'none';    

}

/* Added by Tharindu */
/* Default Redirect */
function redirect()
{   
    switch (checkCookie())
    {        
        default:    
          window.location = "index.aspx";
          break;
        case '-1':
          window.location = "splash.html";
          break;
    }
}
