// JavaScript Document
// Code By Amit
function deleteservice(id)
{
	if(confirm("Do you want to delete this service?"))
	{
		self.location = 'deleteservice.php?id='+id;
	}
}
function deletecoupon(id)
{
	if(confirm("Do you want to delete this coupon?"))
	{
		self.location = 'deletecoupon.php?id='+id;
	}
}
function delTest(id)
{
	if(confirm("Do you want to delete this testimonial?"))
	{
		self.location = 'delTest.php?id='+id;
	}
}

function delAffilPay(id)
{
	if(confirm("Do you want to delete this payment record?"))
	{
		self.location = 'deleteAffilPayment.php?id='+id;
	}
}

function avail(v,type,objId)
{
	//alert(v+"     "+type+"    "+objId);
	if(v!='')
	{
		$('#'+objId).load('includes/avail.php?'+type+'='+v, function(){ mkDisable(objId);});
	}
	else
	{
		$('#'+objId).html('', function(){ mkDisable(objId);});
	}
}
function availAffiliates(v,type,objId)
{
	//alert(v+"     "+type+"    "+objId);
	if(v!='')
	{
		$('#'+objId).load('includes/availAffiliates.php?'+type+'='+v, function(){ mkDisable(objId);});
	}
	else
	{
		$('#'+objId).html('', function(){ mkDisable(objId);});
	}
}
function mkDisable(objId)
{
	if($('#'+objId).text()=='Username already exist.' || $('#'+objId).text()=='Email address already exist.')	
	{
		$('#signup').attr('disabled','disabled');	
	}
	else
	{
		$('#signup').removeAttr('disabled');
	}
}
function deleteorders(id)
{
	if(confirm("Do you want to delete this order?"))
	{
		self.location = 'deleteorders.php?tid='+id;
	}
}

function deleteusers(id)
{
	if(confirm("Do you want to delete this user?"))
	{
		self.location = 'deleteusers.php.php?uid='+id;
	}
}

function addkeywords()
{
	$("#key_pos_com").clone().insertBefore("#addmore");	
	
	var ct = $('.key_pos_com').length;
	if(ct==1)
	{
		$('.delopt').css('display','none');	
		alert('d');
	}
	else
	{
		$('.delopt').css('display','block');			
	}
}

function delkeywords(o)
{
	var ct = $('.key_pos_com').length;
	if(ct > 1)
	{
		$(o).parent().parent().parent().remove();	
	}
	
	var ct2 = $('.key_pos_com').length;
	if(ct2 == 1)
	{
		$('.delopt').css('display','none');	
		//alert('Could not delete.');	
	}
}

function delSeoPro(id)
{
	if(confirm("Do you want to delete this project?"))
	{
		self.location = "deleteseoproject.php?id="+id;	
	}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function showFilter()
{
	$('#hide').toggleClass('hide');
}

function delQuery(id)
{
	if(confirm("Do you want to delete this query?"))	
	{
		self.location = "delQuery.php?id="+id;	
	}
}

function delNL(id)
{
	if(confirm("Do you want to delete this subcription?"))	
	{
		self.location = "delNewsletter.php?id="+id;	
	}
}

function deleteVT(id)
{
	if(confirm("Do you want to delete this record?"))	
	{
		self.location = "delVT.php?id="+id;	
	}
}

function paymentMethode(objId)
{
	$('.hide').css('display','none');
	$('#'+objId).css('display','block');
}
