function gotolink(url)
{
	window.location = url;
}

var checked=false;
function checkedAll(myform) 
{
	var aa= document.getElementById(myform);
	
	if (checked == false)
	{
		checked = true
	}
	else
	{
		checked = false
	}
	
	for (var i =0; i < aa.elements.length; i++) 
	{
		aa.elements[i].checked = checked;
	}
}


// user register //
function registeruser()
{
	jQuery('#orderform').unbind('submit');
		var options = {
		target: '#errordiv',
		beforeSubmit: showregisterRequest,
		success: showregisterrResponse,
		url: 'request_process.php?calling=1'
	};

	jQuery('#orderform').submit(function() {
		jQuery(this).ajaxSubmit(options);
		return false;
	});
}

function showregisterRequest(formData, jqForm, options)
{
	var queryString = jQuery.param(formData);
	return true;
}

function showregisterrResponse(responseText, statusText)
{
	var myarray=new Array();
    myarray=responseText.split("-SEPARATOR-");
	if(myarray[0] == 'done')
	{
		window.location.href="paypal_signup.php";
	}
	else
	{
		jQuery('#errordiv').html(responseText);
		jQuery('#errordiv').show();
	}
}

//-----------------------------------------------//

function loginuser()
{
	
	jQuery('#feedback').unbind('submit');
		var options = {
		//target: '#dialogbox_div',
		
		beforeSend : function () {
			
		},
		
		beforeSubmit: showloginuserRequest,
		success: showloginuserResponse,
		url: 'request_process.php?calling=2'
	};

	// bind to the form's submit event
	jQuery('#feedback').submit(function() {
		jQuery(this).ajaxSubmit(options);
		return false;
	});
}

// pre-submit callback
function showloginuserRequest(formData, jqForm, options)
{
	var queryString = jQuery.param(formData);
	return true;
}

function showloginuserResponse(responseText, statusText)
{
	var myarray=new Array();
    myarray=responseText.split("-SEPARATOR-");
	if(myarray[0] == 'done')
	{
		jQuery('#response_username').html('');
		jQuery('#response_password').html('');
			
		jQuery('#dialogbox_div').hide();
		jQuery('#success_div').show();
		jQuery('#form_feedback').hide();
		setTimeout('gotolink(\''+myarray[1]+'\')', 1000);
	}
	else
	{
				if(responseText == "invalid")
		{
			jQuery('#msges').show();
			jQuery('#response_username').hide();
			jQuery('#response_password').hide();
		}
		else if(responseText == "expire") {

				window.location="renewal.php"
		
		}else
		{
			var mycars = new Array();
			mycars=responseText.split("__SEPARATOR__");
			
			jQuery('#response_username').html(mycars[1]);
			jQuery('#response_password').html(mycars[2]);
			jQuery('#response_username').show();
			jQuery('#response_password').show();
			jQuery('#msges').hide();
		}

	}
}

//--------------------------------------------------------------//

function delSingleInBox(inboxid)
{
	if(confirm("Are you sure to delete this?"))
	{
		jQuery.ajax({
		   type: "POST",
		   url: 'request_process.php?calling=3',
		   data: 'inboxid='+inboxid,
		   
		   success: function(msg)
		   {
			   jQuery('#outboxlist').html(msg);
			},
			error: function(){
				
			}
		 });
	}
}

//-----------------------------------------------------------------//

function addnewcontact()
{
	jQuery('#addcontactform').unbind('submit');
		var options = {
		//target: '#dialogbox_div',
		
		beforeSend : function () {
			
		},
		
		beforeSubmit: showaddnewcontactRequest,
		success: showaddnewcontactResponse,
		url: 'request_process.php?calling=4'
	};

	// bind to the form's submit event
	jQuery('#addcontactform').submit(function() {
		jQuery(this).ajaxSubmit(options);
		return false;
	});
}

// pre-submit callback
function showaddnewcontactRequest(formData, jqForm, options)
{
	var queryString = jQuery.param(formData);
	return true;
}

