// JavaScript Document


var digits = "0123456789";
// non-digit characters which are allowed in phone numbers
var phoneNumberDelimiters = "()- ";
// characters which are allowed in international phone numbers
// (a leading + is OK)
var validWorldPhoneChars = phoneNumberDelimiters + "+";
// Minimum no of digits in an international phone no.
var minDigitsInIPhoneNumber = 10;

function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkInternationalPhone(strPhone){
s=stripCharsInBag(strPhone,validWorldPhoneChars);
return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}

function validateEmail(addr,man,db) {
	if (addr == '' && man) {
	   if (db) alert('Email address is mandatory');
	   return false;
	}
	var invalidChars = '\/\'\\ ";:?!()[]\{\}^|';
	for (i=0; i<invalidChars.length; i++) {
	   if (addr.indexOf(invalidChars.charAt(i),0) > -1) {
		  if (db) alert('Email address contains invalid characters');
		  return false;
	   }
	}
	for (i=0; i<addr.length; i++) {
	   if (addr.charCodeAt(i)>127) {
		  if (db) alert("Email address contains non ascii characters.");
		  return false;
	   }
	}
	var atPos = addr.indexOf('@',0);
	if (atPos == -1) {
	   if (db) alert('Email address must contain an @');
	   return false;
	}
	if (atPos == 0) {
	   if (db) alert('Email address must not start with @');
	   return false;
	}
	if (addr.indexOf('@', atPos + 1) > - 1) {
	   if (db) alert('Email address must contain only one @');
	   return false;
	}
	if (addr.indexOf('.', atPos) == -1) {
	   if (db) alert('Email address must contain a period in the domain name');
	   return false;
	}
	if (addr.indexOf('@.',0) != -1) {
	   if (db) alert('period must not immediately follow @ in email address');
	   return false;
	}
	if (addr.indexOf('.@',0) != -1){
	   if (db) alert('period must not immediately precede @ in email address');
	   return false;
	}
	if (addr.indexOf('..',0) != -1) {
	   if (db) alert('two periods must not be adjacent in email address');
	   return false;
	}
	var suffix = addr.substring(addr.lastIndexOf('.')+1);
	if (suffix.length != 2 && suffix != 'com' && suffix != 'net' && suffix != 'org' && suffix != 'edu' && suffix != 'int' && suffix != 'mil' && suffix != 'gov' & suffix != 'arpa' && suffix != 'biz' && suffix != 'aero' && suffix != 'name' && suffix != 'coop' && suffix != 'info' && suffix != 'pro' && suffix != 'museum') {
	   if (db) alert('invalid primary domain in email address');
	   return false;
	}
return true;
}







  function confirmMsg(msg){
	if(!confirm(msg)){
		return false;
	} else {
		return true;
	}
}



function confirmMsg_delete(msg,a1,v1){
	  
	if(!confirm(msg)){
		return false;
	} else {
		//return true;
		gotodel_goal(a1,v1);
		
	}
}

function confirmMsg_delete1(msg,a1,v1){
	  
	if(!confirm(msg)){
		return false;
	} else {
		//return true;
		gotodel(a1,v1);
		
	}
}


