// JavaScript Document

function expandFirst() {
			document.getElementById(expandFirst.arguments[0]).style.display = "block";
			for (var i=1; i<expandFirst.arguments.length; i++) {
				document.getElementById(expandFirst.arguments[i]).style.display = "none";
			}
		}
function expandCollapse() {
	for (var i=0; i<expandCollapse.arguments.length; i++) {
		var element = document.getElementById(expandCollapse.arguments[i]);
		element.style.display = (element.style.display == "none") ? "block" : "none";
	}
}

//	elem1, value1, elem2, value2
function expandCollapseX()
{
//	for (var i=0; i<expandCollapseX.arguments.length; i++)
	//{
		//var element = document.getElementById(expandCollapseX.arguments[i]);
		//element.style.display = (element.style.display == "none") ? "block" : "none";
//	}
	var elem1 = document.getElementById(expandCollapseX.arguments[0]);
	var elem2 = document.getElementById(expandCollapseX.arguments[1]);
	var hidden = document.getElementById(expandCollapseX.arguments[0] + "_Display");
	
	if(elem1.style.display == "none")
	{
		elem1.style.display == "block"
		elem2.style.display == "none"
	}
	else
	{
		elem1.style.display == "none"
		elem2.style.display == "block"
	}
	
//	document.forms[0].action = "ControlList.aspx?switch=yes";
//	document.forms[0].submit();
}

function store_popfull(strPublicUrl)
{
	var winHdrs = window.open(strPublicUrl + "how_it_works/images/how_scanstore_full.gif", "Winscreenshots", "scrollbars=yes,resizable=yes,titlebar,width=800,height=600");
}

function forward_popfull(strPublicUrl)
{
	var winHdrs = window.open(strPublicUrl + "how_it_works/images/how_scanforward_full.gif", "Winscreenshots", "scrollbars=yes,resizable=yes,titlebar,width=800,height=600");
}

function store_pop(strPublicUrl)
{
	var winHdrs = window.open(strPublicUrl + "how_it_works/ss1.htm", "Winscreenshots", "scrollbars=no,resizable=no,titlebar,width=612,height=432");
}

function forward_pop(strPublicUrl)
{
	var winHdrs = window.open(strPublicUrl + "how_it_works/sf1.htm", "Winscreenshots", "scrollbars=no,resizable=no,titlebar,width=612,height=432");
}

function partnertypes_pop(strPublicUrl)
{
	var winHdrs = window.open(strPublicUrl + "partner_window.htm", "Winscreenshots", "scrollbars=no,resizable=no,titlebar,width=650,height=441");
}

function ShowTxt(txt) {
		if(document.getElementById) document.getElementById('how_desc').innerHTML = txt;
}

