//var alert_TIT = 'ADD_BANNER';
//********************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 = "
";
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";
}
*/
//****************cutomize alert message box********************
//**********************JAVASCRIPT for addbanner.php***************************
function submitenable_url()
{
var trim_url = frm.url.value;
trim_url = trim_url.replace(/^\s*|\s*$/g,"");
trim_url = trim_url.replace("http://http://","http://");
var url_len=trim_url.length;
var trim_email = frm.e_mail.value;
selLen = document.frm.spn_opt.length;
var selCat;
for(var i = 0; i < selLen; i++)
{
if(document.frm.spn_opt[i].checked)
{
selCat=document.frm.spn_opt[i].value;
}
}
var tot_price;
var pri_cat;
var opt_flag=false;
tot_price = 0;
if(selCat=="")
{
opt_flag=false;
alert("please select a duration");
// makeAlert(alert_TIT , "You can select maximum five Categories");
return false;
}
else if(selCat == "3mth")
{
opt_flag=true;
pri_cat = parseFloat(pri_amt3);
tot_price = parseFloat(pri_t_3);
}
else if(selCat == "6mth")
{
opt_flag=true;
pri_cat = parseFloat(pri_amt6);
tot_price = parseFloat(pri_t_6);
}
else if(selCat=="9mth")
{
opt_flag=true;
pri_cat = parseFloat(pri_amt9);
tot_price = parseFloat(pri_t_9);
}
else if(selCat == "12mth")
{
opt_flag=true;
pri_cat = parseFloat(pri_amt12);
tot_price = parseFloat(pri_t_12);
}
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("os2").value = selCat;
document.getElementById("amount").value = tot_price;
document.getElementById("tot_amt").innerHTML= "$ "+tot_price+'.00';
if(opt_flag==true && trim_url!='http://' && trim_url!='' && trim_email!='' && frm.check_submit_home.checked)
{
//if(frm.check_submit_home.checked)
// {
//var newImageUrl = len+"images/paypal_pay.gif";
//document.getElementById("submit").src=newImageUrl;
//document.getElementById("submit").disabled = false;
document.getElementById("show").innerHTML = '';
// }
// else
// {
//alert('Please read the policies and proceed');
//var newImageUrl = len+"images/paypal.gif";
//document.getElementById("submit").src=newImageUrl;
//document.getElementById("submit").disabled = true;
// }
}
else
{
//var newImageUrl = len+"images/paypal.gif";
//document.getElementById("submit").style.backgroundImage ='url(' + newImageUrl + ')';
// document.getElementById("submit").src=newImageUrl;
// document.getElementById("submit").disabled = true;
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 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;
selLen = document.frm.spn_opt.length;
var selCat;
for(var i=0; iSubmission Policiesnehal");
}
function slot_window()
{
mywindow=window.open("banner_status.php?domain="+domain_nm,"","statusbar='no', menubar='no', width=400, height=250");
mywindow.moveTo(190,250);
//mywindow.document.write("Submission Policiesnehal");
}
function submitForm()
{
var trim_title = frmaddbanner2.title.value;
trim_title = trim_title.replace(/^\s*|\s*$/g,"");
if(frmaddbanner2.strt_dt.value == "")
{
alert("Please enter Start Date.");
//makeAlert(alert_TIT ,"Please enter Start Date.");
frmaddbanner2.strt_dt.focus();
return false ;
}
else if(frmaddbanner2.title.value == "" )
{
alert("Please enter a Banner Title.");
// makeAlert(alert_TIT ,"Please enter a Banner Title.");
frmaddbanner2.title.focus();
return false ;
}
else if(trim_title.length < 5 )
{
alert("Please enter minimum 5 characters for Banner Title.");
//makeAlert(alert_TIT ,"Please enter minimum 5 characters for Banner Title.");
frmaddbanner2.title.focus();
return false;
}
else if(trim_title.length > 25 )
{
alert("Please enter maximum 25 characters for Banner Title.");
//makeAlert(alert_TIT ,"Please enter maximum 20 characters for Banner Title.");
frmaddbanner2.title.focus();
return false;
}
else if(document.frmaddbanner2.R1[0].checked==false && document.frmaddbanner2.R1[1].checked==false)
{
alert("Please select upload option.");
// makeAlert(alert_TIT ,"Please select upload option.");
frmaddbanner2.R1.focus();
return false;
}
else if(document.frmaddbanner2.R1[0].checked==true || document.frmaddbanner2.R1[1].checked==true)
{
if(frmaddbanner2.R1[0].checked)
{
if(frmaddbanner2.uploadBanner.value == '' )
{
alert("Please upload banner.");
//makeAlert(alert_TIT ,"Please upload banner.");
frmaddbanner2.uploadBanner.focus();
return false ;
}
else
{
var uploadFile=document.getElementById('uploadBanner');
if(uploadFile.value !='')
{
var div_w=0;
var tempupload=uploadFile.value;
var uploadfile=tempupload.toLowerCase();
var pos3,pos4,pos5,pos6,str;
var fname=uploadfile;
if((uploadfile.indexOf('\\')==-1)||(uploadfile.indexOf(':')==-1))
{
var msg_str='Improper Path';
alert('Invalid Path of file'+i);
return false;
}
else
{
pos3=fname.lastIndexOf("\\");
pos4=fname.length;
fname=fname.substring(pos3+1,pos4);
pos5=fname.lastIndexOf(".");
pos6=fname.length;
str=fname.substring(pos5,pos6);
str='*'+str+'*';
var valid_type='*.jpg*,*.gif*,*.bmp*,*.psd*,*.png*,*.jpeg*';
if((uploadfile.indexOf('newpage')!=-1)&&(str.indexOf('.htm')!=-1))
{
var msg_str='Cannot upload a file with this name.
Please select a file with another name.';
alert('Cannot upload a file with this name.
Please select a file with another name.');
}
else
{
if(valid_type.indexOf(str)!= -1)
{
//alert('Put code here to have check against duplication of file name');
}
else
{
alert('Invalid file type.
Cannot upload a file of this type.');
return false;
}
}//else of if((uploadfile.indexOf('newpage')!=-1)&&(str.indexOf('.htm')!=-1))
}//else of if((uploadfile.indexOf('\\')==-1)||(uploadfile.indexOf(':')==-1))
}//if of if(uploadFile.value !='')
}//else of if(frmaddbanner2.uploadBanner.value == '' )
}//if of if(frmaddbanner2.R1[0].checked)
}//else if(frmaddbanner2.R1.value != '')
else
{
alert(frmaddbanner2.uploadBanner.value);
return true;
}
}
function SelectDate()
{
D = document.getElementById('strt_dt').value;
if(D){
D = D.split('/');
T = new Array(D[1], D[0], D[2]);
}else{
Dat = new Date();
T = new Array(Dat.getDay(), Dat.getMonth(), Dat.getFullYear());
}
win = window.open("datepicker.php","win","top=380,left=310,status=no,scrollbars=no,toolbar=no,menubar=no,height=150,width=150");
if (parseInt(navigator.appVersion) == 2 && navigator.appName == "Netscape")
{
win = window.open("datepicker.php","win","top=380,left=310,status=no,scrollbars=no,toolbar=no,menubar=no,height=150,width=150");
//win = window.open("datepicker.php","win","status=yes,height=325,width=250");
}
//win'MakeDate',D[2], D[1],D[0], 'SetDate');
// win.MakeDate(D[2], D[1], D[0]);
win.MakeDate(T[2], T[1], T[0]);
}
function SetDate(Day, Month, Year)
{
// document.getElementById('strt_dt').value = Year + '-' + Month + '-' + Day;
if(Month<10)
{
Month='0'+Month;
}
document.getElementById('strt_dt').value = Month + '/' + Day + '/' + Year;
}
//**********************JAVASCRIPT for submitabnner.php***************************