/*

This is all the JS associated with the Order Flow prettyness/UI/navigation.

*/

// These functions control if a timer is running or not

outstandingtimer = true;

function ResetTimer()
{
	outstandingtimer = false;
}

function SetTimer()
{
	outstandingtimer = true;
}

function SetHelpText(text,uselang,timer)
{
	if (uselang == undefined)
	{
		uselabel = '1';
	}
	if (timer == undefined)
	{
		timer = 0;
	}
	
	box = getElemById('help');
	
	if (uselang == '1')
	{
		text = (langfile[text] == undefined) ? '' : langfile[text];
	}

	if (timer > 0)
	{
		SetTimer();
		window.setTimeout("if (outstandingtimer == true) { box.innerHTML = \"" + text + "\"; ResetTimer(); }",timer*1000);
	}
	else
	{
		box.innerHTML = text;
	}
	
	return true;	
	
}


/* This is our 'lang file' - easier to manage it in one place */
langfile = new Array();

// Mouseover: logo, for some info on TPP
langfile["generaltpp"] = "You are on your way to registering a domain with TPP Internet, one of the largest domain registrars in Australia. We also provide email & web hosting services, giving you everything you need to get yourself online.";

// Default text for first page of Orderflow
langfile["welcome"] = "Welcome to the TPP Internet search page. Type in a word you wish to search for in the search box, select a few endings (e.g. <em>com.au</em>, <em>com</em>), and then press 'Search'.";
langfile["checkavailability"] = langfile["welcome"];
langfile["domainregistrations"] = langfile["welcome"];

// Default text for Search Results page of Orderflow
langfile["searchresults"] = "The search results page should tell you if any domains you searched for are available. If you aren't successful, you can always click the 'Search Again' button to try again!";
langfile["confirmdomain"] = langfile["searchresults"];
langfile["helponregotherdomains"] = "Registering more than one domain name has a number of advantages. You can protect your branding online, ensure your competitors don't cash in your marketing, and many other reasons.";

// Default text for entering contact details
langfile["contactdetails"] = "Use this form to fill in your contact details as the registrant. Filling in an Organisation Type and ABN/ACN is only required for .com.au and .net.au and optional for .org.au and .asn.au.";

// Default text for Policy Entering screen
langfile["helponpolicy"] = "Some countries have specific requirements that must be met in order to register domain names with their suffix. This screen will allow you to confirm your acknowledgment of your responsibilities as a registrant to these requirements.";

// Default text for nameservers screen
langfile['nameservers'] = "Nameservers are usually given to you by your hosting company, and determine what to do when people visit your domain name, or send email to it. It's not neccessary to fill this in if you don't know what these are.";

// Default text for hosting
langfile["selecthosting"] = "We offer hosting products to suit any needs -- just take a look at the features of each to work out what is best for you.";
langfile["helponproducts35"] =  "Host your DNS on our Name Servers, then manage various records via our easy to use and powerful DNS Interface. This service also allows you to enable <em>URL forwarding</em> and easily point this domain name to another web page.";

// Default text for shopping cart
langfile["shoppingcart"] = "From the shopping cart, you can review everything you've ordered so far, and ensure it is exactly what you're looking for.";

// Default text for payment screen
langfile["payment"] = "Use this Payment form to pay for your order. TPP Internet support Visa, Mastercard, Bankcard and American Express.";

// FINISHED order!
langfile["createorder"] = "Congratulations on placing your order!";

// Mouseover: main menu in Order Flow
langfile["helpmenudomainregistrations"] = "Use the <u>Domains</u> menu to search for domains, fill in your contact details, and delegate your domains to any name servers.";
langfile["helpmenuhosting"] = "The <u>Hosting</u> menu allows you to order individual hosting products for any domains you are currently registering.";
langfile["helpmenushoppingcart"] = "The Shopping Cart displays a list of each domain and hosting product you are currently ordering.";
langfile["helpmenupayment"] = "Use the Payment form to pay for your order.";

// Mouseover: submenu in Order Flow
langfile["helpsubmenuavailability"] = "This form will allow you to search for available domain names. Type in a word you wish to search for in the search box, select a few endings (e.g. <em>com.au</em>, <em>com</em>), and then press 'Search'.! ";
langfile["helpsubmenucontactdetails"] = "Once you've selected the domains you wish to register, use this form to fill out your contact details for all of them.";
langfile["helpsubmenunameservers"] = "Use this form to delegate your domain names onto specific name servers. You don't have to do this yet if you don't know what name servers to use, or even what name servers are!";

// Mouseover: submenu in Order Flow : hosting
langfile["helpsubmenuselecthosting"] = "This page will list all the products and allow you to compare the features of each of our Hosting products.";
langfile["helpsubmenuurlforwarding/dnshosting"] = langfile["helponproducts35"];

// Mouseover: help on choosing right domain names
langfile["helpondomains"] = "Choosing the right domain name can be tough at times -- that's why we've put together a guide of helpful tips in selecting the right domain name for you!";

// Mouseover: logging in
langfile["helponlogin"] = "Why login? Logging in allows you to manage all your domains from a single client account and fills in a lot of your usual details. Less names and passwords to remember,  - meaning less hassle for everyone!";

