var update_timer;

function update(message, perm) { 
    clearTimeout(update_timer);
    $('#alert_message').html(message);  
    if ( $("#alert").css("display") != "block" ){
        $("#alert").show("blind").animate({opacity: 1.0}, 2500);
    }
    if (!perm){ update_timer = setTimeout(hideUpdate, 2500); }
}

function hideUpdate(){
    $("#alert").animate({opacity: 0}, 2000).hide("blind");
}

var ajaxformoptions = { 
    dataType:        'json', 
    success:  showResponse
}; 


function makeLinksWork(){


  $('a[rel*=help]').facebox({
        loadingImage : '/images/loading.gif',
        closeImage   : '/images/closelabel.gif'
    }); 

var options = { 
    dataType:        'json', 
    success:  showResponse
}; 


  //$('.ajaxform').removeAttr("action");
  $('.ajaxform').ajaxForm(options); 
  
}

function view(type) {
    if (type < 10){
        reloadtab(type);
        $('#tabs').tabs('select', '#sect_' + tablist[type]);
    } else {
        $('#tabs').tabs('select', '#sect_' + type);
    }
}



function showResponse(responseText, statusText)  { 
    //if (debugging) {  Dumper.alert( this); }
    var myresponse = eval(responseText);
    //getAssignment();
    manage_domain(current_domain);
    update( myresponse.message); 
} 

function track(tag){
    var path = location.pathname;
    if (path == "/") { path = "/index.html"; }
    pageTracker._trackPageview(path + "/" + tag);
}