function showaddnewcontactResponse(responseText, statusText)
{
	var myarray=new Array();
    myarray=responseText.split("-SEPARATOR-");
	
	if(myarray[0] == 'done')
	{
		jQuery('#contactslisting').html(myarray[1]);
		
		jQuery('#fname').val('');
		jQuery('#lname').val('');
		jQuery('#email').val('');
		
		jQuery('#errordiv').hide();
		jQuery('#addcontacts').hide();
	}
	else
	{
		jQuery('#errordiv').html(responseText);
		jQuery('#errordiv').show();
	}
}

//--------------------------------------------------------------//

function delSinglecontacts(customercontactid)
{
	if(confirm("Are you sure to delete this?"))
	{
		jQuery.ajax({
		   type: "POST",
		   url: 'request_process.php?calling=5',
		   data: 'customercontactid='+customercontactid,
		   
		   success: function(msg)
		   {
			   jQuery('#contactslisting').html(msg);
			},
			error: function(){
				
			}
		 });
	}
}

//---------------------------------------------------------------//

function showeditcontacts(customercontactid)
{
	jQuery.ajax({
	   type: "POST",
	   url: 'request_process.php?calling=6',
	   data: 'customercontactid='+customercontactid,
	   
	    success: function(msg)
	    {
		   jQuery('#addcontacts').html(msg);
		   jQuery('#addcontacts').show();
		},
		error: function(){
			
		}
	 });
}

//-----------------------------------------------------------------//

function addnewuser()
{
	jQuery('#addcontactform').unbind('submit');
		var options = {
		//target: '#dialogbox_div',
		
		beforeSend : function () {
			
		},
		
		beforeSubmit: showaddnewuserRequest,
		success: showaddnewuserResponse,
		url: 'request_process.php?calling=7'
	};

	// bind to the form's submit event
	jQuery('#addcontactform').submit(function() {
		jQuery(this).ajaxSubmit(options);
		return false;
	});
}

// pre-submit callback
function showaddnewuserRequest(formData, jqForm, options)
{
	var queryString = jQuery.param(formData);
	return true;
}

function showaddnewuserResponse(responseText, statusText)
{
	var myarray=new Array();
    myarray=responseText.split("-SEPARATOR-");
	
	if(myarray[0] == 'done')
	{
		jQuery('#outboxlist').html(myarray[1]);
		
		jQuery('#fname').val('');
		jQuery('#lname').val('');
		jQuery('#login').val('');
		jQuery('#editid').val('');
		
		jQuery('#errordiv').hide();
		jQuery('#addnewuserform').hide();
	}
	else
	{
		jQuery('#errordiv').html(responseText);
		jQuery('#errordiv').show();
	}
}

//--------------------------------------------------------------//

function delSinglesubuser(DelId)
{
	if(confirm("Are you sure to delete this?"))
	{
		jQuery.ajax({
		   type: "POST",
		   url: 'request_process.php?calling=8',
		   data: 'DelId='+DelId,
		   
		   success: function(msg)
		   {
			   jQuery('#outboxlist').html(msg);
			},
			error: function(){
				
			}
		 });
	}
}

//---------------------------------------------------------------//

function showeditsubusers(subcustomerid)
{
	jQuery.ajax({
	   type: "POST",
	   url: 'request_process.php?calling=9',
	   data: 'subcustomerid='+subcustomerid,
	   
	    success: function(msg)
	    {
		   jQuery('#addnewuserform').html(msg);
		   jQuery('#addnewuserform').show();
		},
		error: function(){
			
		}
	 });
}

//-----------------------------------------------------------------//

function go_search()
{
	var search_fname = document.getElementById("search_fname").value;
	var search_date_sent = document.getElementById("search_date_sent").value;
	var search_email = document.getElementById("search_email").value;
	
	jQuery.ajax({
	   type: "POST",
	   url: 'request_process.php?calling=10',
	   data: "action=go_search&search_email="+search_email+"&search_fname="+search_fname+"&search_date_sent="+search_date_sent,
	   
	    success: function(msg)
	    {
		   jQuery('#managedelivery').html(msg);
		},
		error: function(){
			
		}
	 });
}

