// Form submit

function login() {
    document.login_inline	.submit();
}

// functions related to image swapping
function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

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_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_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];} 
}

//pasted from master page

function WM_netscapeCssFix() {
  /*
    Source: Webmonkey Code Library
    (http://www.hotwired.com/webmonkey/javascript/code_library/)
    Author: Taylor
    Author Email: taylor@wired.com
    Author URL: http://www.taylor.org/
    */
  // This part was inspired by Matthew_Baird@wayfarer.com
  if (document.WM.WM_netscapeCssFix.initWindowWidth != window.innerWidth || document.WM.WM_netscapeCssFix.initWindowHeight != window.innerHeight) {
    document.location = document.location;
  }
}

function WM_netscapeCssFixCheckIn() {
  if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 4)) {
    if (typeof document.WM == 'undefined'){
      document.WM = new Object;
    }
    if (typeof document.WM.WM_scaleFont == 'undefined') {
      document.WM.WM_netscapeCssFix = new Object;
      document.WM.WM_netscapeCssFix.initWindowWidth = window.innerWidth;
      document.WM.WM_netscapeCssFix.initWindowHeight = window.innerHeight;
    }
    window.onresize = WM_netscapeCssFix;
  }
}
WM_netscapeCssFixCheckIn()


function newWindow(url, nameW, height, width) {
	options = "scrollbars=0,resizable=0,menubar=0,toolbar=0,status=1,location=0,directories=0";
	var myWin = "";
	var nameW = "";
	myWin = window.open(url, nameW, 'height='+height+',width='+width+','+options+',left=150,top=100');
	myWin.focus();
}

function checkEbookForm() {
	var myWin = "";
	var nameW = "";
	var tempCounter = 1;

	if ((document.ebookDL.ebook.length < 1) || (document.ebookDL.ebook.length == 'undefined'))
		return false;
	else
		if (!document.ebookDL.ebook.length)
			return false;
		else
			for (i=0; i < document.ebookDL.ebook.length; ++ i) {
				if (document.ebookDL.ebook[i].checked) {
					if ((document.ebookDL.portid == null) || (document.ebookDL.portid == 'undefined')) {
						myWin = window.open("sendfile.asp?fileid=" + document.ebookDL.ebook[i].value, nameW, "height=0,width=0");
						myWin.focus();
					}
					else {
						myWin = window.open("sendfile.asp?fileid=" + document.ebookDL.ebook[i].value + "&portid=" + document.ebookDL.portid.value, nameW, "height=0,width=0");
						myWin.focus();
					}
				}
			}
		return true;
}

function checkDueDiligenceForm() {
	var myWin = "";
	var nameW = "";

	if ((document.duediligenceDL.duediligence.length < 1) || (document.duediligenceDL.duediligence.length == 'undefined'))
		return false;
	else
		if (!document.duediligenceDL.duediligence.length)
			return false;
		else
			for (i=0; i < document.duediligenceDL.duediligence.length; ++ i) {
				if (document.duediligenceDL.duediligence[i].checked) {
					if ((document.duediligenceDL.portid == null) || (document.duediligenceDL.portid == 'undefined')) {
						myWin = window.open("sendfile.asp?fileid=" + document.duediligenceDL.duediligence[i].value, nameW, "height=0,width=0");
						myWin.focus();
					}
					else {
						myWin = window.open("sendfile.asp?fileid=" + document.duediligenceDL.duediligence[i].value + "&portid=" + document.duediligenceDL.portid.value, nameW, "height=0,width=0");
						myWin.focus();
					}
				}
			}
		return true;
}
function checkClientCenterForm() {
	var myWin = "";
	var nameW = "";
	if ((document.clientcenterDL.clientcenter.length < 1) || (document.clientcenterDL.clientcenter.length == 'undefined'))
		return false;
	else
		if (!document.clientcenterDL.clientcenter.length)
			return false;
		else
			for (i=0; i < document.clientcenterDL.clientcenter.length; ++ i) {
				if (document.clientcenterDL.clientcenter[i].checked) {
					if ((document.clientcenterDL.portid == null) || (document.clientcenterDL.portid == 'undefined')) {
						myWin = window.open("sendfile.asp?fileid=" + document.clientcenterDL.clientcenter[i].value, nameW, "height=0,width=0");
						myWin.focus();
					}
					else {
						myWin = window.open("sendfile.asp?fileid=" + document.clientcenterDL.clientcenter[i].value + "&portid=" + document.clientcenterDL.portid.value, nameW, "height=0,width=0");
						myWin.focus();
					}
				}
			}
		return true;
}

