<div class="wrapper purple-content">
    	<div class="container">
        	<div class="content-heading white whmcsportal">
    			<h2>{$pagetitle}</h2>
                <small>{$LANG.cartproductdomainchoose}</small>
            </div>
            <div class="view-cart">
            	<a href="{$smarty.server.PHP_SELF}?a=view"><i class="fa fa-shopping-cart"></i></a>
            </div>
		</div>
    </div>
	<script type="text/javascript" src="includes/jscript/jqueryui.js"></script>
<script type="text/javascript" src="templates/orderforms/{$carttpl}/js/main.js"></script>
<link rel="stylesheet" type="text/css" href="templates/orderforms/{$carttpl}/style.css" />
<link rel="stylesheet" type="text/css" href="templates/orderforms/{$carttpl}/uistyle.css" />


{include file="orderforms/activehostcomparison/comparisonsteps.tpl" step=1}
    <div class="wrapper" id="maincontent">
	<div class="container">
			
            <div class="whmcssection ordersummary" id="contactbox">
<div class="cartcontainer">

<p>{$LANG.cartproductdomaindesc}</p>

<div class="domainoptions">
{if $incartdomains}
<div><label><input type="radio" name="domainoption" value="incart" /> {$LANG.cartproductdomainuseincart}</label></div>
{/if}
{if $registerdomainenabled}
<div><label><input type="radio" name="domainoption" value="register" /> {$LANG.cartregisterdomainchoice|sprintf2:$companyname}</label></div>
{/if}
{if $transferdomainenabled}
<div><label><input type="radio" name="domainoption" value="transfer" /> {$LANG.carttransferdomainchoice|sprintf2:$companyname}</label></div>
{/if}
{if $owndomainenabled}
<div><label><input type="radio" name="domainoption" value="owndomain" /> {$LANG.cartexistingdomainchoice|sprintf2:$companyname}</label></div>
{/if}
{if $subdomains}
<div><label><input type="radio" name="domainoption" value="subdomain" /> {$LANG.cartsubdomainchoice|sprintf2:$companyname}</label></div>
{/if}
</div>

<div style="text-align:center; margin:30px 0">
<form onsubmit="checkdomain();return false">

<div class="domainreginput" id="domainincart">
<select id="incartsld">
{foreach key=num item=incartdomain from=$incartdomains}
<option value="{$incartdomain}">{$incartdomain}</option>
{/foreach}
</select>
</div>
<div class="domainreginput" id="domainregister">
<input type="text" id="registersld" class="textbox" placeholder="websitehere" style="max-width:330px;font-size:24px; margin-right:15px;" value="{$sld}" /> <select id="registertld" class="select" style="width:75px;">
{foreach key=num item=listtld from=$registertlds}
<option value="{$listtld}"{if $listtld eq $tld} selected="selected"{/if}>{$listtld}</option>
{/foreach}
</select>
</div>
<div class="domainreginput" id="domaintransfer">
<input type="text" id="transfersld" class="textbox" placeholder="websitehere" style="max-width:330px;font-size:24px; margin-right:15px;" value="{$sld}" /> <select id="transfertld" class="select" style="width:75px;">
{foreach key=num item=listtld from=$transfertlds}
<option value="{$listtld}"{if $listtld eq $tld} selected="selected"{/if}>{$listtld}</option>
{/foreach}
</select>
</div>
<div class="domainreginput" id="domainowndomain">
<input type="text" id="owndomainsld"   class="textbox" placeholder="websitehere" style="max-width:330px;font-size:24px; margin-right:15px;" value="{$sld}" /> . <input type="text" id="owndomaintld" size="5" value="{$tld|substr:1}"  style="width:75px;"/>
</div>
<div class="domainreginput" id="domainsubdomain">
<input type="text" id="subdomainsld" size="30" class="textbox" placeholder="websitehere" style="max-width:330px;font-size:24px; margin-right:15px;" value="{$sld}" /> <select id="subdomaintld" class="select" style="width:75px;">{foreach from=$subdomains key=subid item=subdomain}<option value="{$subid}">{$subdomain}</option>{/foreach}</select>
</div>

<input type="submit" value="{$LANG.ordercontinuebutton}" class="btn btn-md btn-blue" style="margin:15px 0 0 0"/>

{if $freedomaintlds}<p>* <em>{$LANG.orderfreedomainregistration} {$LANG.orderfreedomainappliesto}: {$freedomaintlds}</em></p>{/if}

</form>
</div>
<div id="loading3" class="loading"><img src="images/loading.gif" border="0" alt="Loading..." /></div>

<form method="post" action="cart.php?a=add&pid={$pid}" id="domainfrm">
<div id="domainresults"></div>
</form>

</div>

{literal}
<script language="javascript">
jQuery(".domainreginput").hide();
jQuery(".domainoptions input:first").attr('checked','checked');
jQuery("#domain"+jQuery(".domainoptions input:first").val()).show();
jQuery(document).ready(function(){
    jQuery(".domainoptions input").click(function(){
        jQuery("#domainresults").slideUp();
        jQuery(".domainreginput").hide();
        jQuery("#domain"+jQuery(this).val()).show();
    });
});
function checkdomain() {
    var domainoption = jQuery(".domainoptions input:checked").val();
    var sld = jQuery("#"+domainoption+"sld").val();
    var tld = '';
    if (domainoption=='incart') var sld = jQuery("#"+domainoption+"sld option:selected").text();
    if (domainoption=='subdomain') var tld = jQuery("#"+domainoption+"tld option:selected").text();
    else var tld = jQuery("#"+domainoption+"tld").val();
    jQuery("#loading3").slideDown();
    jQuery.post("cart.php", { a: "domainoptions", sld: sld, tld: tld, checktype: domainoption, ajax: 1 },
    function(data){
        jQuery("#domainresults").html(data);
        jQuery("#domainresults").slideDown();
        jQuery("#loading3").slideUp();
    });
}
</script>
{/literal}
</div>
</div>
</div>