// JavaScript Document
if(window.location.host=='localhost' || window.location.host=='192.168.1.14')
{
	var root_url='http://'+window.location.host+'/kaaf_com/tws_dev/';
}
else
{
	var root_url='http://'+window.location.host+'/';
}

function entersonly(myfield, e, dec)
{
var key;
var keychar;

if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
else
   return true;

keychar = String.fromCharCode(key);

// control keys
if (key==13)
  post_login(); 
   //return true;

}

function text_box_text_hide(t,static_value)
{
	if(t.value==static_value)
	{
		t.value='';
	}
}
function text_box_text_show(t,static_value)
{
	if(t.value=='')
	{
		t.value=static_value;
	}
}

var curImg=0;
function nextImg(totImg)
{
	//alert(totImg);
	var curImgId='img_id_'+curImg;
	var nextId=parseInt(curImg)+1;
	if(parseInt(nextId)<parseInt(totImg))
	{
		var nextImgId='img_id_'+nextId;
		document.getElementById(curImgId).style.display='none';
		document.getElementById('choosen_image_link').value=document.getElementById(curImgId).src;
		//alert("src="+document.getElementById(curImgId).src);
		document.getElementById(nextImgId).style.display='block';
		curImg=nextId;
	}
}
function prevImg(totImg)
{
	var curImgId='img_id_'+curImg;
	if(parseInt(curImg)>0)
	{
		var prevId=parseInt(curImg)-1;

			var prevImgId='img_id_'+prevId;
			document.getElementById(curImgId).style.display='none';
			document.getElementById(prevImgId).style.display='block';
			
			document.getElementById('choosen_image_link').value=document.getElementById(curImgId).src;
			//alert(document.getElementById(curImgId).src);
			curImg=prevId;
	}
}


function open_animated_div(divid)
{
	$("#"+divid+":hidden:first").fadeIn("slow");
}
function close_animated_div(divid)
{
	$("#"+divid).fadeOut("slow");
}


function set_div_height(divid)
{
	var h=0;
	var ht=parseInt(document.body.scrollHeight);
	var scrnHt=parseInt(screen.height);
	
	h=ht;
	if(ht<scrnHt)
	{
		h=scrnHt;
	}
	document.getElementById(divid).style.height=h+"px";
}


function open_close_div(divid)
{
	if(document.getElementById(divid).style.display=='none')
	{
		document.getElementById(divid).style.display='block';
	}
	else
	{
		document.getElementById(divid).style.display='none';
	}
	return false;
}

var lastdivid='';
function open_close_comments_div(divid)
{
	if(lastdivid!='')
	{
		document.getElementById(lastdivid).style.display='none';
	}
	document.getElementById(divid).style.display='block';
	lastdivid=divid;
}


function open_send_mail_div(user_id,username,div_id)
{
	document.getElementById(div_id).style.display='block';
	document.getElementById('email_user_name').value=username;
	document.getElementById('email_user_id').value=user_id;
}
function open_send_messege_div(user_id,username,div_id)
{
	document.getElementById(div_id).style.display='block';
	document.getElementById('messege_user_name').value=username;
	document.getElementById('messege_user_id').value=user_id;
}
function close_any_div(div_id)
{
	document.getElementById(div_id).style.display='none';
}

function check_all_checkbox(t,prefix,number,begin)//t=>this
{
	if(t.checked==true)
	{
		for(var i=begin;i<number;i++)
		{
			document.getElementById(prefix+i).checked=true;
		}
	}
	else
	{
		for(var i=begin;i<number;i++)
		{
			document.getElementById(prefix+i).checked=false;
		}
	}
}

function put_discussion_ids(discussion_id,hidden_field_id)
{
	var ids=document.getElementById(hidden_field_id).value;
	if(ids=='')
	{
		document.getElementById(hidden_field_id).value=discussion_id;
	}
	else
	{
		document.getElementById(hidden_field_id).value=ids+','+discussion_id;
	}
	//alert(document.getElementById(hidden_field_id).value);
}