function help(type, domain){

        track("help/"+type);

    switch(type){
        case "private":
            $.facebox('<h2>Domain Privacy:</h2><p>By default, when you register a domain name your name, postal address, and email address is placed in a public WHOIS database. This information may be browsed by anyone, at any time, and has been used by marketing companies to send unsolicited advertisements. By enabling this option, Lycos (or a partner) will list itself as the owner of your domain name and act as a proxy for legitimate domain-related communication.<br/>($9.95/yr)</p>'); break;
        case "premium":
            $.facebox('<h2>Premium Domains:</h2><p>A premium domain is a domain being sold by a third party.</p>'); break;
        case "faqwhat":
            $.facebox('<h2><a class="faq" name="what">Q</a>: What is a domain name?</h2><p>A domain name, also known as a Web address, is a name used to identify and locate your Web site. By registering your own domain, you have the opportunity to pick a short, easy to remember address that matches your site. And because each domain name is unique, you can keep your domain name no matter what service you use for hosting your site.</p>'); break;
        case "faqwhy":
            $.facebox('<h2><a class="faq" name="why">Q</a>:Why should I register a domain name? </h2><p>Registering a domain name gives you the opportunity to choose a short, easy to remember Web address that matches your website. And because the address is not tied to a particular ISP or website hosting service, your URL will always stay the same.</p>'); break;
        case "faqnowebsite":
            $.facebox('<h2><a class="faq" name="nowebsite">Q</a>: Can I register a domain name if I don\'t have website?</h2><p>Yes! Domain Parking reserves your domain name for a future website. If someone tries to access your domain, a "coming soon" page will be displayed. This is the default setting for newly registered domains. You can leave your domain parked for as long as you like. Once you do have a website, it\'s easy to make the switch.</p>'); break;
        case "faqconnectdomain":
            $.facebox('<h2><a class="faq" name="connectdomain">Q</a>: How do I connect my domain name to a website?</h2><p>Simply choose the Domain Forwarding option after you register your domain name.By doing so, your domain traffic will be automatically forwarded to any website address you designate.If you also enable Domain Masking, your domain name will appear in the browser\'s location/address bar instead of the destination site address.</p>'); break;
        case "faqwaiting":
            $.facebox('<h2><a class="faq" name="waiting">Q</a>: How long before my newly-registered domain name is accessible on the Internet? </h2><p>Domain names may take up to 72 hours before they are acccessible. This waiting period is standard fornew domain registration.</p>'); break;
        case "faqemailincluded":
            $.facebox('<h2><a class="faq" name="emailincluded">Q</a>: Is an e-mail account included with my domain name?</h2><p>Yes, Lycos Domains supports both POP and IMAP e-mail. You can configure up to 3 e-mail boxes.Lycos Domains also supports up to 3 e-mail forwards, in case you already have e-mail addresses you would like to have your mail forwarded to. (For example, if your domain is mydomain.com, all e-mail ending in @mydomain.com can be forwarded to an e-mail address that you\'re currently using.)</p>'); break;
        case "faqreceiveemail":
            $.facebox('<h2><a class="faq" name="receiveemail">Q</a>: How can I receive e-mail at my domain?</h2><p>If you already have an e-mail address, E-Mail Forwarding is the answer. Just tell us what address you want your domain e-mail to go to, and we\'ll take care of the rest. For example, if your domain name is mydomain.com, all e-mail ending in @mydomain.com can be automatically forwarded to any e-mail address you designate.<br/><br/>If you do not have an e-mail address, or you wish to set up additional addresses, you can configure up to 3 POP or IMAP e-mail inboxes to hold your incoming mail. With IMAP e-mail inboxes, you can download your mail to any computer using an e-mail client such as Outlook Express, Eudora Light, Netscape Messenger and others, and your mail is stored on the server. With a POP inbox, your e-mail is downloaded from the server to your local computer. (POP is better if you will only access your e-mail from one location.) You can also use our *new* Webmail tool to send and receive your e-mail from any computer with internet access.</p>'); break;
        case "faqhost":
            $.facebox('<h2><a class="faq" name="host">Q</a>: Where can I build and host my website?</h2><p>You\'re in luck. Lycos offers the Web\'s best site building and hosting services.<a target="_blank" href="http://angelfire.lycos.com/doc/subscriptions/">Angelfire</a> makes building fun by adding extraslike movies, music, and more. <a target="_blank" href="http://www.tripod.lycos.com/host/index.html">Tripod</a> wins awards with its builder-friendly tips and tools. We recommend that you check out both sites!</p>'); break;
        case "faqrules":
            $.facebox('<h2><a class="faq" name="rules">Q</a>: Are there any rules for choosing a domain name?</h2><p>Yes, there are a few guidelines to keep in mind:<br/>– Use only letters, numbers, or a hyphen ("-")<br/>– Do not begin or end the name with a hyphen<br/>– Domain names ending in .com, .net, .org. and .info must have less then 63 characters*, not including the 3 or 4-letter extension.<br/>– Domain name cannot have spaces.</p><p>* Most browsers support .com, .net. and .org domain names exceeding 26 characters. However, certain web browsers, email programs and other Internet related applications may not support domain names over 26 characters.</p>'); break;
        case "faqreserve":
            $.facebox('<h2><a class="faq" name="reserve">Q</a>: Can I reserve a .org or .net domain name?</h2><p>Yes, you\'re free to use any of the extensions offered by Lycos Domains. Restricted extensions such as .gov and .edu are not available.  </p>'); break;

        case "hosting":
            $.facebox('<a href="http://www.tripod.lycos.com/compare/index.tmpl" target="_blank"><img src="/images/tripod_ad.png"></a>'); break;

        case "pricing":
            $.facebox('<h1>Domain Price</h1><p>$12.95 - one year - standard price!</p><p>$24.95 - two years - 4% discount!</p><p>$35.95 - three years - 8% discount!</p><br/><h1>Domain Privacy Price</h1><p>$9.95 - one year</p><p>$19.10 - two years</p><p>$27.50 - three years</p>'); break;
        case "newsite":
          $.facebox('<div style="text-align:center;"><img src="/images/logo.png"/></div><p>Here at Lycos Domains we are working hard to bring you a new, easy to use domains managment system!</p><p>Please check back frequently as we hope to be offering new exciting features soon.</p>Recent features added:<ul><li>new shopping cart</li><li>domain privacy</li><li>premium domains</li></ul>'); break;

        case "account_contact":
            $.facebox('<h2>Administrative Contact:</h2><p>This information can be edited at any time. Changes will affect your WHOIS record. These changes will not alter your LYCOS membership information.</p>'); break;

        case "feedback":
            $.facebox('<iframe src="https://spreadsheets.google.com/embeddedform?key=tb-wII1AlY3QI_1ULK39rqw" width="620" height="906" frameborder="0" marginheight="0" marginwidth="0">Loading...</iframe>'); break;
        case "pop":
            $.facebox('<h2>Create POP/IMAP E-mail Account</h2><p>Enter the e-mail address and password of your choice for your POP/IMAP e-mail account. For example, you could direct mail to a friend or family member associated with your domain (bob@mysite.com), or a specific function associated with your domain (info@mysite.com). You can use one password for all of your POP/IMAP e-mail accounts or choose a unique password for each account.</p><p><b>Please Note:</b> If you\'ve created an additional (more than 1) POP/IMAP e-mail account it may be a few hours before your changes take effect.</p>'); break;
        case "forwards":
            $.facebox('<h2>E-mail Forwarding</h2><p>Directs all e-mail sent to a domain e-mail address to another e-mail address. For example, if your domain name is mydomain.com, you could set up sally@mydomain.com and have that e-mail forward to sally123@lycosmail.com, or wherever you have e-mail service.</p><p>If you want a catchall e-mail address for your domain, enter a * or default in the e-mail address field. By doing so, all incoming e-mail that does not match the addresses you\'ve established for your domain will be accessible from your catchall account.</p><p><b>Please Note:</b>     If you add E-Mail forwards to a domain which already has one or more POP/IMAP e-Mail accounts, this change can take up to a few hours to take effect. </p>'); break;
        case "alias":
            $.facebox('<h2>E-mail Alias</h2><p>It\'s an alias to one of your existing POP/IMAP accounts. Your POP/IMAP account will have special folder with this alias name. Any mails received to this alias address, will be kept into alias folder.</p><p><b>Please Note:</b>If you add alias to a domain which already has one or more POP/IMAP e-Mail accounts, this change can take up to a few hours to take effect. </p>'); break;
        case "popsettings":
            $.facebox('<h1>Email Settings</h1>\
<p>POP SERVER INFORMATION<br/>\
Server: pop.domains.lycos.com<br/>\
Port: 110/995<br/>\
Protocol: POP3/POP3 (SSL)<br/></p>\
<p>IMAP SERVER INFORMATION<br/>\
Server: imap.domains.lycos.com<br/>\
Port: 143/993<br/>\
Protocol: IMAP/IMAP (SSL)</p>\
<p>SMTP (SUBMIT/OFMIP) SERVER INFORMATION<br/>\
Server: smtp.domains.lycos.com<br/>\
Port: 587/465<br/>\
Protocol: SMTP-AUTH/SMTP-AUTH (SSL)</p>'); break;
        case "lockstatus":
            $.facebox('<h2>Lock Status:</h2><p>Due to recent abuse of the domain transfer system, you must contact customer service to get your authorization code to transfer your domain. Please contact Lycos Customer Service at support@support.lycos.com with the Subject: EPP Authorization Code Request</p>'); break;
        case "catchall":
            $.facebox('<h2>Catch-all Email Address:</h2><p>If you want a default address for your domain, enter a * or default in the e-mail address field. By doing so, all incoming mail that does not match the addresses you\'ve established for your domain will be accessible from your default account.</p>'); break;
    }
}