//------------------------------------------------------------------//

function RunReport()
{
	var startdate = document.getElementById("startdate").value;
	var enddate = document.getElementById("enddate").value;
	
	jQuery.ajax({
	   type: "POST",
	   url: 'request_process.php?calling=11',
	   data: "action=runreport&startdate="+startdate+"&enddate="+enddate,
	   
	    success: function(msg)
	    {
		   jQuery('#viewreports').html(msg);
		},
		error: function(){
			
		}
	 });
	
}

//----------------------------------------------------------------//

function posttestimonial()
{
	jQuery('#addcontactform').unbind('submit');
		var options = {
		beforeSubmit: showposttestimonialRequest,
		success: showposttestimonialResponse,
		url: 'request_process.php?calling=12'
	};

	// bind to the form's submit event
	jQuery('#addcontactform').submit(function() {
		jQuery(this).ajaxSubmit(options);
		return false;
	});
}

// pre-submit callback
function showposttestimonialRequest(formData, jqForm, options)
{
	var queryString = jQuery.param(formData);
	return true;
}

function showposttestimonialResponse(responseText, statusText)
{
	var myarray=new Array();
    myarray=responseText.split("-SEPARATOR-");
	
	if(myarray[0] == 'done')
	{
		gotolink(myarray[1]);
	}
	else
	{
		jQuery('#errordiv').html(responseText);
		jQuery('#errordiv').show();
	}
}

//-----------------------------------------------------------------------//

function edituserform()
{
	jQuery('#addcontactform').unbind('submit');
		var options = {
		beforeSubmit: showedituserformRequest,
		success: showedituserformResponse,
		url: 'request_process.php?calling=13'
	};

	// bind to the form's submit event
	jQuery('#addcontactform').submit(function() {
		jQuery(this).ajaxSubmit(options);
		return false;
	});
}

// pre-submit callback
function showedituserformRequest(formData, jqForm, options)
{
	var queryString = jQuery.param(formData);
	return true;
}

function showedituserformResponse(responseText, statusText)
{
	var myarray=new Array();
    myarray = responseText.split("-SEPARATOR-");
	
	if(myarray[0] == 'done')
	{
		gotolink(myarray[1]);
	}
	else
	{
		jQuery('#errordiv').html(responseText);
		jQuery('#errordiv').show();
	}
}

//----------------------------------------------------------------------//

function renamedropbox_func()
{
	jQuery('#renamedropbox').unbind('submit');
		var options = {
		beforeSubmit: showerenamedropboxRequest,
		success: showerenamedropboxResponse,
		url: 'request_process.php?calling=14'
	};

	// bind to the form's submit event
	jQuery('#renamedropbox').submit(function() {
		jQuery(this).ajaxSubmit(options);
		return false;
	});
}

// pre-submit callback
function showerenamedropboxRequest(formData, jqForm, options)
{
	var queryString = jQuery.param(formData);
	return true;
}

function showerenamedropboxResponse(responseText, statusText)
{
	var myarray=new Array();
    myarray = responseText.split("-SEPARATOR-");
	
	if(myarray[0] == 'done')
	{
		gotolink(myarray[1]);
	}
	else
	{
		jQuery('#errordiv').html(responseText);
		jQuery('#errordiv').show();
	}
}

//----------------------------------------------------------------------//

function editemailfooter1()
{
	jQuery('#emailfooterform').unbind('submit');
		var options = {
		beforeSubmit: showeeditemailfooterRequest,
		success: showeeditemailfooterxResponse,
		url: 'request_process.php?calling=15'
	};

	// bind to the form's submit event
	jQuery('#emailfooterform').submit(function() {
		jQuery(this).ajaxSubmit(options);
		return false;
	});
}