function put_value_in_ther_hidden_field(t)
{
	//hidden_field_id
	//alert(t.value);
	var str=document.getElementById('hidden_field_id').value;
	if(t.checked==true)
	{
		if(str=='')
		{
			str=t.value;
		}
		else
		{
			str=str+','+t.value;
		}
		document.getElementById('hidden_field_id').value=str;
		//alert(str);
	}
	else
	{
		var str1=document.getElementById('hidden_field_id').value;
		var new_str='';
		var arr=str1.split(',');
		for(var i=0;i<arr.length;i++)
		{
			if(arr[i]!=t.value)
			{
				if(new_str=='')
				{
					new_str=arr[i];
				}
				else
				{
					new_str=new_str+','+arr[i];
				}
			}
		}
		document.getElementById('hidden_field_id').value=new_str;
		//alert(new_str);
	}
}



function global_put_value_in_ther_hidden_field(val,hidden_id,operation)//operation=>add|remove
{
	//hidden_field_id
	//alert(t.value);
	var str=document.getElementById(hidden_id).value;
	if(operation=='add')
	{
		if(str=='')
		{
			str=val;
		}
		else
		{
			str=str+','+val;
		}
		document.getElementById(hidden_id).value=str;
		//alert(str);
	}
	else if(operation=='remove')
	{
		var str1=document.getElementById(hidden_id).value;
		var new_str='';
		var arr=str1.split(',');
		for(var i=0;i<arr.length;i++)
		{
			if(arr[i]!=val)
			{
				if(new_str=='')
				{
					new_str=arr[i];
				}
				else
				{
					new_str=new_str+','+arr[i];
				}
			}
		}
		document.getElementById(hidden_id).value=new_str;
		//alert(new_str);
	}
}


function show_image_in_ul(full_image_path,image_name,parent_ul_id,count_li_id)
{
	var ni = document.getElementById(parent_ul_id);
	var numi = document.getElementById(count_li_id);
	var num = (document.getElementById(count_li_id).value -1)+ 2;
	numi.value = num;
	var divIdName = "my"+num+"DivImage";
	
	var newdiv = document.createElement('li');
	newdiv.setAttribute("id",divIdName);
	
	var str="";
	str +='<table cellpadding="0" cellspacing="0" border="0" width="100%">';
	str +='<tr>';
	str +='<td align="left"><img src="'+full_image_path+'" alt="" width="55" height="55" border="0" /></td>';
	str +='</tr><tr>';
	str +="<td align='left' width='30%'><a href=\"javascript:void(0);\" onclick=\"removeLiImage(\'"+divIdName+"\',\'"+parent_ul_id+"\',\'"+image_name+"\')\">Remove</a></td>";
	str +='</tr>';
	str +='</table>';
	
	newdiv.innerHTML = str;
	ni.appendChild(newdiv);
}
function removeLiImage(divNum,parent_ul_id,image_name) {

  var d = document.getElementById(parent_ul_id);
  var olddiv = document.getElementById(divNum);
  d.removeChild(olddiv);
  remove_adv_image_ajax(image_name);
  global_put_value_in_ther_hidden_field(image_name,'photo','remove');
  check_maximum_photo_uploaded_field(20);
  //add
	$('#file_uploaded').html("0");
		  
		var photo=document.getElementById('photo').value;
		var l=photo.split(',');
		if(l.length<=10)
		{
			document.getElementById('frm_promote').removeAttribute('disabled');
		}
		$.post(root_url+'adv_image_upload.php?remove='+image_name,function(data)
		{	});
	
}

