var slider = 0;
var currentContent = 0;

function change_menu_item(cell, color, image, newImage)
{
	if (document.layers)
	{
		cell.backgroundColor = color;
		changeImages(image, newImage);
	}
	else if (document.all)
	{
		document.getElementById(cell).style.backgroundColor = color;
		changeImages(image, newImage);
	}
	else if (document.getElementById && !document.all)
	{
		document.getElementById(cell).style.backgroundColor = color;
		changeImages(image, newImage);
	}


	if (change_menu_item.arguments.length > 4)
	{
		window.status = change_menu_item.arguments[4];
	}
	else
	{
		window.status = '';
	}
}

function changeImages(image, newImage)
{
	if (document.images)
	{
		for (var i = 0; i < changeImages.arguments.length; i += 2)
		{
			document.images[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

function rotateContent()
{
	showContent("content" + currentContent);
	currentContent = (currentContent + 1) % 2;
	hideContent("content" + currentContent);
	setTimeout("rotateContent()", 8000)
}

function showContent(content)
{
	for (var i = 0; i < showContent.arguments.length; i++)
	{
		if (document.all)
		{
			var temp = document.getElementById(showContent.arguments[i]);
			temp.style.position = 'relative';
			temp.style.visibility = 'visible';
		}
		else if (document.getElementById && !document.all)
		{
			var temp = document.getElementById(showContent.arguments[i]);
			temp.style.position = 'relative';
			temp.style.visibility = 'visible';
		}
		else if (document.layers)
		{
			var temp = document[showContent.arguments[i]];
			temp.position = 'relative';
			temp.visibility = 'show';
		}
	}
}

function hideContent(content)
{
	for (var i = 0; i < hideContent.arguments.length; i++)
	{
		if (document.layers)
		{
			var temp = document[hideContent.arguments[i]];
			temp.position = 'absolute';
			temp.visibility = 'hide';

		}
		else if (document.all)
		{
			var temp = document.getElementById(hideContent.arguments[i]);
			temp.style.position = 'absolute';
			temp.style.visibility = 'hidden';
		}
		else if (document.getElementById && !document.all)
		{
			var temp = document.getElementById(hideContent.arguments[i]);
			temp.style.position = 'absolute';
			temp.style.visibility = 'hidden';
		}
	}
}

function clickInterestArea(title, checkbox)
{
		if (document.all)
		{
			var temp = document.getElementById(hideContent.arguments[i]);
			temp.style.position = 'absolute';
			temp.style.visibility = 'hidden';
		}
		else if (document.layers)
		{
			var temp = document[hideContent.arguments[i]];
			temp.position = 'absolute';
			temp.visibility = 'hide';

		}		
}

// Check that an email address is valid based on RFC 821 (?)
function isValidEmail(address) {
   if (address != '' && address.search) {
      if (address.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1) return true;
      else return false;
   }
	
   // allow empty strings to return true - screen these with either a 'required' test or a 'length' test
   else return true;
}

// Check that an email address has the form something@something.something
// This is a stricter standard than RFC 821 (?) which allows addresses like postmaster@localhost
function isValidEmailStrict(address) {
	if (isValidEmail(address) == false) return false;
	var domain = address.substring(address.indexOf('@') + 1);
	if (domain.indexOf('.') == -1) return false;
	if (domain.indexOf('.') == 0 || domain.indexOf('.') == domain.length - 1) return false;
	return true;
}

function submitSupportForm()
{
	var name = document.getElementsByName("Name")[0];
	var company = document.getElementsByName("Company")[0];;
	var email = document.getElementsByName("Email")[0];
	var telephone = document.getElementsByName("Telephone")[0];

	if (name.value == "")
	{
		alert("Please enter your Name.");
		name.focus();
	}
	else if (company.value == "")
	{
		alert("Please enter your Company Name.");
		company.focus();
	}
	else if ((email.value =="") || (!isValidEmailStrict(email.value)))
	{
		alert("Please enter a valid e-mail address.");
		email.focus();
	}
	else if (telephone.value == "")
	{
		alert("Please enter your telephone number.");
		telephone.focus();
	}
	else
	{
		email.form.submit();
	}
}

function submitEMRDownloadForm()
{
	var name = document.getElementsByName("realname")[0];
	var company = document.getElementsByName("company")[0];;
	var email = document.getElementsByName("email")[0];
	var telephone = document.getElementsByName("telephone")[0];
	var country = document.getElementsByName("country")[0];

	if (name.value == "")
	{
		alert("Please enter your Name.");
		name.focus();
	}
	else if (company.value == "")
	{
		alert("Please enter your Company Name.");
		company.focus();
	}
	else if ((email.value =="") || (!isValidEmailStrict(email.value)))
	{
		alert("Please enter a valid e-mail address.");
		email.focus();
	}
	else if (telephone.value == "")
	{
		alert("Please enter your telephone number.");
		telephone.focus();
	}
	else if (country.value == "")
	{
		alert("Please select your country.");
		country.focus();
	}
	else
	{
		email.form.submit();
	}
}

function writeTextBox(textboxName, textboxSize)
{
	if(navigator.appName.indexOf("Netscape") > -1)
	{
//		textboxSize /= 2;
	}
	document.write('<INPUT class="inputfield" id="' + textboxName + '" name="' + textboxName + '" size="' + textboxSize + '" type="text" />');
}

function writeMemoBox(memoboxName, memoboxSize)
{
	if(navigator.appName.indexOf("Netscape") > -1)
	{
		memoboxSize /= 2;
	}
	document.write('<TEXTAREA class="inputfield" rows="6" id="' + memoboxName + '"  name="' + memoboxName + '" cols="' + memoboxSize + '"></TEXTAREA>');
}

function writeBrowserText(IEtext, NStext)
{
	if (navigator.appName.indexOf("Netscape") > -1)
	{
		document.write(NStext);
	}
	else
	{
		document.write(IEtext);
	}
}

function openWindow(URL)
{
	window.open(URL, 'new_window', 'menubar,toolbar,location,directories,status,scrollbars,resizable,dependent,width=800,height=600,left=0,top=0');
}

function drawIndexImage()
{
	var images, i, r;
	var i = 0;
	images = new Array();
	images[i++] = "reduce_manual_data_entry2.jpg";
	images[i++] = "increase_productivity2.jpg";
	images[i++] = "increase_responsiveness2.jpg";
	r = Math.floor(Math.random() * i);
	
	document.write('<img border="0" src="http://www.inpute.com/content/images/composites/'+ images[r] + '" />');
}

// Macromedia functions
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 mmLoadMenus()
{
	if (window.mm_menu_0308090302_0) return;
	window.mm_menu_0308090302_0 = new Menu("root",250,19,"Verdana, Arial, Helvetica, Geneva, Swiss",11,"#000000","#ffffff","#ffffff","#6ab029","left","middle",4,0,500,0,0,true,true,true,0,true,true);
	mm_menu_0308090302_0.addMenuItem("Automated&nbsp;Data&nbsp;Capture","location='http://www.inpute.com/solutions/automated_data_capture.html'");
	mm_menu_0308090302_0.addMenuItem("Central&nbsp;Billing","location='http://www.inpute.com/solutions/central_billing.html'");
	mm_menu_0308090302_0.addMenuItem("Document&nbsp;and&nbsp;Records&nbsp;Management","location='http://www.inpute.com/solutions/document_management.html'");
	mm_menu_0308090302_0.addMenuItem("Forms&nbsp;Processing","location='http://www.inpute.com/solutions/forms_processing.html'");
	mm_menu_0308090302_0.addMenuItem("Invoice&nbsp;Approval","location='http://www.inpute.com/solutions/invoice_approval.html'");
	mm_menu_0308090302_0.addMenuItem("Proof&nbsp;of&nbsp;Delivery","location='http://www.inpute.com/solutions/pod.html'");
	mm_menu_0308090302_0.addMenuItem("Time&nbsp;Sheet&nbsp;Processing","location='http://www.inpute.com/solutions/time_sheet_processing.html'");
	mm_menu_0308090302_0.fontWeight="bold";
	mm_menu_0308090302_0.hideOnMouseOut=true;
	mm_menu_0308090302_0.menuBorder=1;
	mm_menu_0308090302_0.menuLiteBgColor='#ffffff';
	mm_menu_0308090302_0.menuBorderBgColor='#555555';
	mm_menu_0308090302_0.bgColor='#555555';
	window.mm_menu_0308090717_1_1 = new Menu("Cardiff",150,19,"Verdana, Arial, Helvetica, Geneva, Swiss",11,"#000000","#ffffff","#ffffff","#6ab029","left","middle",4,0,500,0,0,true,true,true,0,true,true);
	mm_menu_0308090717_1_1.addMenuItem("TeleForm","location='http://www.inpute.com/products/cardiff/cardiff_teleform.html'");
	mm_menu_0308090717_1_1.addMenuItem("LiquidOffice","location='http://www.inpute.com/products/cardiff/cardiff_liquidoffice.html'");
	mm_menu_0308090717_1_1.addMenuItem("LiquidOffice&nbsp;eForms","location='http://www.inpute.com/products/cardiff/cardiff_liquidoffice_eforms.html'");
	mm_menu_0308090717_1_1.fontWeight="bold";
	mm_menu_0308090717_1_1.hideOnMouseOut=true;
	mm_menu_0308090717_1_1.childMenuIcon="http://www.inpute.com/content/images/menu/arrows.gif";
	mm_menu_0308090717_1_1.menuBorder=1;
	mm_menu_0308090717_1_1.menuLiteBgColor='#ffffff';
	mm_menu_0308090717_1_1.menuBorderBgColor='#555555';
	mm_menu_0308090717_1_1.bgColor='#555555';
	window.mm_menu_0308090717_1_2 = new Menu("Captaris&nbsp;Alchemy",95,19,"Verdana, Arial, Helvetica, Geneva, Swiss",11,"#000000","#ffffff","#ffffff","#6ab029","left","middle",4,0,500,0,0,true,true,true,0,true,true);
	mm_menu_0308090717_1_2.addMenuItem("Premium","location='http://www.inpute.com/products/captaris/captaris_alchemy_premium.html'");
	mm_menu_0308090717_1_2.addMenuItem("Gold","location='http://www.inpute.com/products/captaris/captaris_alchemy_gold.html'");
	mm_menu_0308090717_1_2.addMenuItem("Pro","location='http://www.inpute.com/products/captaris/captaris_alchemy_pro.html'");
	mm_menu_0308090717_1_2.addMenuItem("MailStore","location='http://www.inpute.com/products/captaris/captaris_alchemy_mailstore.html'");
	mm_menu_0308090717_1_2.addMenuItem("Web","location='http://www.inpute.com/products/captaris/captaris_alchemy_web.html'");
	mm_menu_0308090717_1_2.addMenuItem("DataGrabber","location='http://www.inpute.com/products/captaris/captaris_alchemy_datagrabber.html'");
	mm_menu_0308090717_1_2.fontWeight="bold";
	mm_menu_0308090717_1_2.hideOnMouseOut=true;
	mm_menu_0308090717_1_2.menuBorder=1;
	mm_menu_0308090717_1_2.menuLiteBgColor='#ffffff';
	mm_menu_0308090717_1_2.menuBorderBgColor='#555555';
	mm_menu_0308090717_1_2.bgColor='#555555';
	window.mm_menu_0308090717_1 = new Menu("root",236,19,"Verdana, Arial, Helvetica, Geneva, Swiss",11,"#000000","#ffffff","#ffffff","#6ab029","left","middle",4,0,500,0,0,true,true,true,0,true,true);
	mm_menu_0308090717_1.addMenuItem("Inpute&nbsp;Capture","location='http://www.inpute.com/products/capture/'");
	mm_menu_0308090717_1.addMenuItem("Inpute&nbsp;CapTim","location='http://www.inpute.com/products/captim/'");
	mm_menu_0308090717_1.addMenuItem("Inpute&nbsp;Export&nbsp;Module&nbsp;for&nbsp;RightFax","location='http://www.inpute.com/products/emr/'");
	mm_menu_0308090717_1.addMenuItem("Inpute&nbsp;FaxStore","location='http://www.inpute.com/products/faxstore/'");
	mm_menu_0308090717_1.addMenuItem("Captaris&nbsp;RightFax","location='http://www.inpute.com/products/captaris/captaris_rightfax.html'");
	mm_menu_0308090717_1.addMenuItem("Captaris&nbsp;Workflow","location='http://www.inpute.com/products/captaris/captaris_workflow.html'");
	mm_menu_0308090717_1.addMenuItem("Hyland&nbsp;OnBase","location='http://www.inpute.com/products/hyland/hyland_onbase.html'");
	mm_menu_0308090717_1.addMenuItem(mm_menu_0308090717_1_1,"location='http://www.inpute.com/products/cardiff/cardiff.html'");
	mm_menu_0308090717_1.addMenuItem(mm_menu_0308090717_1_2,"location='http://www.inpute.com/products/captaris/captaris_alchemy.html'");
	mm_menu_0308090717_1.addMenuItem("Scanners","location='http://www.inpute.com/products/scanners/scanners.html'");
	mm_menu_0308090717_1.fontWeight="bold";
	mm_menu_0308090717_1.hideOnMouseOut=true;
	mm_menu_0308090717_1.childMenuIcon="http://www.inpute.com/content/images/menu/arrows.gif";
	mm_menu_0308090717_1.menuBorder=1;
	mm_menu_0308090717_1.menuLiteBgColor='#ffffff';
	mm_menu_0308090717_1.menuBorderBgColor='#555555';
	mm_menu_0308090717_1.bgColor='#555555';
	window.mm_menu_0308091229_2 = new Menu("root",160,19,"Verdana, Arial, Helvetica, Geneva, Swiss",11,"#000000","#ffffff","#ffffff","#6ab029","left","middle",4,0,500,0,0,true,true,true,0,true,true);
	mm_menu_0308091229_2.addMenuItem("Training","location='http://www.inpute.com/training.html'");
	mm_menu_0308091229_2.addMenuItem("Support&nbsp;Services","location='http://www.inpute.com/support/support_services.html'");
	mm_menu_0308091229_2.addMenuItem("Software&nbsp;Development","location='http://www.inpute.com/software_development.html'");
	mm_menu_0308091229_2.fontWeight="bold";
	mm_menu_0308091229_2.hideOnMouseOut=true;
	mm_menu_0308091229_2.menuBorder=1;
	mm_menu_0308091229_2.menuLiteBgColor='#ffffff';
	mm_menu_0308091229_2.menuBorderBgColor='#555555';
	mm_menu_0308091229_2.bgColor='#555555';
	
	mm_menu_0308091229_2.writeMenus();
} // mmLoadMenus()