function poplinks(url)
{
	newwindow=window.open(url,'View','height=400,width=600,left=0,top=0,resizable=yes,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
}


function login_validate()

{

	     var txtusername = document.login.txtusername.value;

		 if (txtusername == "" )

		 { 

			 alert ("Please enter Your Username");

			 document.login.txtusername.focus();

			 return false;

		 }

		 var txtpassword = document.login.txtpassword.value;

		 if (txtpassword == "" )

		 { 

			 alert ("Please enter Your Password");

			 document.login.txtpassword.focus();

			 return false;

		 }	

		 

}

function generalsetting_validate()
{   

     	if (document.frm_general.txt_website.value == "") 
		{
			alert ("Please Enter the Website URL.");
			document.frm_general.txt_website.focus();
			return false;
		}

	
   	 var txt_numrows = document.frm_general.txt_numrows.value;
	 if (txt_numrows == "")
	 { 
		 alert ("Please enter the No Of Rows ");
		 document.frm_general.txt_numrows.focus();
		 return false;
	 }	

	 if(isNaN(txt_numrows) || txt_numrows == 0 || txt_numrows.indexOf('.') >= 0 || txt_numrows.indexOf('-') >= 0 ){
		alert("Rows must be a number");
		document.frm_general.txt_numrows.focus();
		return false;

}
	if (document.frm_general.title.value == "") {
		alert ("Please enter the Page Title.");
		document.frm_general.title.focus();
		return false;
	}	
}

function myprofile_validate()
{

   			if (document.frm_myprofile.txt_contactperson.value== "" )
			{ 
			 alert ("Please enter the Person");
			 document.frm_myprofile.txt_contactperson.focus();
			 return false;
   			 }

			var txt_email = document.frm_myprofile.txt_email.value;
	 		if (txt_email == "")
			{ 
			 alert ("Please enter the Email Address");
			 document.frm_myprofile.txt_email.focus();
			 return false;
	 		}

			
			if (!validateEmail(document.frm_myprofile.txt_email.value,1,1)) 
	 		{
			 document.frm_myprofile.txt_email.focus();
			 return false;
	 		}

	 
			 var txt_phone = document.frm_myprofile.txt_phone.value;
			 if (txt_phone == "")
			 { 
				 alert ("Please enter the Business Phone Number");
				 document.frm_myprofile.txt_phone.focus();
				 return false;
			 }

			phone1 = document.frm_myprofile.txt_phone;
					if (checkInternationalPhone(phone1.value)==false){
						alert("Please Enter a Valid Phone Number")
						phone1.value=""
						phone1.focus()
						return false
					}	

			 var txt_username = document.frm_myprofile.txt_username.value;
					 if (txt_username == "" )
					 { 
						alert ("Please enter Your Username");
						document.frm_myprofile.txt_username.focus();
						return false;
					 }

			 var txt_password = document.frm_myprofile.txt_password.value;
				 if (txt_password == "" )
				 { 
					 alert ("Please enter Your Password");
					 document.frm_myprofile.txt_password.focus();
					 return false;
				 }	

}

function mailsetting_validate() {

	if(document.frm_mailsettings.txt_subject.value == "") {

		alert("Enter Subject");

		document.frm_mailsettings.txt_subject.focus();

		return false;

	}



}

function TeamValidation()
{
   			if (document.frm_team.teamname.value== "" )
			{ 
			 alert ("Please select the Team Name");
			 document.frm_team.teamname.focus();
			 return false;
   			 }
			 
			  if (document.frm_team.leadername.value== "" )
			{ 
			 alert ("Please enter the Leader Name");
			 document.frm_team.leadername.focus();
			 return false;
   			 }
			var txt_email = document.frm_team.email.value;
	 		if (txt_email == "")
			 { 
			 alert ("Please enter the Email Address");
			 document.frm_team.email.focus();
			 return false;
	 		}
			
			if (!validateEmail(document.frm_team.email.value,1,1)) 
	 		{
			 document.frm_team.email.focus();
			 return false;
	 		}

			var txt_phone = document.frm_team.txt_phone.value;
	 		if (txt_phone == "")
			 { 
			 alert ("Please enter the Office Number");
			 document.frm_team.txt_phone.focus();
			 return false;
	 		}
			if(isNaN(document.frm_team.txt_phone.value)) {
				alert("Phone numbers  must be a numeric value.");
				document.frm_team.txt_phone.focus();
				return false;
				
			}
			var txt_email = document.frm_team.txt_cell.value;
	 		if (txt_email == "")
			 { 
			 alert ("Please enter the Cell Number");
			 document.frm_team.txt_cell.focus();
			 return false;
	 		}
			if(isNaN(document.frm_team.txt_cell.value)) {
				alert("Cell numbers  must be a numeric value.");
				document.frm_team.txt_cell.focus();
				return false;
				
			}
			
			var mm = document.frm_team.mm.value;
	 		if (mm == "")
			 { 
			 alert ("Please select the Month");
			 document.frm_team.mm.focus();
			 return false;
	 		}
			var yy = document.frm_team.yy.value;
	 		if (yy == "")
			 { 
			 alert ("Please select the year");
			 document.frm_team.yy.focus();
			 return false;
	 		}
			
			
			
			 var txt_username = document.frm_team.username.value;
					 if (txt_username == "" )
					 { 
						 alert ("Please enter Your Username");
						 document.frm_team.username.focus();
						 return false;
							 }
				  var txt_password = document.frm_team.password.value;
				 if (txt_password == "" )
				 { 
					 alert ("Please enter Your Password");
					 document.frm_team.password.focus();
					 return false;
				 }	
}




function MemberValidation()
{
   			if (document.frm_team.teamname.value== "" )
			{ 
			 alert ("Please select the Team Name");
			 document.frm_team.teamname.focus();
			 return false;
   			 }
			 
			  if (document.frm_team.membername.value== "" )
			{ 
			 alert ("Please enter the Member Name");
			 document.frm_team.membername.focus();
			 return false;
   			 }
			var txt_email = document.frm_team.email.value;
	 		if (txt_email == "")
			 { 
			 alert ("Please enter the Email Address");
			 document.frm_team.email.focus();
			 return false;
	 		}
			
			if (!validateEmail(document.frm_team.email.value,1,1)) 
	 		{
			 document.frm_team.email.focus();
			 return false;
	 		}

			var txt_phone = document.frm_team.txt_phone.value;
	 		if (txt_phone == "")
			 { 
			 alert ("Please enter the Office Number");
			 document.frm_team.txt_phone.focus();
			 return false;
	 		}
			if(isNaN(document.frm_team.txt_phone.value)) {
				alert("Phone numbers  must be a numeric value.");
				document.frm_team.txt_phone.focus();
				return false;
				
			}
			var txt_email = document.frm_team.txt_cell.value;
	 		if (txt_email == "")
			 { 
			 alert ("Please enter the Cell Number");
			 document.frm_team.txt_cell.focus();
			 return false;
	 		}
			if(isNaN(document.frm_team.txt_cell.value)) {
				alert("Cell numbers  must be a numeric value.");
				document.frm_team.txt_cell.focus();
				return false;
				
			}
			
			 var txt_username = document.frm_team.username.value;
					 if (txt_username == "" )
					 { 
						 alert ("Please enter Your Username");
						 document.frm_team.username.focus();
						 return false;
							 }
				  var txt_password = document.frm_team.password.value;
				 if (txt_password == "" )
				 { 
					 alert ("Please enter Your Password");
					 document.frm_team.password.focus();
					 return false;
				 }	
}

function ObserverValidation()
{
			  if (document.frm_team.membername.value== "" )
			{ 
			 alert ("Please enter the Observer Name");
			 document.frm_team.membername.focus();
			 return false;
   			 }
			var txt_email = document.frm_team.email.value;
	 		if (txt_email == "")
			 { 
			 alert ("Please enter the Email Address");
			 document.frm_team.email.focus();
			 return false;
	 		}

			var txt_phone = document.frm_team.txt_phone.value;
	 		if (txt_phone == "")
			 { 
			 alert ("Please enter the Office Number");
			 document.frm_team.txt_phone.focus();
			 return false;
	 		}
			if(isNaN(document.frm_team.txt_phone.value)) {
				alert("Phone numbers  must be a numeric value.");
				document.frm_team.txt_phone.focus();
				return false;
				
			}
			var txt_email = document.frm_team.txt_cell.value;
	 		if (txt_email == "")
			 { 
			 alert ("Please enter the Cell Number");
			 document.frm_team.txt_cell.focus();
			 return false;
	 		}
			if(isNaN(document.frm_team.txt_cell.value)) {
				alert("Cell numbers  must be a numeric value.");
				document.frm_team.txt_cell.focus();
				return false;
				
			}
			
			
			
txtGender="";
		 txtGenderLength = document.frm_team.displaymenu.length;
		 var i=0;
		if(txtGenderLength > 1){
			for(GenIndex = 0; GenIndex < txtGenderLength; GenIndex++ ){
				if(document.frm_team.displaymenu[GenIndex].checked == false){
					i=i+1;
				}
			}
		}
		if(i==txtGenderLength)
		{
			alert("Please select the team Name");
			return false;
		}
					
			
			if (!validateEmail(document.frm_team.email.value,1,1)) 
	 		{
			 document.frm_team.email.focus();
			 return false;
	 		}
			
			 var txt_username = document.frm_team.username.value;
					 if (txt_username == "" )
					 { 
						 alert ("Please enter Your Username");
						 document.frm_team.username.focus();
						 return false;
							 }
				  var txt_password = document.frm_team.password.value;
				 if (txt_password == "" )
				 { 
					 alert ("Please enter Your Password");
					 document.frm_team.password.focus();
					 return false;
				 }	
}

function MemberValidation1()
{
   						 
			  if (document.frm_team.membername.value== "" )
			{ 
			 alert ("Please enter the Member Name");
			 document.frm_team.membername.focus();
			 return false;
   			 }
			var txt_email = document.frm_team.email.value;
	 		if (txt_email == "")
			 { 
			 alert ("Please enter the Email Address");
			 document.frm_team.email.focus();
			 return false;
	 		}
			
			if (!validateEmail(document.frm_team.email.value,1,1)) 
	 		{
			 document.frm_team.email.focus();
			 return false;
	 		}

			var txt_phone = document.frm_team.txt_phone.value;
	 		if (txt_phone == "")
			 { 
			 alert ("Please enter the Office Number");
			 document.frm_team.txt_phone.focus();
			 return false;
	 		}
			if(isNaN(document.frm_team.txt_phone.value)) {
				alert("Phone numbers  must be a numeric value.");
				document.frm_team.txt_phone.focus();
				return false;
				
			}
			var txt_email = document.frm_team.txt_cell.value;
	 		if (txt_email == "")
			 { 
			 alert ("Please enter the Cell Number");
			 document.frm_team.txt_cell.focus();
			 return false;
	 		}
			if(isNaN(document.frm_team.txt_cell.value)) {
				alert("Cell numbers  must be a numeric value.");
				document.frm_team.txt_cell.focus();
				return false;
			}
			
			
			 var txt_username = document.frm_team.username.value;
					 if (txt_username == "" )
					 { 
						 alert ("Please enter Your Username");
						 document.frm_team.username.focus();
						 return false;
							 }
				  var txt_password = document.frm_team.password.value;
				 if (txt_password == "" )
				 { 
					 alert ("Please enter Your Password");
					 document.frm_team.password.focus();
					 return false;
				 }	
}

function PromiseValidation() {
	
	totalGoals = document.frm_promise.totalGoals.value;
	
	for(j=1;j<=totalGoals;j++) {
		getgoalIdNo = 'GlCnt'+j;
		
		getgoalid = document.frm_promise.elements[getgoalIdNo].value;
		Nupload = 'NumberOfUploads'+getgoalid;
				

		tocnt =document.frm_promise.elements[Nupload].value;
		
		for(i=1;i<=tocnt;i++) {
		prval = 'promise'+getgoalid+'_'+i;
		scrval = 'score'+getgoalid+'_'+i;
		
		if(document.frm_promise.elements[prval].value == "")		 {
			alert("Enter Promise");
			document.frm_promise.elements[prval].focus();
			return false;
		}
		if(document.frm_promise.elements[scrval].value != "")		 {
			
			if(isNaN(document.frm_promise.elements[scrval].value)) {
				alert("Enter numbers in the score field");
				document.frm_promise.elements[scrval].focus();
				return false;
				
			}
			if(document.frm_promise.elements[scrval].value > 100) {
				alert("Enter your score percentage with in 100");
				document.frm_promise.elements[scrval].focus();
				return false;
				
			}
			
		}
		
		

	}
		
		
		
	}
		//document.frm_team.cmd_Submit.value='qq';
	document.frm_promise.action='index.php?task=addpromiseaction';
	document.frm_team.submit();

	
	
	
	

}

function GoalValidation() {

/*	tocnt = document.frm_goal.NumberOfUploads.value;
	
	if(document.frm_goal.focus_promise.value == "")		 {
			alert("Enter Focus ");
			document.frm_goal.focus_promise.focus();
			return false;
		}
	
	
	for(i=1;i<=tocnt;i++) {
		prval = 'promise'+i;
		scrval = 'score'+i;
		
		if(document.frm_goal.elements[prval].value == "")		 {
			alert("Enter Goal");
			document.frm_goal.elements[prval].focus();
			return false;
		}
		
		

	}
*/	//document.frm_team.cmd_Submit.value='qq';
	document.frm_promise.action='index.php?task=addgoalaction';
	document.frm_promise.submit();
	

}


function goto(arg) {
	if(arg == 'month') {
				window.location.href="index.php?task=monthlyreport";

	} else {
		window.location.href="index.php?task=yearlyreport";
	}
}

/*function goalgetdt(arg) {
	document.getElementById('dispdt').innerHTML='Add Promise for '+arg;
	window.location.href="index.php?task=addgoal&pass="+arg;
 
}
*/
function getdt(arg) {
	document.getElementById('dispdt').innerHTML='Add Promise for '+arg;
	window.location.href="index.php?task=addpromise&pass="+arg;
 
}

function getdt_goal(arg) {
	//document.getElementById('dispdt').innerHTML='Add Goals for '+arg;
	window.location.href="index.php?task=addgoal&pass="+arg;
 
}

function goalgetdt(arg) {
	//aa = document.frm_goal.Todt.value;
	window.location.href="index.php?task=addgoal&pass="+arg;
 
}

function getdt1(arg) {
	//document.getElementById('dispdt').innerHTML='View Promise for '+arg;
	window.location.href="index.php?task=monthlyreport&pass="+arg;
 
}
function getdt2(arg) {
	aa = document.disply.memid.value;
	window.location.href="index.php?task=viewpromise&pass="+arg+"&mid="+aa;
 
}

function gotoPro(arg) {
	aa = document.disply.Todt.value;
	window.location.href="index.php?task=viewpromise&pass="+aa+"&mid="+arg;
 
}



function getdt3(arg) {
	aa = document.disply.memid.value;
	window.location.href="index.php?task=monthlyreport&pass="+arg+"&mid="+aa;
 
}

function gotoPro3(arg) {
	aa = document.disply.Todt.value;
	window.location.href="index.php?task=monthlyreport&pass="+aa+"&mid="+arg;
 
}


function gotoPro4(arg) {
	aa = document.disply.Todt.value;
	window.location.href="index.php?task=monthlyreport&pass="+aa+"&mid="+arg;
 
}




function gotodel(a1,v1) {

	pass = document.frm_promise.Todt.value;
	countyid = '';
	
	if(document.frm_promise.delpromise.length > 1) {
		for(var k = 0; k < document.frm_promise.delpromise.length; k++)	{
			if(document.frm_promise.delpromise[k].checked){
				cval = document.frm_promise.delpromise[k].value;
				countyid1 = cval ;	
				countyid  = countyid1+','+countyid;
						
			}
			
		}
	} else {
		cval = document.frm_promise.delpromise.value;
		countyid1 = cval ;	
		countyid  = countyid1+','+countyid;
	
	
	}
	
	if(a1 != '') {
		window.location.href='index.php?task=addpromise&pass='+pass+'&del='+countyid+'&'+a1+'='+v1;
	} else {
		window.location.href='index.php?task=addpromise&pass='+pass+'&del='+countyid;
	}
		
}

function gotodel_goal(a1,v1) {

	
	countyid = '';
	//pass = document.frm_goal.Todt.value;
	
	if(document.frm_goal.delgoal.length > 1) {
		for(var k = 0; k < document.frm_goal.delgoal.length; k++)	{
			if(document.frm_goal.delgoal[k].checked){
				cval = document.frm_goal.delgoal[k].value;
				//alert(cval);
				countyid1 = cval ;	
				countyid  = countyid1+','+countyid;
						
			}
			
		}
	} else {
		cval = document.frm_goal.delgoal.value;
		countyid1 = cval ;	
		countyid  = countyid1+','+countyid;
	
	
	}
	
	if(a1 != '') {
		window.location.href='index.php?task=addgoal&del='+countyid+'&'+a1+'='+v1;
	} else {
		window.location.href='index.php?task=addgoal&del='+countyid;
	}
		
}



function PromiseValidation1() {
	
	

	
	totalGoals = document.frm_promise.totalGoals.value;
	
	for(j=1;j<=totalGoals;j++) {
		getgoalIdNo = 'GlCnt'+j;
		
		getgoalid = document.frm_promise.elements[getgoalIdNo].value;
		Nupload = 'NumberOfUploads'+getgoalid;
				

		tocnt =document.frm_promise.elements[Nupload].value;
		
		for(i=1;i<=tocnt;i++) {
		prval = 'promise'+getgoalid+'_'+i;
		scrval = 'score'+getgoalid+'_'+i;
		
		if(document.frm_promise.elements[prval].value == "")		 {
			alert("Enter Promise");
			document.frm_promise.elements[prval].focus();
			return false;
		}
		if(document.frm_promise.elements[scrval].value != "")		 {
			
			if(isNaN(document.frm_promise.elements[scrval].value)) {
				alert("Enter numbers in the score field");
				document.frm_promise.elements[scrval].focus();
				return false;
				
			}
			if(document.frm_promise.elements[scrval].value > 100) {
				alert("Enter your score percentage with in 100");
				document.frm_promise.elements[scrval].focus();
				return false;
				
			}
			
		}
		
		

	}
		
		
		
	}

	document.frm_promise.action='index.php?task=addcalculateaction';
	//alert(document.frm_team.action);
	document.frm_team.submit();
	

}
function GoalValidation1() {

	tocnt = document.frm_team.NumberOfUploads.value;
	
	for(i=1;i<=tocnt;i++) {
		prval = 'promise'+i;
		scrval = 'score'+i;
		
		if(document.frm_team.elements[prval].value == "")		 {
			alert("Enter Goal");
			document.frm_team.elements[prval].focus();
			return false;
		}
		if(document.frm_team.elements[scrval].value != "")		 {
			
			if(isNaN(document.frm_team.elements[scrval].value)) {
				alert("Enter numbers in the score field");
				document.frm_team.elements[scrval].focus();
				return false;
				
			}
			if(document.frm_team.elements[scrval].value > 100) {
				alert("Enter your score percentage with in 100");
				document.frm_team.elements[scrval].focus();
				return false;
				
			}
			
		}
		
		

	}
	//document.frm_team.cmd_Submit.value='qq';
	document.frm_team.action='index.php?task=addgoalcalculateaction';
	//alert(document.frm_team.action);
	document.frm_team.submit();
	

}
function gototeam(arg) {
	
	window.location.href='index.php?task=monthlyreport&tid='+arg	;
}

function gotorep(arg) {
	
	window.location.href='index.php?task=report&tid='+arg	;
}

function poplinks(url)
{
	newwindow=window.open(url,'ImageDisplay','height=400,width=600,left=0,top=0,resizable=yes,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
}



function getdt_mon(arg) {
	aa = document.disply.memid.value;
	window.location.href="index.php?task=monthlyreport&pass="+arg+"&mid="+aa;
 
}

function gotoPro_mon(arg) {
	aa = document.disply.Todt.value;
	window.location.href="index.php?task=monthlyreport&pass="+aa+"&mid="+arg;
 
}

function getdt1_mon(arg) {
	aa = document.disply.memid.value;
	window.location.href="index.php?task=addpromise&pass="+arg+"&mid="+aa;
 
}

function gotoPro1_mon(arg) {
	aa = document.disply.Todt.value;
	window.location.href="index.php?task=addpromise&pass="+aa+"&mid="+arg;
 
}



function getdt_mon1(arg) {
	aa = document.frm_team.intGoalId.value;
	window.location.href="index.php?task=addpromise&pass="+arg+"&GoalId="+aa;
 
}


function gotoGoal_mon(arg) {
	aa = document.frm_team.Todt.value;
	window.location.href="index.php?task=addpromise&pass="+aa+"&GoalId="+arg;
 
}






/*function gotoGoal_mon(arg) {
	aa = document.disply.Todt.value;
	window.location.href="index.php?task=addpromise&pass="+aa+"&GoalId="+arg;
 
}*/

function getothermember(arg1) {
	dt = document.frm_promise.Todt.value;
	//document.getElementById('dispdt').innerHTML='Add Promise for '+dt;
	window.location.href="index.php?task=addpromise&pass="+dt+"&othmem="+arg1;
 
}
