var add_val = 'This is optional. However, providing this information can help drive more traffic to your web site. You can provide HTML formatted text here, containing up to four hyperlinks pointing to any URLs of your web site.';
var metakwrd_val = 'Optional, but could benefit your listing and web site.';
var mul_cat ="Hold CTRL Key to Select upto Four More Categories.";
//********************cutomize alert message*******************
function BrowserCheck()
{
var b = navigator.appName;
if (b == "Netscape") this.b = "NS";
else if (b == "Microsoft Internet Explorer") this.b = "IE";
else this.b = b;
this.v = parseInt(navigator.appVersion);
this.NS = (this.b == "NS" && this.v>=4);
this.NS4 = (this.b == "NS" && this.v == 4);
this.NS5 = (this.b == "NS" && this.v == 5);
this.IE = (this.b == "IE" && this.v>=4);
this.IE4 = (navigator.userAgent.indexOf('MSIE 4')>0);
this.IE5 = (navigator.userAgent.indexOf('MSIE 5')>0);
if (this.IE5 || this.NS5) this.VER5 = true;
if (this.IE4 || this.NS4) this.VER4 = true;
this.OLD = (! this.VER5 && ! this.VER4) ? true : false;
this.min = (this.NS||this.IE);
}
is = new BrowserCheck();
alertBox = (is.VER5) ? document.getElementById("alertLayer").style
: (is.NS) ? document.layers["alertLayer"]
: document.all["alertLayer"].style;
function hideAlert()
{
alertBox.visibility = "hidden";
}
function makeAlert(aTitle,aMessage)
{
document.all.alertLayer.innerHTML = "
" +
"
" + " " + aTitle + "
" +
"
" +
"
" + aMessage + "
" +
"
" +
"
" +
"
";
thisText = aMessage.length;
if (aTitle.length > aMessage.length){ thisText = aTitle.length; }
aWidth = (thisText * 5) + 80;
aHeight = 100;
if (aWidth < 150){ aWidth = 200; }
if (aWidth > 350){ aWidth = 350; }
if (thisText > 60){ aHeight = 110; }
if (thisText > 120){ aHeight = 130; }
if (thisText > 180){ aHeight = 150; }
if (thisText > 240){ aHeight = 170; }
if (thisText > 300){ aHeight = 190; }
if (thisText > 360){ aHeight = 210; }
if (thisText > 420){ aHeight = 230; }
if (thisText > 490){ aHeight = 250; }
if (thisText > 550){ aHeight = 270; }
if (thisText > 610){ aHeight = 290; }
alertBox.width = aWidth;
alertBox.height = aHeight;
alertBox.left = (document.body.clientWidth - aWidth)/2;
alertBox.top = (document.body.clientHeight - aHeight)/2;
alertBox.visibility = "visible";
}
function Makeconfirm(aTitle,url,cat_lbl,sel_cat,email,price)
//function Makeconfirm(aTitle,url,cat_lbl,sel_cat,email,price)
{
var aMessage ="The Basic Info you've provided in order to Add your URL to Domain is as follows:";
//document.all.alertLayer.innerHTML = "
" + "
" + " " + aTitle + "
" + "
" + "
The Basic Info you've provided in order to Add your URL to " + aTitle + " is as follows: " + aMessage + " Please click OK to proceed or Cancel to change the above information.
" + "
" + "
" + "
";
document.all.alertLayer.innerHTML = "
" + aTitle + "
The Basic Info you've provided in order to Add your URL to " + aTitle+ " is as follows:
Your URL
:
" + url + "
" + cat_lbl + "
:
" + sel_cat + "
Your e-mail
:
" + email + "
Total Amount Payable
:
$ " + price + "
Please click OK to proceed or Cancel to change the above information.
";
thisText = aMessage.length;
if (aTitle.length > aMessage.length){ thisText = aTitle.length; }
aWidth = (thisText * 5) + 80;
aHeight = 100;
if (aWidth < 150){ aWidth = 200; }
if (aWidth > 350){ aWidth = 350; }
if (thisText > 60){ aHeight = 110; }
if (thisText > 120){ aHeight = 130; }
if (thisText > 180){ aHeight = 150; }
if (thisText > 240){ aHeight = 170; }
if (thisText > 300){ aHeight = 190; }
if (thisText > 360){ aHeight = 210; }
if (thisText > 420){ aHeight = 230; }
if (thisText > 490){ aHeight = 250; }
if (thisText > 550){ aHeight = 270; }
if (thisText > 610){ aHeight = 290; }
//alert(aWidth);
//alert(aHeight);
aHeight = 290;
alertBox.width = aWidth;
alertBox.height = aHeight;
alertBox.left = (document.body.clientWidth - aWidth)/2;
alertBox.top = (document.body.clientHeight - aHeight)/2;
alertBox.visibility = "visible";
}
function ok_btn()
{
alertBox.visibility = "hidden";
var trim_url = frm.url.value;
var trim_email = frm.e_mail.value;
var total_price=frm.amount.value;
selCat = document.getElementById('cat');
var i;
var final_cat;
var count = 0;
for (i=0; i 1)
{
var addi_count = count - 1;
var cat_p1 = Math.round(pri_cat*100);
var cat_p2 = Math.round(addi_count * addi_cat * 100);
var tot_price = (cat_p1 + cat_p2)/100;
//var tot_price = ((pri_cat*100) + (addi_count*addi_cat*100))/100;
}
if(count > 5)
{
makeAlert(alert_TIT , "You can select maximum five Categories");
document.getElementById("cat").selectedIndex = -1;
document.getElementById("cat").focus();
return false;
}
if(trim_url == "http:/")
trim_url="http://";
document.getElementById("url").value = trim_url;
document.getElementById("os0").value = trim_url;
document.getElementById("os1").value = trim_email;
document.getElementById("amount").value = tot_price;
document.getElementById("tot_amt").innerHTML= "$ "+tot_price;
if(count > 0 && trim_url != 'http://' && trim_url != '' && trim_email != '' && frm.check_submit.checked)
{
document.getElementById("show").innerHTML = '';
}
else
{
document.getElementById("show").innerHTML = '';
}
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
function submitForm1()
{
var pri_cat = parseFloat(primary_cat_price);
var addi_cat = parseFloat(additional_cat_price);
var trim_url = frm.url.value;
trim_url = trim_url.replace(/^\s*|\s*$/g,"");
var url_len=trim_url.length;
var trim_email = frm.e_mail.value;
var email_len=trim_email.length;
selCat = document.getElementById('cat');
var total_price=frm.amount.value;
var i;
var count = 0;
var final_cat;
for (i=0; i" + (count+1) + ". " + selCat.options[i].value;
count++;
}
}
var tot_price;
if(count == 0 )
tot_price = "0.00";
else if(count == 1)
{
tot_price = (pri_cat*100)/100;
var cat_lbl ="Category";
}
else if(count > 1)
{
var addi_count = count-1;
var cat_p1 = Math.round(pri_cat*100);
var cat_p2 = Math.round(addi_count * addi_cat * 100);
var tot_price = (cat_p1 + cat_p2)/100;
var cat_lbl ="Categories";
//var tot_price = (pri_cat*100 + addi_count*addi_cat*100)/100;
}
if(count <= 0)
{
makeAlert(alert_TIT , "Please select a Category.");
document.getElementById("cat").focus();
return false;
}
else if (trim_url.length == 0)
{
makeAlert(alert_TIT , "Please enter URL.");
frm.url.focus();
return false ;
}
else if(trim_email.length == 0 )
{
makeAlert(alert_TIT , "Please enter an E-mail-1 address.");
frm.e_mail.focus();
return false ;
}
else if(trim_email.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z]+$/) == -1 )
{
makeAlert(alert_TIT , "Please enter a valid E-mail address.");
frm.e_mail.focus();
return false;
}
else if(frm.os0.value == '' && frm.os1.value == '' )
{
makeAlert(alert_TIT , "Please, Try Again");
frm.e_mail.focus();
return false ;
}
else if((trim_url != frm.os0.value) || (trim_email != frm.os1.value) || (tot_price != frm.amount.value))
{
makeAlert(alert_TIT , "Please, Try Again");
frm.e_mail.focus();
return false ;
}
else
{
//Makeconfirm(alert_TIT,trim_url);
Makeconfirm(alert_TIT,trim_url,cat_lbl,final_cat,trim_email,tot_price);
// Makeconfirm(alert_TIT,"Your URL : " + trim_url + " " + cat_lbl +" : " + final_cat + " Your e-mail : " + trim_email + " Total Amount Payable : $" + tot_price + " ");
}
}
//**********************JAVASCRIPT for addurl.php***************************
//**********************JAVASCRIPT for submiturl.php***************************
function check_value()
{
var ttl = frmaddurl.add_desc.value;
var tt2=ttl.replace("This is optional. However, providing this information can help drive more traffic to your web site.", "");
tt2=tt2.replace("You can provide HTML formatted text here, containing up to four hyperlinks pointing to any URLs of your web site.", "");
tt2=tt2.replace(/^\s*|\s*$/g,"");
if(tt2== "")
frmaddurl.add_desc.value='';
}
function check_value1()
{
var metakwrd = frmaddurl.metakwrd.value;
if(metakwrd == metakwrd_val)
frmaddurl.metakwrd.value='';
}
function chk_category()
{
var tot_cat = frmaddurl.tot_cat.value;
selCat = document.getElementById('cat');
var i;
var count = 0;
for (i=0; i 1)
var msg = "Please select "+txt_cat+" categories.";
else
var msg = "Please select "+txt_cat+" category.";
makeAlert(alert_TIT , msg);
document.getElementById("cat").selectedIndex = 0;
document.getElementById("cat").focus();
return false;
}
else
return true;
}
function enable()
{
if(frmaddurl.title.value.length >= 20)
document.getElementById("Rem_Title_count").innerHTML = ''+frmaddurl.title.value.length+'';
else
document.getElementById("Rem_Title_count").innerHTML = ''+frmaddurl.title.value.length+'';
if(frmaddurl.description.value.length >= 125)
document.getElementById("Rem_Desc_count").innerHTML = ''+frmaddurl.description.value.length+'';
else
document.getElementById("Rem_Desc_count").innerHTML = ''+frmaddurl.description.value.length+'';
document.getElementById("Rem_Addsc_count").innerHTML = 0;
document.getElementById("Title_count").innerHTML = 95 - frmaddurl.title.value.length;
document.getElementById("Desc_count").innerHTML = 400 - frmaddurl.description.value.length;
document.getElementById("Addsc_count").innerHTML = 1000 - frmaddurl.add_desc.value.length;
if(frmaddurl.check_submit.checked)
{
frmaddurl.submitbtn.disabled=false;
}
else
{
frmaddurl.submitbtn.disabled=true;
}
}
function TitleCount(Titlecnt)
{
document.getElementById("Title_count").innerHTML = 95 - frmaddurl.title.value.length;
if(frmaddurl.title.value.length >= 20)
document.getElementById("Rem_Title_count").innerHTML = ''+frmaddurl.title.value.length+'';
else
document.getElementById("Rem_Title_count").innerHTML = ''+frmaddurl.title.value.length+'';
}
function count_link()
{
var a = new Array();
var str_desc = frmaddurl.add_desc.value;
a= str_desc.split("");
c= str_desc.split("");
var b = a.length - 1 ;
var d = c.length - 1;
var e = b+d;
if(e > 4 )
makeAlert(alert_TIT , "Maximum four Hyperlinks allowed in Additional Information.");
}
function DescCount(Desccnt)
{
var str_desc = frmaddurl.add_desc.value;
if (frmaddurl.description.value.length > 400 )
{
frmaddurl.description.value = frmaddurl.description.value.substring( 0, 400 );
makeAlert(alert_TIT , "Description should contain a maximum of 400 characters.");
return false;
}
if (frmaddurl.add_desc.value.length > 1000 )
{
frmaddurl.add_desc.value = frmaddurl.add_desc.value.substring( 0, 1000 );
makeAlert(alert_TIT , "Additional Information should contain a maximum of 1000 characters.");
return false;
}
document.getElementById("Addsc_count").innerHTML = 1000 - frmaddurl.add_desc.value.length;
document.getElementById("Desc_count").innerHTML = 400 - frmaddurl.description.value.length;
if(frmaddurl.description.value.length >= 125)
document.getElementById("Rem_Desc_count").innerHTML = ''+frmaddurl.description.value.length+'';
else
document.getElementById("Rem_Desc_count").innerHTML = ''+frmaddurl.description.value.length+'';
document.getElementById("Rem_Addsc_count").innerHTML = frmaddurl.add_desc.value.length;
}
function check_submitenable()
{
if(frmaddurl.check_submit.checked)
{
frmaddurl.submitbtn.disabled=false;
}
else
{
frmaddurl.submitbtn.disabled=true;
}
}
function new_window()
{
mywindow=window.open("policy.php","","statusbar='no', menubar='no', width=500, height=350");
mywindow.document.title = "Submission Policies to " + alert_TIT;
mywindow.moveTo(190,100);
//mywindow.document.write("Submission Policiesnehal");
}
function submitForm()
{
var ttl = frmaddurl.add_desc.value;
var tt2=ttl.replace("This is optional. However, providing this information can help drive more traffic to your web site.", "");
tt2=tt2.replace("You can provide HTML formatted text here, containing up to four hyperlinks pointing to any URLs of your web site.", "");
tt2=tt2.replace(/^\s*|\s*$/g,"");
if(tt2== "")
frmaddurl.add_desc.value='';
var trim_title = frmaddurl.title.value;
trim_title = trim_title.replace(/^\s*|\s*$/g,"");
var trim_desc = frmaddurl.description.value;
trim_desc = trim_desc.replace(/^\s*|\s*$/g,"");
var trim_url = frmaddurl.url.value;
trim_url = trim_url.replace(/^\s*|\s*$/g,"");
var url_len=trim_url.length;
var trim_email = frmaddurl.e_mail.value;
var email_len=trim_email.length;
var tot_cat = frmaddurl.tot_cat.value;
selCat = document.getElementById('cat');
var i;
var count = 0;
for (i=0; i");
c= str_desc.split("");
var b = a.length - 1;
var d = c.length - 1;
var e = b+d;
if(tot_cat < count || count == 0)
{
if(tot_cat == 1)
var txt_cat= "One";
if(tot_cat == 2)
var txt_cat= "Two";
if(tot_cat == 3)
var txt_cat= "Three";
if(tot_cat == 4)
var txt_cat= "Four";
if(tot_cat == 5)
var txt_cat= "Five";
if(tot_cat > 1)
var msg = "Please select "+txt_cat+" categories.";
else
var msg = "Please select "+txt_cat+" category.";
makeAlert(alert_TIT , msg);
document.getElementById("cat").focus();
return false;
}
else if (trim_url.length == 0)
{
makeAlert(alert_TIT ,"Please enter URL.");
frmaddurl.url.focus();
return false ;
}
else if (trim_url.indexOf('.')== -1 || trim_url.indexOf('.')== 0 || trim_url.indexOf('.')== url_len-1 )
{
makeAlert(alert_TIT ,"The URL you\'re trying to add is not a valid URL."+"\n Please correct it and try again.");
frmaddurl.url.focus();
return false ;
}
else if(trim_title.length == 0 )
{
makeAlert(alert_TIT ,"Please enter a Site Title.");
frmaddurl.title.focus();
return false ;
}
else if(trim_title.length < 20 )
{
makeAlert(alert_TIT ,"Please enter minimum 20 characters for Site Title.");
frmaddurl.title.focus();
return false ;
}
else if(trim_title.length > 95 )
{
makeAlert(alert_TIT ,"Site Title should contain a maximum of 95 characters.");
frmaddurl.title.focus();
return false ;
}
else if(trim_desc.length == 0 )
{
makeAlert(alert_TIT ,"Please enter a Description.");
frmaddurl.description.focus();
return false ;
}
else if(trim_desc.length < 125 )
{
makeAlert(alert_TIT ,"Please enter minimum 125 characters for Description.");
frmaddurl.description.focus();
return false ;
}
else if(trim_desc.length > 400 )
{
makeAlert(alert_TIT ,"Description should contain a maximum of 400 characters.");
frmaddurl.description.focus();
return false ;
}
else if(str_desc.length > 1000 )
{
makeAlert(alert_TIT ,"Additional Information should contain a maximum of 1000 characters.");
frmaddurl.description.focus();
return false ;
}
else if(e > 4)
{
makeAlert(alert_TIT , "Maximum four Hyperlinks allowed in Additional Information.");
frmaddurl.add_desc.focus();
return false;
}
else if(trim_email.length == 0 )
{
makeAlert(alert_TIT , "Please enter an E-mail address.");
frmaddurl.e_mail.focus();
return false ;
}
else if(trim_email.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z]+$/) == -1 )
{
makeAlert(alert_TIT , "The E-mail address you've provided is not valid."+"\n Please enter a valid E-mail address.");
frmaddurl.e_mail.focus();
return false;
}
else
{
return true;
}
}
//**********************JAVASCRIPT for submiturl.php***************************