function show_banner_in_ul(full_image_path,image_name,parent_ul_id,count_li_id,img_path,file_name)
{	
	var ni = document.getElementById(parent_ul_id);
	var numi = document.getElementById(count_li_id);
	var num = (document.getElementById(count_li_id).value -1)+ 2;
	numi.value = num;
	var divIdName = "my"+num+"DivImage";
	
	var newdiv = document.createElement('li');
	newdiv.setAttribute("id",divIdName);
	var extn= file_name.substr(file_name.lastIndexOf(".")+1);
	var str="";
	str +='<table cellpadding="0" cellspacing="0" border="0" width="100%">';
	str +='<tr>';
	if(extn!='swf')
	str +='<td align="left"><a  href=\"javascript:void(0);\" onclick="window.open(\''+img_path+'\',\'\',\'width=300,height=250\')" ><img src="'+full_image_path+'" alt="" width="55" height="55"  /></a></td>';
	else
	str +='<td align="center"><div style="width:55px;height:55px;float:left"><object  wmode="transparent" data="'+img_path+'" width="55" height="55"></object></div><a  href=\"javascript:void(0);\" onclick="window.open(\''+img_path+'\',\'\',\'width=300,height=250\')" ><div style="width:55px;height:55px;position:absolute;float:left" ></div></a></td>';	
	str +='</tr><tr>';
	str +="<td align='left' width='30%'><a href=\"javascript:void(0);\" onclick=\"removeLiBanner(\'"+divIdName+"\',\'"+parent_ul_id+"\',\'"+image_name+"\')\">Remove</a></td>";
	str +='</tr>';
	str +='</table>';
	
	newdiv.innerHTML = str;
	ni.appendChild(newdiv);
}
function show_banner_in_ul4(full_image_path,image_name,parent_ul_id,count_li_id,img_path,file_name)
{	
	var ni = document.getElementById(parent_ul_id);
	var numi = document.getElementById(count_li_id);
	var num = (document.getElementById(count_li_id).value -1)+ 2;
	numi.value = num;
	var divIdName = "my"+num+"DivImage";
	
	var newdiv = document.createElement('li');
	newdiv.setAttribute("id",divIdName);
	var extn= file_name.substr(file_name.lastIndexOf(".")+1);
	var str="";
	str +='<table cellpadding="0" cellspacing="0" border="0" width="100%">';
	str +='<tr>';
	if(extn!='swf')
	str +='<td align="left"><a  href=\"javascript:void(0);\" onclick="window.open(\''+img_path+'\',\'\',\'width=468,height=60\')" ><img src="'+full_image_path+'" alt="" width="55" height="15"  /></a></td>';
	else
	str +='<td align="center"><div style="width:55px;height:15px;float:left"><object  wmode="transparent" data="'+img_path+'" width="55" height="15"></object></div><a  href=\"javascript:void(0);\" onclick="window.open(\''+img_path+'\',\'\',\'width=468,height=60\')" ><div style="width:55px;height:15px;position:absolute;float:left" ></div></a></td>';	
	str +='</tr><tr>';
	str +="<td align='left' width='30%'><a href=\"javascript:void(0);\" onclick=\"removeLiBanner(\'"+divIdName+"\',\'"+parent_ul_id+"\',\'"+image_name+"\')\">Remove</a></td>";
	str +='</tr>';
	str +='</table>';
	
	newdiv.innerHTML = str;
	ni.appendChild(newdiv);
}
function show_banner_in_ul1(full_image_path,image_name,parent_ul_id,count_li_id,img_path,file_name)
{		

	var ni = document.getElementById(parent_ul_id);
	var numi = document.getElementById(count_li_id);
	var num = (document.getElementById(count_li_id).value -1)+ 2;
	numi.value = num;
	var divIdName = "my"+num+"DivImage";
	var extn= file_name.substr(file_name.lastIndexOf(".")+1);
	var newdiv = document.createElement('li');
	newdiv.setAttribute("id",divIdName);
	
	var extn= file_name.substr(file_name.lastIndexOf(".")+1);

	var str="";
	str +='<table cellpadding="0" cellspacing="0" border="0" width="100%">';
	str +='<tr>';
	if(extn!='swf')
	str +='<td align="center"><a  href=\"javascript:void(0);\" onclick="window.open(\''+img_path+'\',\'\',\'width=120,height=600\')" ><img src="'+full_image_path+'" alt="" width="25" height="55"  /></a></td>';
	else
	str +='<td align="center"><div style="width:25px;height:55px;float:left"><object  wmode="transparent" data="'+img_path+'" width="25" height="55"></object></div><a  href=\"javascript:void(0);\" onclick="window.open(\''+img_path+'\',\'\',\'width=120,height=600\')" ><div style="width:25px;height:55px;position:absolute;float:left" ></div></a></td>';	
	str +='</tr><tr>';
	str +="<td align='center' width='30%'><a href=\"javascript:void(0);\" onclick=\"removeLiBanner(\'"+divIdName+"\',\'"+parent_ul_id+"\',\'"+image_name+"\')\">Remove</a></td>";
	str +='</tr>';
	str +='</table>';
	
	newdiv.innerHTML = str;
	ni.appendChild(newdiv);
}
function removeLiBanner(divNum,parent_ul_id,image_name) {

  var d = document.getElementById(parent_ul_id);
  var olddiv = document.getElementById(divNum);
  d.removeChild(olddiv);
  remove_adv_image_ajax(image_name);
  global_put_value_in_ther_hidden_field(image_name,'photo1','remove');
  check_maximum_banner_uploaded_field(20);
  //add
  $('#file_uploaded').html("0");
$.post(root_url+'adv_banner_upload.php?remove='+image_name,function(data)
		{	});
		  
		
	
}
function check_maximum_photo_uploaded_field(tot)
{
	//Upload Max Image Uploaded
	var photo=document.getElementById('photo').value;
	var l=photo.split(',');

	if(l.length>=tot)
	{
		document.getElementById('photo_field_id').style.display='none';
			
	}
	else
	{
		document.getElementById('photo_field_id').style.display='block';
	}
}
function check_maximum_banner_uploaded_field(tot)
{
	
	//Upload Max Image Uploaded
	var photo=document.getElementById('photo1').value;
	var l=photo.split(',');
	
	if(l.length>=tot)
	{
		
		document.getElementById('photo_field_id1').style.display='none';
	}
	else
	{
		document.getElementById('photo_field_id1').style.display='block';
	}
}
function js_checked_all(t,tot,prefix)
{
	if(t.checked==true)
	{
		for(var i=0;i<tot;i++)
		{
			document.getElementById(prefix+i).checked=true;
		}
	}
	else
	{
		for(var i=0;i<tot;i++)
		{
			document.getElementById(prefix+i).checked=false;
		}
	}
}