// pre-submit callback
function showeeditemailfooterRequest(formData, jqForm, options)
{
	var queryString = jQuery.param(formData);
	return true;
}

function showeeditemailfooterxResponse(responseText, statusText)
{
	var myarray=new Array();
    myarray = responseText.split("-SEPARATOR-");
	
	if(myarray[0] == 'done')
	{
		gotolink(myarray[1]);
	}
	else
	{
		jQuery('#errordiv').html(responseText);
		jQuery('#errordiv').show();
	}
}

//----------------------------------------------------------------------//

function editwelcomemessage1()
{
	jQuery('#welcomemsgform').unbind('submit');
		var options = {
		beforeSubmit: showeditwelcomemessage1Request,
		success: showeditwelcomemessage1Response,
		url: 'request_process.php?calling=16'
	};

	// bind to the form's submit event
	jQuery('#welcomemsgform').submit(function() {
		jQuery(this).ajaxSubmit(options);
		return false;
	});
}

// pre-submit callback
function showeditwelcomemessage1Request(formData, jqForm, options)
{
	var queryString = jQuery.param(formData);
	return true;
}

function showeditwelcomemessage1Response(responseText, statusText)
{
	var myarray=new Array();
    myarray = responseText.split("-SEPARATOR-");
	
	if(myarray[0] == 'done')
	{
		gotolink(myarray[1]);
	}
	else
	{
		jQuery('#errordiv2').html(responseText);
		jQuery('#errordiv2').show();
	}
}

//-------------------------------------------------------------------------//

function registeruser_trial()
{
	jQuery('#orderform').unbind('submit');
		var options = {
		target: '#errordiv',
		beforeSubmit: showregister_trialRequest,
		success: showregisterr_trialResponse,
		url: 'request_process.php?calling=17'
	};

	jQuery('#orderform').submit(function() {
		jQuery(this).ajaxSubmit(options);
		return false;
	});
}

function showregister_trialRequest(formData, jqForm, options)
{
	var queryString = jQuery.param(formData);
	return true;
}

function showregisterr_trialResponse(responseText, statusText)
{
	var myarray=new Array();
    myarray=responseText.split("-SEPARATOR-");
	if(myarray[0] == 'done')
	{
		window.location.href="thanks.php";
	}
	else
	{
		jQuery('#errordiv').html(responseText);
		jQuery('#errordiv').show();
	}
}

//------------------------------------------------------//

function downloadfiles(ap, dropboxid, senddate, sessionid, tracking, returnrecipt, myrecipient)
{
	jQuery.ajax({
	   type: "POST",
	   url: 'request_process.php?calling=18',
	   data: "ap="+ap+"&dropboxid="+dropboxid+"&senddate="+senddate+"&sessionid="+sessionid+"&tracking="+tracking+"&returnrecipt="+returnrecipt+"&myrecipient="+myrecipient,
	   
	    success: function(msg)
	    {
		   jQuery('#downloadfilediv').html(msg);
		},
		error: function(){
			
		}
	 });
}

//-----------------------------------------------//
function closeforgotform()
{
	jQuery('#fusername').val('');
	jQuery('#response_forgotpass').html('');
	jQuery('#success_div2').hide();
	jQuery('#form_feedback2').show();
}

function forgotpassword1()
{
	jQuery('#forgotpassform').unbind('submit');
	  var options = {
		beforeSubmit: showforgotpassword1Request,
		success: showforgotpassword1Response,
		url: 'request_process.php?calling=19'
	};

	// bind to the form's submit event
	jQuery('#forgotpassform').submit(function() {
		jQuery(this).ajaxSubmit(options);
		return false;
	});
}

// pre-submit callback
function showforgotpassword1Request(formData, jqForm, options)
{
	var queryString = jQuery.param(formData);
	return true;
}

function showforgotpassword1Response(responseText, statusText)
{
	var myarray=new Array();
    myarray=responseText.split("-SEPARATOR-");
	
	if(myarray[0] == 'done')
	{
		jQuery('#success_div2').show();
		jQuery('#form_feedback2').hide();
		setTimeout('closeforgotform()', 1000);
	}
	else
	{
		jQuery('#response_forgotpass').html(responseText);
	}
}


