function setTitle()
{
    var filename = document.location.href;
    
    if(/index.htm$/i.test(filename))
        document.title = "Ausun Scheduler - Enjoy your life and we will take care of the work for you!";
    else if(/screenshots.htm$/i.test(filename))
        document.title = "Ausun Scheduler - Screenshots";
    else if(/downloads.htm$/i.test(filename))
        document.title = "Ausun Scheduler - Downloads";
    else if(/purchase.htm$/i.test(filename))
        document.title = "Ausun Scheduler - Purchase";
    else if(/support.htm$/i.test(filename))
        document.title = "Ausun Scheduler - Support";
    else if(/faq.htm$/i.test(filename))
        document.title = "Ausun Scheduler - FAQ";
    else if(/contacts.htm$/i.test(filename))
        document.title = "Ausun Scheduler - Contacts";
    else
        document.title = "Ausun Scheduler - Enjoy your life and we will take care of the work for you!";

    var element = document.getElementById("nojavasupport");
    if(element)
        element.style.display = "none";

    /*try
    {        
        window.document.body.style.overflowY = "scroll";
    }catch(e) {}*/
}

function writeForePart()
{
    /*var Browser_Agent=navigator.userAgent; 
    document.write(Browser_Agent); 
    if(Browser_Agent.indexOf("MSIE")!=-1)
    {//ÅÐ¶Ïä¯ÀÀÆ÷ÊÇ·ñÎªie 
        var a=navigator.browserLanguage; 
        alert("Your system language code is: \n"+navigator.systemLanguage);
    } 
    else
    {//firefox opera safari 
        var b=navigator.language; 
        alert("Your system language code is: \n"+navigator.language);
    }*/ 
    
    var text = '\
    <table id="maintable" align="center" cellspacing="0" cellpadding="0"><tr><td>   \
        <div id="header" align="center">    \
            <div class="titletext" id="logo">   \
                <div id="logotext" class="logotext">    \
                    Ausunsoft</div> \
            </div>  \
            <div id="pagetitle">    \
                <div id="title" class="titletext" align="right">    \
                    Our efforts, your convenience</div> \
            </div>  \
        </div>  \
        <div id="content" align="center">   \
            <div id="leftpane"> \
                <div id="menu"> \
                    <div style="float: right; margin: 0; padding: 0; width: 189px; height: 8px;"><img width="189px" height="8px" src="images/mnu_topshadow.gif" alt="mnutopshadow" /></div>  \
                    <div id="home" class="linksmenu" align="left">    \
                        <a href="/index.htm">Home</a>    \
                    </div>  \
                    <div id="index" class="linksmenu" align="left">    \
                        <a href="index.htm">Scheduler</a>    \
                    </div>  \
                    <div id="screenshots" class="linksmenu" align="left">    \
                        <a href="screenshots.htm">Screenshots</a>    \
                    </div>  \
                    <div id="downloads" class="linksmenu" align="left">    \
                        <a href="downloads.htm">Downloads</a>    \
                    </div>  \
                    <div id="purchase" class="linksmenu" align="left">    \
                        <a href="purchase.htm">Purchase</a>    \
                    </div>  \
                    <div id="support" class="linksmenu" align="left">    \
                        <a href="support.htm">Support</a>    \
                    </div>  \
                    <div id="contacts" class="linksmenu" align="left">    \
                        <a href="contacts.htm">Contact Us</a>    \
                    </div>  \
                    <div style="float: right; margin: 0; padding: 0; width: 189px; height: 8px;"><img width="189px" height="8px" src="images/mnu_bottomshadow.gif" alt="mnubottomshadow" /></div>  \
                </div>  \
                <div id="leftinfo" align=center>    \
                    <div class="bodytext" style="text-align: left; margin-top: 0px; width: 170px;">    \
                        <strong>Quick links:</strong><br /> \
                        <div class="quicklink" style="line-height: 1.5em; text-align: left; margin-top: 5px;"> \
                            &nbsp;&nbsp;&nbsp;&nbsp;<a href="Downloads/AusunScheduler.zip">Download and try it</a><br />   \
                            &nbsp;&nbsp;&nbsp;&nbsp;<a href="faq.htm">FAQ</a><br />  \
                            &nbsp;&nbsp;&nbsp;&nbsp;<a href="mailto:schedulersupport@ausunsoft.com">Send an email to us</a><br />   \
                        </div>  \
                    </div>  \
                    <div class="bodytext" style="line-height: 1.5em; text-align: left; margin-top: 30px; padding-top: 10px; width: 170px; border-top: dotted 1px #AAAAAA;">  \
                        <strong>News: </strong><br />   \
                        <div class="smalltext" style="line-height: 1.5em; text-align: left">    \
                            &nbsp;&nbsp;&nbsp;&nbsp;Oct 27, 2009. Version 1.8 released.<br />   \
                            &nbsp;&nbsp;&nbsp;&nbsp;Jul 27, 2009. Version 1.5 released.<br />   \
                            &nbsp;&nbsp;&nbsp;&nbsp;Jul 13, 2009. Version 1.3 released.<br />   \
                            &nbsp;&nbsp;&nbsp;&nbsp;Mar 23, 2009. Version 1.0 released.<br />   \
                        </div>  \
                    </div>  \
                    <div id="translate" class="quicklink">  \
                        <form action="http://translate.google.com/translate" method="get" name="translate_form"><input value="en" name="sl" type="hidden"><script language="javascript">document.write(\'<INPUT TYPE="hidden" NAME="u" VALUE="\'+window.location.href+\'">\');</script><select style="font-size: 12px; width: 160px;" name="hl"><option value="sq">Albanian</option><option value="ar">Arabic</option><option value="bg">Bulgarian</option><option value="ca">Catalan</option><option value="zh-CN">Chinese (Simplified)</option><option value="zh-TW">Chinese (Traditional)</option><option value="hr">Croatian</option><option value="cs">Czech</option><option value="da">Danish</option><option value="nl">Dutch</option><option value="et">Estonian</option><option value="tl">Filipino</option><option value="fi">Finnish</option><option value="fr">French</option><option value="gl">Galician</option><option value="de">German</option><option value="el">Greek</option><option value="iw">Hebrew</option><option value="hi">Hindi</option><option value="hu">Hungarian</option><option value="id">Indonesian</option><option value="it">Italian</option><option value="ja">Japanese</option><option value="ko">Korean</option><option value="lv">Latvian</option><option value="lt">Lithuanian</option><option value="mt">Maltese</option><option value="no">Norwegian</option><option value="fa">Persian ALPHA</option><option value="pl">Polish</option><option value="pt">Portuguese</option><option value="ro">Romanian</option><option value="ru">Russian</option><option value="sr">Serbian</option><option value="sk">Slovak</option><option value="sl">Slovenian</option><option selected="selected" value="es">Spanish</option><option value="sv">Swedish</option><option value="th">Thai</option><option value="tr">Turkish</option><option value="uk">Ukrainian</option><option value="vi">Vietnamese</option></select></form> \
                        <a href="#" onclick="javascript: document.translate_form.submit();">Translate</a>&nbsp;<span style="font-size: 10px; color: #999999;"> by Google</span>    \
                    </div>  \
                </div>  \
            </div>  \
    '    
    document.write(text);
    
    /* set active menu */
    /*var wordArray = document.location.href.split("/");
    var filename = wordArray[wordArray.length - 1];*/
    var filename = document.location.href;
    var id = "index";
    
    if(/index.htm$/i.test(filename))
        id = "index";
    else if(/screenshots.htm$/i.test(filename))
        id = "screenshots";
    else if(/downloads.htm$/i.test(filename))
        id = "downloads";
    else if(/purchase.htm$/i.test(filename))
        id = "purchase";
    else if(/support.htm$/i.test(filename))
        id = "support";
    else if(/faq.htm$/i.test(filename))
        id = "support";
    else if(/contacts.htm$/i.test(filename))
        id = "contacts";
    
    var element = document.getElementById(id);
    if(element)
        element.className = "linksmenuactive";
}

