/* -------------------------------------------------------------------------------------------------
      JavaScript Functions
      www.weinart.at
                                                                                                    */

function flipField(field, div_id)
{
    if(field.value=='new' && document.getElementById( div_id ).style.display=='none')
        Effect.BlindDown(div_id, { duration:0.4 } );

    else if(field.value!='new' && document.getElementById( div_id ).style.display!='none')
        Effect.BlindUp(div_id, { duration:0.4 } );

    return false;
}


function setField(field,text,newclass)
{
    if(field.value=="")
    {
        field.value = text;
        if(newclass!=undefined)
        {
            field.className = newclass;
        }
    }
}


function unsetField(field,text,newclass)
{
    if(field.value==text)
    {
        field.value = "";
        if(newclass!=undefined)
        {
            field.className = newclass;
        }
    }
}


function switchCSS(fileName, printDialog)
{
    document.getElementById('stylesheetScreen').href = fileName;
    //if(printDialog==true) { self.print(); }
    return false;
}


function getMail(name,domain,country,text)
{
    if(text=='' || text==undefined) { var text = name+'&#x40;'+domain+'&#x2e;'+country; }
    document.write('<a class="mail" href="mailto:'+name+'&#x40;'+domain+'&#x2e;'+country+'">'+text+'</a>');
}