/************* Getting total for all upgrade options *******************************/



 function showSelectedTotal()
 { 
 
    var id = "";
	if(document.getElementById('chek_1').checked == true){
		id += document.getElementById('chek_1').value + '@';}
	if(document.getElementById('chek_2').checked == true){
		id += document.getElementById('chek_2').value + '@';}
	if(document.getElementById('chek_3').checked == true){
		id += document.getElementById('chek_3').value + '@';}
	/*if(document.getElementById('chek_4').checked == true){
		id += document.getElementById('chek_4').value + '@';}*/
	if(document.getElementById('chek_5').checked == true){
		id += document.getElementById('chek_5').value + '@';}
	if(document.getElementById('chek_6').checked == true){
		id += document.getElementById('chek_6').value + '@';}
	if(document.getElementById('chek_7').checked == true){
		id += document.getElementById('chek_7').value + '@';}
	
	var url= 'process/total_values.php?ad_id='+id;
	postRequestTotals(url);
 } 
 
  function postRequestTotals(strURL)
{

	var xmlHttp;
	try
	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
	// Internet Explorer
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
		try
		{
		  	xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch (e)
		{
			alert("Your browser does not support AJAX!");
			 return false;
		}
	}
}

   		xmlHttp.open('POST', strURL, true);

    	xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');

   	 	xmlHttp.onreadystatechange = function() 
		{

			if (xmlHttp.readyState == 4) 
			{
	
				
				updatetotals(xmlHttp.responseText,"total_options");
	
			}

   		}

    xmlHttp.send(null);

}

function updatetotals(str,divId)
{
	  document.getElementById(divId).innerHTML =  str;
}
//-----------------------------------------------//
function loginuser1()
{
	
	jQuery('#feedback_new').unbind('submit');
		var options = {
		//target: '#dialogbox_div',
		
		beforeSend : function () {
			
		},
		
		beforeSubmit: showloginuserRequest1,
		success: showloginuserResponse1,
		url: 'request_process.php?calling=20'
	};

	// bind to the form's submit event
	jQuery('#feedback_new').submit(function() {
		jQuery(this).ajaxSubmit(options);
		return false;
	});
}

// pre-submit callback
function showloginuserRequest1(formData, jqForm, options)
{
	
	var queryString = jQuery.param(formData);
	return true;
}

function showloginuserResponse1(responseText, statusText)
{
	
	var myarray=new Array();
    myarray=responseText.split("-SEPARATOR-");
	if(myarray[0] == 'done')
	{
		jQuery('#response_username1').html('');
		jQuery('#response_password1').html('');
			
		jQuery('#dialogbox_div').hide();
		jQuery('#success_div3').show();
		jQuery('#form_feedback3').hide();
		setTimeout('gotolink(\''+myarray[1]+'\')', 1000);
	}
	else
	{
		if(responseText == "invalid")
		{
			jQuery('#msges1').show();
			jQuery('#response_username1').hide();
			jQuery('#response_password1').hide();
		}
		else if(responseText == "expire") {

				window.location="renewal.php"
		
		}else
		{
			
			var mycars = new Array();
			mycars=responseText.split("__SEPARATOR__");
			
			jQuery('#response_username1').html(mycars[1]);
			jQuery('#response_password1').html(mycars[2]);
			jQuery('#response_username1').show();
			jQuery('#response_password1').show();
			jQuery('#msges1').hide();
		}

	}
}
//--------------------------------------------------------------//

// user register //
function registeruser1()
{
	jQuery('#paylater_form').unbind('submit');
		var options = {
		target: '#errordiv',
		beforeSubmit: showregisterRequest1,
		success: showregisterrResponse1,
		url: 'request_process.php?calling=21'
	};

	jQuery('#paylater_form').submit(function() {
		jQuery(this).ajaxSubmit(options);
		return false;
	});
}