function is_checked_all(t,tot,prefix,id)
{
	var flag=0;
	if(t.checked==true)
	{
		for(var i=0;i<tot;i++)
		{
			if(document.getElementById(prefix+i).checked==false)
			{
				flag=1;
			}
		}
	}
	else
	{
		flag=1;
	}
	if(flag==0)
	{
		document.getElementById(id).checked=true;
	}
	else
	{
		document.getElementById(id).checked=false;
	}
}



function jquery_open_animated_div(divid)
{
	 $("#"+divid).animate({
		width: "450px",
		height:"500px",
		opacity:'1',
	  }, 1500 );

}
function jquery_close_animated_div(divid)
{
	 $("#"+divid).animate({
		width: "",
		height:"",
		display:'none'
	  }, 1500,
	  function(){ document.getElementById(divid).style.display='none'; }
	   );

}
function jquery_close_animated_div1()
{
	$("#email_div_id").animate({
		width: "",
		height:"",
		display:'none'
	  }, 0,
	  function(){ document.getElementById("email_div_id").style.display='none'; }
	   );
	 //document.getElementById('email_div_id').style.display='none';

}
/*VALIDATE EMAIL*/
function validateEmailv2(email)
{
// a very simple email validation checking. 
// you can add more complex email checking if it helps 
    if(email.length <= 0)
	{
	  return true;
	}
    var splitted = email.match("^(.+)@(.+)$");
    if(splitted == null) return false;
    if(splitted[1] != null )
    {
      var regexp_user=/^\"?[\w-_\.]*\"?$/;
      if(splitted[1].match(regexp_user) == null) return false;
    }
    if(splitted[2] != null)
    {
      var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;
      if(splitted[2].match(regexp_domain) == null) 
      {
	    var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;
	    if(splitted[2].match(regexp_ip) == null) return false;
      }// if
      return true;
    }
return false;
}


//The code for smiley
function open_smiley_div(divid)
{
	if(document.getElementById(divid).style.display=="none")
	{
		document.getElementById(divid).style.display="block";
	}
	else
	{
		document.getElementById(divid).style.display="none";
	}
}

function put_smiley_to_textarea(textarea_id,image_code,cursor_position_id,divid)
{
	
	var str=document.getElementById(textarea_id).value;
	var cur=parseInt(document.getElementById(cursor_position_id).value);
	
	var str1=str.substring(0,cur)+"["+image_code+"/]"+str.substring(cur,str.length);
	document.getElementById(textarea_id).value=str1;
	document.getElementById(divid).style.display="none";
}