// Mouseover: buddy code
langfile["helponbuddycode"] = "What is a Buddy Code? A <strong>10% discount</strong>, that's what! It's TPP Internet's way of saying thanks! If you've registered / transferred with us before, you already have one too! Just login to retrieve it if you don't have it handy.";

// Mouseover: link to eligibility checking
langfile["helponeligibility"] = "Clicking on a suffix will provide more information on any <em>eligibility requirements</em> to purchase it. Some international suffixes for example, require you to have a local contact in the country.";

// Mouseover: links to international/local domains
langfile["helponcctld0"] = "Use this link to do a search on international domains. This way, if you do business in other countries, you can protect your branding as much as possible.";
langfile["helponcctld1"] = "Many businesses register domains in a few popular namespaces together: .au, .nz, .uk and the gTLDS (com, net, org, biz, info). Click to do a search upon them.";

// Mouseover: policy data
langfile["helponauda"] = "What is auDA? auDA stands for <em>.au Domain Administration</em>. It is the policy authority and industry self-regulatory body for the .au domain space.";
langfile["helponcctldpolicies"] = "One/more of the country code domains (<em>ccTLD</em>s) you have chosen to register has requirements that you must meet as the registrant. Please acknowledge that you understand these requirements.";

// Mouseover: once they've filled in their registrant data
langfile["wheretonext"] = "So what now? If you don't have hosting set up, you can order hosting with us. If you do, then you can delegate your domains now too. If none of these options mean anything, just go straight to the payment screen!";

// Mouseover: selecting a hosting product
langfile["helponproducts"] = "We offer hosting products to suit any needs -- just take a look at the features of each to work out what is best for you.";
langfile["helponhosting"] = langfile["helponproducts"];
langfile["helponorderinghosting"]  = langfile["helponproducts"];

/**
 * DomainShop langfile 
 */

// Default load
langfile["welcometods"] = "Type in a word you wish to search for in the <a href='javascript:searchbox.focus();'>search box</a>, select a few endings (e.g. <em>com.au</em>, <em>com</em>), and then press 'Search'. ";
langfile["dsconfirmdomain"] = langfile["searchresults"];
langfile["dscontactdetails"] = langfile["contactdetails"];
langfile["dsnameservers"] = langfile["nameservers"];
langfile["dshosting"] = langfile["hosting"];
langfile["dspayment"] = "Use this Payment form to pay for your order. We support Visa, Mastercard, Bankcard and American Express.";
langfile["dsshoppingcart"] = langfile["shoppingcart"];
langfile["dsaddservices"] = "The Add Services section can be used to add additional products we offer to your domains.";
langfile["dscreateorder"] = langfile["createorder"];

// Left menu
langfile["helpondslogin"] = "Logging in will save you time and hassle -- you don't need to fill out all your details again since they're already in the system, and will allow you to manage all your domains from one spot.";
langfile["helpondsmanage"] = "Use this area to manage all the domains you have registered to you here, and purchase any additional services on offer by us.";
langfile["helpondstransfer"] = "Transferring your domains to us will allow you to consolidate your domain names in a single place. <em>.au</em and <em>.nz</em> domains can even be transferred for <strong>free</strong>";
langfile["helpondsrenew"] = "Do you have a domain nearing expiry? Renewing will allow you to protect your domain names, and online branding, thus preventing it from falling into the hands of competititors.";
langfile["helpondsdomaintools"] = "Looking to do a WHOIS? The tools on this page will allow you to read the registrant data on a domain name, discover where it is delegated to, and learn what IP address it resolves to.";
langfile["helpondsclientdetails"] = "Use this page to manage your client details and ensure that it is all up to date.";
langfile["helpondspricing"] = "The Pricing List will allow you to quickly check the prices of all the domain names we offer here.";
langfile["helpondsaddservices"] = "We offer some of the most affordable additional services for your domains, enabling you to get the most use out of your domain names.";
langfile["helpondscontactus"] = "Got a question? Submit any enquiries to us from this form.";

// Main menu
langfile["dsdomainregistrations"] = langfile["welcometods"];


// Sub menu
langfile["dscheckavailability"] = langfile["welcometods"];

// Hosting products
langfile["dsselectproduct"] = langfile["helponproducts"];
langfile["helpondsproducts35"] =  langfile["helponproducts35"] ;
langfile["helpondsproducts2"] = langfile["helponproducts2"];
langfile["helpondsproducts27"] = langfile["helponproducts27"];
langfile["helpondsproducts36"] = langfile["helponproducts36"];
langfile["helpondsproducts29"] = langfile["helponproducts29"];


function SetRollOverText (strRollOverText)
{
	objRollOverBox = getElemById('rolloverbox');
	objRollOverBox.innerHTML = strRollOverText;
	
}

function ClearRollOverText ()
{
	strRollOverText  = "Click on the above links to add more services onto your ";
	strRollOverText += "domain name or click on the shopping cart to finalise your order.";
	objRollOverBox = getElemById('rolloverbox');
	objRollOverBox.innerHTML = strRollOverText;
}

function ChangeClass (strElement, strClass)
{
	objTab = getElemById(strElement);
	objTab.className = strClass;
	
}

function cachetest ()
{
	alert ("cache!!");
}