function writeRearPart()
{
    var text = '\
            <div id="footer" class="smallgraytext" align="center">  \
                <a href="/index.htm">Home</a> | <a href="index.htm">Scheduler</a> | <a href="screenshots.htm">Screenshots</a> | <a href="downloads.htm">    \
                    Downloads</a> | <a href="purchase.htm">Purchase</a> | <a href="support.htm">Support</a> | <a href="contacts.htm">Contact Us</a><br /> \
                Copyright &copy; 2009 Ausunsoft. All Rights Reserved.<br /> \
            </div>  \
        </div>  \
        <img style="visibility:hidden" height="1" src="/cgi-sys/Count.cgi?df=CounterFile.dat|display=Counter|ft=1|md=6|frgb=100;139;216|dd=E">  \
    </td></tr></table>  \
    <script type="text/javascript"> \
        var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); \
        document.write(unescape("%3Cscript src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E"));  \
    </script>   \
    <script type="text/javascript"> \
        try {   \
            var pageTracker = _gat._getTracker("UA-9764322-1"); \
            pageTracker._trackPageview();   \
        } catch(err) {} \
    </script>    \
    '    
    /* set counter file */
    /*var wordArray = document.location.href.split("/");
    var filename = wordArray[wordArray.length - 1];*/
    var filename = document.location.href;
    var id = "home";
    
    if(/index.htm$/i.test(filename))
        id = "home";
    else if(/screenshots.htm$/i.test(filename))
        id = "screenshots";
    else if(/downloads.htm$/i.test(filename))
        id = "downloads";
    else if(/purchase.htm$/i.test(filename))
        id = "purchase";
    else if(/support.htm$/i.test(filename))
        id = "support";
    else if(/faq.htm$/i.test(filename))
        id = "faq";
    else if(/contacts.htm$/i.test(filename))
        id = "contacts";
    text = text.replace("CounterFile", id);
    
    document.write(text);
}

function bookmark_us(url, title){
    if (window.sidebar) // firefox
        window.sidebar.addPanel(title, url, "");
    else if(window.opera && window.print) // opera
    {
        var elem = document.createElement('a');
        elem.setAttribute('href',url);
        elem.setAttribute('title',title);
        elem.setAttribute('rel','sidebar');
        elem.click();
    } 
    else if(document.all)// ie
        window.external.AddFavorite(url, title);
}