function caret(node) {
	//return false;
	//alert(node);
 if(node.selectionStart) return node.selectionStart;
 else if(!document.selection) return 0;
 //node.focus();
 var c		= "\001";
 var sel	= document.selection.createRange();
 var txt	= sel.text;
 var dul	= sel.duplicate();
 var len	= 0;
 try{ dul.moveToElementText(node); }catch(e) { return 0; }
 sel.text	= txt + c;
 len		= (dul.text.indexOf(c));
 sel.moveStart('character',-1);
 sel.text	= "";
 return len; 
 return 0;
}



//Share Box Customize JQuery Code
function open_share_div(maindivid)
{
	document.getElementById(maindivid).style.display='block';
}
function close_share_div(maindivid)
{
	document.getElementById(maindivid).style.display='none';
}


//Text Ads JAVASCRIPT Functions
function validate_text_ads()
{
	var headline=document.getElementById('headline').value;
	var description_1=document.getElementById('description_1').value;
	var url=document.getElementById('url').value;
	var urlexp=/^[a-zA-Z0-9.-_]+\.[a-z]{2,3}$/;
	var txturlexp=/^[a-zA-Z0-9.-_]+\.[a-z]{2,}$/;
	var pricereg=/^[0-9]+(\.[0-9]{1,2})?$/;
	var text_ads_url=document.getElementById('text_ads_url').value;
	var amount=document.getElementById('amount').value;
	var balance_text_ads=document.getElementById('balance_text_ads').value;
	var ads_user_balance=document.getElementById('ads_user_balance').value;
	var curr_date=($('#curr_date').html()).split('-');
	var start_date=($('#start_date').val()).split('-');
	var stop_date=($('#stop_date').val()).split('-');	
	var err='';
	
	start_date=Date.parse(start_date[0]+'/'+start_date[1]+'/'+start_date[2]);
	stop_date=Date.parse(stop_date[0]+'/'+stop_date[1]+'/'+stop_date[2]);
	curr_date=Date.parse(curr_date[0]+'/'+curr_date[1]+'/'+curr_date[2]);

	if(parseInt(balance_text_ads)>parseInt(ads_user_balance))
	{
		alert('Your account balance is low.You cannot post the ads');
		window.location=root_url+'mystatement/';
		return false;
	}
	if(headline=='')
	{
		//err +='Please Enter Headline.\n';
		alert('Please Enter Headline');
		document.getElementById('headline').focus();
		
		return false;
	}
	
/*	if($('#chk').html()!=1)
	{
		alert("Sorry, Headline Already Exist");
		document.getElementById('headline').focus();
		return false;
	}*/
	if(description_1=='')
	{
		//err +='Please Enter Description.\n';
		alert('Please Enter Description');
		document.getElementById('description_1').focus();
		return false;
	}
	if(url=='')
	{
		//err +='Please Enter Url.\n';
		alert('Please Enter Url');
		document.getElementById('url').focus();
		return false;
	}
	else if(urlexp.test(url)==false)
	{
		//err +='Please Enter Valid Url.\n';
		alert('Please Enter Valid Url');
		document.getElementById('url').focus();
		return false;
	}
	
	if(curr_date > start_date)
	{
		alert("Please Select Future Date For Start Date")
		return false;
	}
		

	if(stop_date < start_date)
	{
		alert("Stop date cannot be less than Start date")
		return false;
	}
	else if(stop_date == start_date)
	{
		alert("Stop date and Start date cannot be same")
		return false;
	}
	if(amount!='')
	{
		if(pricereg.test(amount)==false)
		{
		//	err +='Please enter valid price.\n';
			alert('Please enter valid amount');
			document.getElementById('amount').focus();
			return false;
		}
	}
	if($('#amount').val()< parseInt($('#txt_min').html()))
			{
				alert("Minimum for Max Daily spend is =N= "+$('#txt_min').html());
				return false;
			}
	if(text_ads_url=='')
	{
		//err +='Please Enter Text Ad Url.\n';
		alert('Please Enter Text Ad Url');
		document.getElementById('text_ads_url').focus();
		return false;
	}
	else if(txturlexp.test(text_ads_url)==false)
	{
		//err +='Please Enter Valid Text Ad Url.\n';
		alert('Please Enter Valid Text Ad Url');
		document.getElementById('text_ads_url').focus();
		return false;
	}
	

	
	$('#text_loader').show();
	if(err=='')
	{
		return true;
	}
	else
	{
		alert(err);
		return false;
	}
}

