// CACHE IMAGES AND MOUSEOVER FUNCTION
arrowSideNavon = new Image();
arrowSideNavon.src = "/epic/images/arrow_sidenavON.gif";
arrowSideNavoff = new Image();
arrowSideNavoff.src = "/epic/images/arrow_sidenavOFF.gif";

shoppingcarton = new Image();
shoppingcarton.src = "/epic/images/topnav_shoppingcartON.gif";
shoppingcartoff = new Image();
shoppingcartoff.src = "/epic/images/topnav_shoppingcartOFF.gif";

trackOrderon = new Image();
trackOrderon.src = "/epic/images/topnav_trackorderON.gif";
trackOrderoff = new Image();
trackOrderoff.src = "/epic/images/topnav_trackorderOFF.gif";

function brillar(x, y)
{
	document.images[x].src=eval(y+'.src');
}
// END CACHE IMAGES AND MOUSEOVER FUNCTION

// POPUP FUNCTIONS
function popWindow (url,myWidth,myHeight,myScrollbars,myTop,myLeft,myMenubar,myResize) {
window.open (url, "","width="+myWidth+",height="+myHeight+",scrollbars="+myScrollbars+",top="+myTop+",left="+myLeft+",menubar="+myMenubar+",resizable="+myResize+",bgcolor=#ffffff");
}

function popSpecWindow (url,myWidth,myHeight,myScrollbars,myTop,myLeft,myMenubar,myResize) {
window.open (url, "FeatureSpec","width="+myWidth+",height="+myHeight+",scrollbars="+myScrollbars+",top="+myTop+",left="+myLeft+",menubar="+myMenubar+",resizable="+myResize+",bgcolor=#ffffff");
}
// END POPUP FUNCTIONS



//VARIOUS FUNCTIONS
function popUp(page) {
	window.open(page,"POPUP","toolbar=0,location=0,status=0,menubar=0,scrollbars=yes,resizable=yes,width=500,height=500");
}

function validEmail(email) {
	if (email.length==0 || email.indexOf("@")==-1 || email.indexOf(".")==-1 || email.indexOf("..")!=-1 || email.indexOf("@.")!=-1 || email.indexOf(".@")!=-1 || email.indexOf("@")!=email.lastIndexOf("@") || email.substr(email.indexOf("@"),email.length-1).indexOf(".")==-1) {
		return false;
	}
	for (i=0;i<email.length;i++) {
		if ("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-@.".indexOf(email.substring(i,i+1))==-1) {
			return false;
		}
	}
	return true;
}

function limitLength(checkIt,len) {
	if(checkIt.length<len)
		return(true);
	else
		return(false);
}

function limitPaste(checkIt,len) {
	clipText = window.clipboardData.getData("Text");
	len1 = checkIt.length;
	len2 = clipText.length;
	if (len1+len2 > len) {
		clipText = clipText.substring(0,len-len1)
		window.clipboardData.setData("Text", clipText);
		alert ("Data has been truncated.");
	}
}

function dispStatus(text) {
	if ( ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 3)) || ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) > 3)) ) {
		window.status = text;
	}
}

function textCounter(field,cntfield,maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else
cntfield.value = maxlimit - field.value.length;
}

//END VARIOUS FUNCTIONS

///////////////////////////////     CONTENT AREA - HEADER, NAV, AND FOOTER      ////////////////////////////////////////////////////


// TOP NAVIGATION AND HEADER
var topNav = '';

	topNav += '<a href="http://www.epicfit.com/"><h1><b>Epic Fitness</b><span></span></h1></a>';

	
// END TOP NAVIGATION AND HEADER

// SIDE NAVIGATION
var sideNav = '';
	sideNav += '<ul>';
	sideNav += '<li><a href="http://www.iconservice.com/epic/manuals.html">Owner\'s Manual</a></li>';
	sideNav += '<li><a href="http://www.iconservice.com/epic/parts.html">Replacement Parts</a></li>';
	sideNav += '<li><a href="javascript:popWindow(\'http://www.iconservice.com/serviceapps/orderQuery.jsp?p=1\',\'696\',\'340\',\'yes\',\'20\',\'20\',\'no\',\'no\');">Order Status</a></li>';
	sideNav += '<li><a href="http://www.iconservice.com/epic/faq.html">FAQ</a></li>';
	sideNav += '<li><a href="http://www.iconservice.com/epic/contact_us.html">Contact Us</a></li>';
	//sideNav += '<li><a href="/epic/product_feedback.html">Product Feedback</a></li>';
	sideNav += '<li><a href="/prodreg/EpicProdReg.jsp">Product Registration</a></li>';
	sideNav += '</ul>';	

// END SIDE NAVIGATION

// FOOTER
var footer = '';
	footer += '<div id="footer">';
	footer += '<div id="footerBottom">';
	footer += '&copy;2009 ICON HEALTH & FITNESS | <a href="http://www.epicfit.com/webapp/wcs/stores/servlet/Privacy_-1_10101_10651">PRIVACY POLICY </a> | <a href="http://www.epicfit.com/webapp/wcs/stores/servlet/SiteMap_-1_10101_10651">SITEMAP</a> | <a href="http://www.iconservice.com/epic/contact_us.html">CONTACT US</a> ';
	footer += '</div>';
	footer += '</div>';	
// END FOOTER