function showregisterRequest1(formData, jqForm, options)
{
	var queryString = jQuery.param(formData);
	return true;
}

function showregisterrResponse1(responseText, statusText)
{

	var myarray=new Array();
    myarray=responseText.split("-SEPARATOR-");
	
   	if(myarray[0] == 'done')
	{
		setTimeout('gotolink(\''+myarray[1]+'\')', 10);
	}
	else
	{
		jQuery('#errordiv').html(responseText);
		jQuery('#errordiv').show();
	}
}

//-----------------------------------------------//


//--------------------------------------------------------------//
function storeFileUploadInformation()
{
	
	jQuery('#F1Upload').unbind('submit');
	alert('ds');
		var options = {
		target: '#errordiv',
		beforeSubmit: showFileUploadInfoRequest,
		success: showFileUploadInfoResponse,
		url: 'request_process.php?calling=23'
	};

	jQuery('#F1Upload').submit(function() {
		jQuery(this).ajaxSubmit(options);
		return false;
	});
}

function showFileUploadInfoRequest(formData, jqForm, options)
{
	alert('nok');
	var queryString = jQuery.param(formData);
	return true;
}

function showFileUploadInfoResponse(responseText, statusText)
{
	alert('ok');

	var myarray=new Array();
    myarray=responseText.split("-SEPARATOR-");
	
   	if(myarray[0] == 'done')
	{
		setTimeout('gotolink(\''+myarray[1]+'\')', 10);
	}
	else
	{
		jQuery('#errordiv').html(responseText);
		jQuery('#errordiv').show();
	}
}
//-----------------------------------------------//



function userFileUploadInfo()
{
	
	showUpgradeOptions();
	return false;
	/*
	jQuery('#F1Upload').unbind('submit');
		var options = {
		beforeSubmit: showUserInfoRequest,
		success: showUserInfoResponse,
		url: 'request_process.php?calling=23'
	};

	jQuery('#F1Upload').submit(function() {
		jQuery(this).ajaxSubmit(options);
		return false;
	});*/
}

function showUserInfoRequest(formData, jqForm, options)
{
	var queryString = jQuery.param(formData);
	return true;
}

function showUserInfoResponse(responseText, statusText)
{
	var myarray=new Array();
	myarray=responseText.split("-SEPARATOR-");
	showUpgradeOptions(myarray[0]);

}




function getFileNames()
{
	
	submitForm2UploadFiles();
	/*
	//alert('aaaaaaa');
	//submitForm2UploadFiles();
	jQuery('#F1Upload').unbind('submit');
		var options = {
		beforeSubmit: showOptionsRequest,
		success: showOptionsResponse,
		url: 'request_process.php?calling=25'
	};

	jQuery('#F1Upload').submit(function() {
		jQuery(this).ajaxSubmit(options);
		return false;
	});*/
}

function showOptionsRequest(formData, jqForm, options)
{
	var queryString = jQuery.param(formData);
	return true;
}

function showOptionsResponse(responseText, statusText)
{
	var myarray=new Array();
    myarray=responseText.split("-SEPARATOR-");
	//alert(myarray[1]);
	
	submitForm2UploadFiles();
}
function otherpayment(id){
	window.location='myaccount.php?t=paymentlog&paymenttype='+id;
}
// Edit PayLater User //
function paylater_eidt()
{
	
	jQuery('#paylater_form_edit').unbind('submit');
		var options = {
		target: '#errordiv',
		beforeSubmit: showPaylaterRequest,
		success: showPaylaterResponse,
		url: 'request_process.php?calling=26'
	};

	jQuery('#paylater_form_edit').submit(function() {
		jQuery(this).ajaxSubmit(options);
		return false;
	});
}

function showPaylaterRequest(formData, jqForm, options)
{
	var queryString = jQuery.param(formData);
	return true;
}