function text_ads_preview()
{	
	var headline=document.getElementById('headline').value; 
	var description_1=document.getElementById('description_1').value;
	//var description_2=document.getElementById('description_2').value;
	var url=document.getElementById('url').value;
	
	
	var str='<div><a href="'+url+'" style="color:#0000EE; font-weight:bold;">'+headline+'</a></div>';
	 str +='<div>'+description_1+'</div>';
	// str +='<div>'+description_2+'</div>';
	 str +='<div style="color:#019B00; font-weight:normal;" >'+url+'</div>';
	 
	 document.getElementById('div_id_text_ads_preview').innerHTML=str;
}


//Banner Ads
function check_banner_ads()
{
	
	var banner_minimum_balance=document.getElementById('banner_minimum_balancer').value;
	var banner_ads_user_balance=document.getElementById('banner_ads_user_balance').value;
	var b_amount=document.getElementById('b_amount').value;
	var urlexp=/^[a-zA-Z0-9.-_]+\.[a-z]{2,}$/;
	var pricereg=/^[0-9]+(\.[0-9]{1,2})?$/;
	var banner_url=document.getElementById('banner_url').value;
	var curr_date=($('#curr_date').html()).split('-');
	var start_date=($('#banner_start_date').val()).split('-');
	var stop_date=($('#banner_end_date').val()).split('-');
		
	var err='';
	start_date=Date.parse(start_date[0]+'/'+start_date[1]+'/'+start_date[2]);
	stop_date=Date.parse(stop_date[0]+'/'+stop_date[1]+'/'+stop_date[2]);
	curr_date=Date.parse(curr_date[0]+'/'+curr_date[1]+'/'+curr_date[2]);
	if(parseInt(banner_minimum_balance)>parseInt(banner_ads_user_balance))
	{
		
		alert('Your account balance is low.You cannot post the ads');
		window.location=root_url+'mystatement/';
		return false;
	}

	if($('#banner_size').val()=='0')
	{
		alert("Please Select Banner Size")
		return false;		
	}
	if(curr_date >start_date)
	{
		alert("Please Select Future Date For Start Date")
		return false;
	}
	if(stop_date < start_date)
	{
		alert("Stop date cannot be less than Start date")
		return false;
	}
	else if(stop_date == start_date)
	{
		alert("Stop date and Start date cannot be same")
		return false;
	}
	if(pricereg.test(b_amount)==false)
	{
		//err +="Please Enter Valid Price\n";
		alert("Please Enter Valid Price");
		document.getElementById('b_amount').focus();
		return false;
	}
	
	if($('#b_amount').val()< parseInt($('#ban_min').html()))
			{
				alert("Minimum for Max Daily spend is =N= "+$('#ban_min').html());
				return false;
			}
			if($('#banner_size').val()== "120x600")
				{
					if($('#file_uploaded').html()!="0") 
					{
						if($('#file_uploaded').html()!="1")
						{
							alert("Please Upload File of size 120 x 600");
							return false;
						}
					}
					else
					{
						alert("Please Upload File of size 120 x 600");
						return false;
					}
					
				}
				else if($('#banner_size').val()== "300x250")
				{
					if($('#file_uploaded').html()!="0")
					{
						if($('#file_uploaded').html()!="2")
						{
							alert("Please Upload File of size 300 x 250");
							return false;
						}
					}
					else
					{
						alert("Please Upload File of size 300 x 250");
						return false;
					}
				}
				else if($('#banner_size').val()== "468x60")
				{
					if($('#file_uploaded').html()!="0")
					{
						if($('#file_uploaded').html()!="3")
						{
							alert("Please Upload File of size 468 x 60");
							return false;
						}
					}
					else
					{
						alert("Please Upload File of size 468 x 60");
						return false;
					}
				}
				
	
	if(banner_url=='')
	{
		//err +="Please Enter Banner Url\n";
		alert("Please Enter Banner Url");
		document.getElementById('banner_url').focus();
		return false;
	}
	else if(urlexp.test(banner_url)==false)
	{
		//err +="Please Enter Valid Banner Url\n";
		alert("Please Enter Valid Banner Url");
		document.getElementById('banner_url').focus();
		return false;
	}
	

	$('#banner_loader').show();
	if(err=='')
	{
		return true;
	}
	else
	{
		alert(err);
		return false;
	}
}
