var loc="website";
var lastChange=" 2.09.2010";

function isInFrame()
{
    if(top==self)
    {
        var url=new String(self.location);

        //window.location= "index.html?page=" + url.substring(url.search(loc)+loc.length+1,url.length);

        window.location= "index.html?page=" + url.substring(url.lastIndexOf("/")+1,url.length);
    }
}

function isInFrame(base, relativePath)
{
    if(top==self)
    {
        var url=new String(self.location);
        
        //window.location= "index.html?page=" + url.substring(url.search(loc)+loc.length+1,url.length);

        if(relativePath==undefined)
            window.location= "index.html?page=" + url.substring(url.lastIndexOf("/")+1,url.length);
        else
            window.location= base + "index.html?page=" + url.substring(url.lastIndexOf("/")+1,url.length) + "&&relativePath=" + relativePath;
    }
}

function getUrlParameter( name )
{
    name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
    var regexS = "[\\?&]"+name+"=([^&#]*)";
    var regex = new RegExp( regexS );
    var results = regex.exec( window.location.href );
    
    if( results == null )
        return "";
    else
        return results[1];
}

function initContentFrame()
{
    var site=getUrlParameter("page");
    var relativePath=getUrlParameter("relativePath");
    
    if(site!="")
    {
    if(relativePath==undefined)
        contentFrame.location.href=site;
    else
        contentFrame.location.href=relativePath+site;
    }
}

function DecodeMail(mail,text)
 {
    mail=mail.replace(/C/g,"1");
    mail=mail.replace(/D/g,"7");
    mail=mail.replace(/A/g,"2");
    mail=mail.replace(/B/g,"9");
    mail=mail.replace(/E/g,"5");
    mail=mail.replace(/F/g,",");

    var mailArray=mail.split(",");
    mail=new String();
    
    for(var i=0;i<mailArray.length;i++)
    {
        mail =mail + String.fromCharCode(mailArray[i]);
    }
    window.location.href="mailto:" + mail;
    //document.write("<a href=\"mailto:" + mail + "\">" + text + "</a>");
 }
     
 function EncodeMail()
 {
    var mail=new String(document.getElementById("address").value);
    var mailcode=new Array();
    for(var i=0;i<mail.length;i++)
    {
        mailcode[i]= mail.charCodeAt(i);
    }
    
    mail=mailcode.join("F");
    
    mail=mail.replace(/1/g,"C");
    mail=mail.replace(/7/g,"D");
    mail=mail.replace(/2/g,"A");
    mail=mail.replace(/9/g,"B");
    mail=mail.replace(/5/g,"E");
        
    document.getElementById("code").value=mail;
 }
 
 function LastChange()
 {
    document.write(lastChange);
 }