function showPaylaterResponse(responseText, statusText)
{
	jQuery('#errordiv').html(responseText);
	jQuery('#errordiv').show();
}
// Edit PayLater User //
function paylater_change_password()
{
	
	jQuery('#paylater_form_password').unbind('submit');
		var options = {
		target: '#errordiv',
		beforeSubmit: showPaylaterRequest,
		success: showPaylaterResponse,
		url: 'request_process.php?calling=27'
	};

	jQuery('#paylater_form_password').submit(function() {
		jQuery(this).ajaxSubmit(options);
		return false;
	});
}

function showPaylaterRequest(formData, jqForm, options)
{
	var queryString = jQuery.param(formData);
	return true;
}

function showPaylaterResponse(responseText, statusText)
{
	jQuery('#errordiv').html(responseText);
	jQuery('#errordiv').show();
}

function textCounter(field,cntfield,maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else
cntfield.value = maxlimit - field.value.length;
}

function setbackground(id,class_value){
	
	document.getElementById(id).className = class_value;
	
}
function unsetbackground(id,class_value){
	
	document.getElementById(id).className = class_value;
	
}
function displayoption(displayid, blockid){
	document.getElementById(displayid).style.display = 'block';
	document.getElementById(blockid).style.display = 'none';	
}
function postRequestCard(strURL) 
{

	var xmlHttp;
	try
	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
	// Internet Explorer
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
		try
		{
		  	xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch (e)
		{
			alert("Your browser does not support AJAX!");
			 return false;
		}
	}
}

   		 xmlHttp.open('POST', strURL, true);

    	xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');

   	 	xmlHttp.onreadystatechange = function() 
		{
			if (xmlHttp.readyState == 4) 
			{
				if(xmlHttp.responseText=="ERROR"){
					document.getElementById('loading').style.display = 'none';
					document.getElementById('transcation').style.display = 'block';
				}else{
					
					window.location = 'upload-files.php';
				}
				
			}
   		}
    xmlHttp.send(null);
}
function payNowCard(){
		if(document.getElementById('cardno').value!=""){
			document.getElementById('loading').style.display = 'block';
			var cardno = document.getElementById('cardno').value;
			var url= 'process/processcard.php?cardno='+cardno;
			//alert(url);
			postRequestCard(url);
	}	
}

function registerfacebook_trial()
{
	

		jQuery('#orderform_id').unbind('submit');
		var options = {
		target: '#errordiv',
		beforeSubmit: showregister_facebookRequest,
		success: showregisterr_facebookResponse,
		url: 'request_process.php?calling=28'
	};

	jQuery('#orderform_id').submit(function() {
		jQuery(this).ajaxSubmit(options);
		return false;
	});
}

function showregister_facebookRequest(formData, jqForm, options)
{
	var queryString = jQuery.param(formData);

	return true;
}

function showregisterr_facebookResponse(responseText, statusText)
{
	var myarray=new Array();
    myarray=responseText.split("-SEPARATOR-");
	if(myarray[0] == 'done')
	{
		window.location.href="set.php";
	}
	else
	{
		jQuery('#errordiv').html(responseText);
		jQuery('#errordiv').show();
	}
}

function registerfacebook_trial_edit()
{
	jQuery('#orderform').unbind('submit');
		var options = {
		target: '#errordiv',
		beforeSubmit: showregister_facebookRequest1,
		success: showregisterr_facebookResponse1,
		url: 'request_process.php?calling=29'
	};

	jQuery('#orderform').submit(function() {
		jQuery(this).ajaxSubmit(options);
		return false;
	});
}

function showregister_facebookRequest1(formData, jqForm, options)
{
	var queryString = jQuery.param(formData);
	return true;
}

function showregisterr_facebookResponse1(responseText, statusText)
{
	var myarray=new Array();
    myarray=responseText.split("-SEPARATOR-");
	if(myarray[0] == 'done')
	{
		window.location.href="set.php";
	}
	else
	{
		jQuery('#errordiv').html(responseText);
		jQuery('#errordiv').show();
	}
}

