var ChatClass, ChatVersion , ChatSrv;
ChatSrv='injaz4host.chat-host.com';
if(typeof ChatType == 'undefined' || ChatType != 2){
    if(typeof doClientVersion == 'undefined')
        ChatVersion = '';
    else
        ChatVersion = doClientVersion;
    ChatType = 'Client';
    ChatClass = 'com.spilka.client.ClientApplet';
} else {
    if(typeof doMasterVersion == 'undefined')
        ChatVersion = '';
    else
        ChatVersion = doMasterVersion;
    ChatType = 'ChatMaster';
    ChatClass = 'com.spilka.client.MasterApplet';
}

    document.write('<APPLET NAME="Chat" CODEBASE="http://' + ChatSrv + '/Spilka/Classes/" CODE="' + ChatClass + '" ');
    document.write('HEIGHT="' + ChatHeight + '" WIDTH="' + ChatWidth + '" ALIGN="MIDDLE" ');
    document.write('ARCHIVE="' + ChatType + '.jar" MAYSCRIPT>');
    document.write('<PARAM NAME="cabbase" value="' + ChatType + '.cab" />');
    if(typeof ChatSiteID != 'undefined')
        document.write('<PARAM NAME="SiteID" VALUE="' + ChatSiteID + '" />');
 if(typeof ports != 'undefined')
        document.write('<PARAM NAME="ports" VALUE="' + ports + '" />');
    document.write('<PARAM NAME="background" VALUE="' + ChatBackground + '" />');
    document.write('<PARAM NAME="textcolor" VALUE="' + ChatTextColor + '" />');
    if(typeof ChatLanguage != 'undefined' && document.all)
        document.write('<PARAM NAME="language" VALUE="' + ChatLanguage + '.lang" />');
    else
        document.write('<PARAM NAME="language" VALUE="english.lang" />');
document.write('<PARAM NAME="ports" VALUE="7395" />');
    if(typeof ChatMenuLinks != 'undefined'){
        var ChatLinkID = 1;
        for(ChatLink in ChatMenuLinks){
            document.write('<PARAM NAME="MenuItem' + ChatLinkID + '" VALUE="' + ChatLink + '" />');
            document.write('<PARAM NAME="MenuLocation' + ChatLinkID + '" VALUE="'+ ChatMenuLinks[ChatLink] +'" />');
            ChatLinkID++;
        }
    }

    if(typeof ChatExtra != 'undefined'){
        for(ChatParam in ChatExtra){
            document.write('<PARAM NAME="' + ChatParam + '" VALUE="' + ChatExtra[ChatParam] + '" />');
        }
    }
    document.write('DigiChat requires a Java Compatible web browser to run.');
    document.write('</APPLET>');