function ClearTxt() {
		if(document.getElementById) document.getElementById('how_desc').innerHTML = 'Choose a service type to view an illustration explaining how that service works.';
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function contactwindow(strPublicUrl)
{
	var winHdrs = window.open(strPublicUrl + "contact_window.asp", "Winscreenshots", "scrollbars=yes,resizable=no,titlebar,width=366,height=400");
}

function termswindow(strPublicUrl)
{
	var winHdrs = window.open(strPublicUrl + "terms_window.htm", "Winscreenshots", "scrollbars=yes,resizable=no,titlebar,width=366,height=400");
}

function privacywindow(strPublicUrl)
{
	var winHdrs = window.open(strPublicUrl + "privacy_window.htm", "Winscreenshots", "scrollbars=yes,resizable=no,titlebar,width=366,height=400");
}

function jump2form(){
	document.login.q.select();
	document.login.q.focus();
}

function Form_Set_Focus()
{
	document.forms[0].elements["UserName_TextBox"].focus();
}

function help(strPublicUrl)
{
	var winHdrs = window.open(strPublicUrl + "helpcenter.htm", "Winscreenshots", "scrollbars=yes,resizable=yes,titlebar,location,width=585,height=555");
}

function bp(strPublicUrl)
{
	var winHdrs = window.open(strPublicUrl + "helpcenter.htm#bp", "Winscreenshots", "scrollbars=yes,resizable=yes,titlebar,width=585,height=400");
}

function ab(strPublicUrl)
{
	var winHdrs = window.open(strPublicUrl + "helpcenter.htm#ab", "Winscreenshots", "scrollbars=yes,resizable=yes,titlebar,width=585,height=400");
}

function ab_2(strPublicUrl)
{
	var winHdrs = window.open(strPublicUrl + "helpcenter.htm#ab_2", "Winscreenshots", "scrollbars=yes,resizable=yes,titlebar,width=585,height=400");
}

function ds_1(strPublicUrl)
{
	var winHdrs = window.open(strPublicUrl + "helpcenter.htm#ds_1", "Winscreenshots", "scrollbars=yes,resizable=yes,titlebar,width=585,height=400");
}

function ds_2(strPublicUrl)
{
	var winHdrs = window.open(strPublicUrl + "helpcenter.htm#ds_2", "Winscreenshots", "scrollbars=yes,resizable=yes,titlebar,width=585,height=400");
}

function ds_3(strPublicUrl)
{
	var winHdrs = window.open(strPublicUrl + "helpcenter.htm#ds_3", "Winscreenshots", "scrollbars=yes,resizable=yes,titlebar,width=585,height=400");
}

function ds_4(strPublicUrl)
{
	var winHdrs = window.open(strPublicUrl + "helpcenter.htm#ds_4", "Winscreenshots", "scrollbars=yes,resizable=yes,titlebar,width=585,height=400");
}

function ds_5(strPublicUrl)
{
	var winHdrs = window.open(strPublicUrl + "helpcenter.htm#ds_5", "Winscreenshots", "scrollbars=yes,resizable=yes,titlebar,width=585,height=400");
}

function ds_6(strPublicUrl)
{
	var winHdrs = window.open(strPublicUrl + "helpcenter.htm#ds_6", "Winscreenshots", "scrollbars=yes,resizable=yes,titlebar,width=585,height=400");
}

function fp(strPublicUrl)
{
	var winHdrs = window.open(strPublicUrl + "helpcenter.htm#fp", "Winscreenshots", "scrollbars=yes,resizable=yes,titlebar,width=585,height=400");
}

function wc(strPublicUrl)
{
	var winHdrs = window.open(strPublicUrl + "helpcenter.htm#wc", "Winscreenshots", "scrollbars=yes,resizable=yes,titlebar,width=585,height=400");
}

function wc_4(strPublicUrl)
{
	var winHdrs = window.open(strPublicUrl + "helpcenter.htm#wc_4", "Winscreenshots", "scrollbars=yes,resizable=yes,titlebar,width=585,height=400");
}

function wc_5(strPublicUrl)
{
	var winHdrs = window.open(strPublicUrl + "helpcenter.htm#wc_5", "Winscreenshots", "scrollbars=yes,resizable=yes,titlebar,width=585,height=400");
}
function wc_7(strPublicUrl)
{
	var winHdrs = window.open(strPublicUrl + "helpcenter.htm#wc_7", "Winscreenshots", "scrollbars=yes,resizable=yes,titlebar,width=585,height=400");
}

function irwindow(strPublicUrl)
{
	var winHdrs = window.open(strPublicUrl + "partnerdesk/ir_window.htm", "Winscreenshots", "scrollbars=yes,resizable=no,titlebar,width=367,height=330");
}

function DeleteAllRows()
{
	for (var i=0;i<document.detail.length;i++)
	{
		var strField = document.detail[i].name;
		if( strField.indexOf('Delete_')!=-1 )
			document.detail.elements[strField].checked = document.detail.DeleteAll.checked;
		if(document.detail.DeleteAll.checked)
		{
			if( (strField.indexOf('Deliver_')!=-1) || (strField.indexOf('WL_')!=-1) )
				ClearRadios(document.detail.elements[strField]);
		}
	}
/*
	for(i=nFirst;i<=nSpam;i++)
	{
		var strDelete = 'Delete_' + i;
		document.detail.elements[strDelete].checked = document.detail.DeleteAll.checked;
		if(document.detail.elements[strDelete].checked) UncheckRadiobuttons(i);
	}
*/
}

function ClearForm()
{
	document.detail.DeleteAll.checked = false;
	for (var i=0;i<document.detail.length;i++)
	{
		var strField = document.detail[i].name;
		if( strField.indexOf('Delete_')!=-1 )
			document.detail.elements[strField].checked = false
		else if( (strField.indexOf('Deliver_')!=-1) || (strField.indexOf('WL_')!=-1) )
			ClearRadios(document.detail.elements[strField]);
	}
	return false;
}

function ClearDeleteButton(strField)
{
//	var strField = 'Delete_' + strId;
	document.detail.elements[strField].checked = false
}

function UncheckRadiobuttons(strId)
{
	var strField = 'Deliver_' + strId;
	ClearRadios(document.detail.elements[strField])
	strField = 'WL_Send_' + strId;
	ClearRadios(document.detail.elements[strField])
	strField = 'WL_Recip_' + strId;
	ClearRadios(document.detail.elements[strField])
//	document.detail.elements[strField].value = '';
}

function ClearRadios(radGroup)
{
   for (var i = 0; i < radGroup.length; i++)
   {
      radGroup[i].checked = false;
   }
}

function DefaultSettings()
{
	document.selections.SearchMethod.value = 0
	document.selections.SearchString.value = ''
	document.selections.SearchColumn.value = 'FromAddress'
	document.selections.action = "/user_spam_detail.asp?Submit=yes&PageNo=1";
	document.selections.submit();
}
/*
function ClearForm(nSpam, nFirst)
{
	document.detail.DeleteAll.checked = false;
	for(i=nFirst;i<=nSpam;i++)
	{
		ClearDeleteButton(i);
		UncheckRadiobuttons(i);
	}
}
*/
function ChangeLinesPerPage()
{
//	alert(x);
//	document.selections.action = "/user_spam_detail.asp?Submit=yes&PageNo=1&Username="+x;
	document.selections.submit();
}

function addresswindow(nDomainGroupId)
{
	var winHdrs = window.open("address_window.asp?nDomainGroupId=" + nDomainGroupId, "Winscreenshots", "scrollbars=yes,resizable=no,titlebar,width=368,height=400");
}