/* #################################################################################################
##########     Auto Generated JavaScripts  //  Dreamweaver     #####################################
################################################################################################# */

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_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 getURL(url) {
	var pwin=null,w=400,h=375,sw=screen.availWidth,sh=screen.availHeight,l=(sw-w)/2,t=(sh-h)/2;
	var features  = 'width='+w+',height='+h+',left='+l+',top='+t+',';
		features += 'scrollbars=yes,resizable=yes,statusbar=yes';
	pwin = window.open(url,'pwin',features);
	pwin.window.focus();
}

/* #################################################################################################
##########     Custom Scripts - CFWebmasters.com     ###############################################
################################################################################################# */

function NetscapeFix() { //Auto-Resize Main Content TD to Fix Width/Height issues in Gecko-Based Browsers
	var BodyTd;
	var TotalWidth;
	var TotalHeight;
	var clientWidth;
	var clientHeight;
	var LeftTdWidth = 206;
	var TopTableHeight = 220;
	var FooterTableHeight = 64;
	var CombinedHeight = TopTableHeight + FooterTableHeight;

	//Determine which Browser is Being Used and set maximum available width to document width.
	
	//IE5+
	if (document.getElementById && typeof(document.body.clientWidth) == 'number' && typeof(window.innerWidth) != 'number') {
		BodyTd = document.getElementById('TD_MainTableRightTd');
		clientWidth = document.body.clientWidth;
		clientHeight = document.body.clientHeight;
		var isIE = true;
	}
	//NN6+
	else if (document.getElementById && typeof(window.innerWidth) == 'number') {
		BodyTd = document.getElementById('TD_MainTableRightTd');
		clientWidth = window.innerWidth;
		clientHeight = window.innerHeight;
		var isNN6 = true;
	}
	//IE4
	else if (document.all && !document.getElementsById) {
		BodyTd = document.all.elementID("TD_MainTableRightTd");
		clientWidth = document.body.clientWidth;
		clientHeight = document.body.clientHeight;
		var isIE = true;
	}
	//NN4
	else if (document.layers && !document.getElementsById) {
		var isNN4 = true;
	}
	
	//If browser is IE5+ then set width appropriately
	if (isIE) {
		if (screen.availWidth > 800) {
			if (clientWidth > 770) {
				BodyTd.style.width  = (clientWidth - LeftTdWidth);
				BodyTd.style.height = (clientHeight - CombinedHeight);
			}
		}
	}
	
	//If browser is NN6+ then set width appropriately
	if (isNN6) {
		if (screen.availWidth > 800) {
			if (clientWidth > 770) {
				BodyTd.style.width  = (clientWidth - LeftTdWidth);
				BodyTd.style.height = (clientHeight - CombinedHeight);
			}
		}
	}
	
	if (isNN4) {
		//do nothing;
	}
// End Function
}


/* **********  FAQ's Page ********** */

function setClass(id) {
	var theLink = eval('document.getElementById("'+id+'_link")');
	if (!theLink.className) {
		theLink.className = 'faq_Active';
	} else if (theLink.className == '') {
		theLink.className = 'faq_Active';
	} else if (theLink.className == 'faq_Active') {
		theLink.className = '';
	}
}

function swapIconSrc(id,action) {
	var theIcon 	= eval('document.getElementById("'+id+'_icon")');
	var openSrc 	= '/images/icon_OpenFAQ.gif';
	var closedSrc = '/images/icon_ClosedFAQ.gif';
	if (action == 'open') {
		theIcon.src = openSrc;
	} else if (action == 'close') {
		theIcon.src = closedSrc;
	}
}

function showFAQ(id) {
	var theFAQ = eval('document.getElementById("'+id+'")');
	if (theFAQ.style.display == 'none') {
		theFAQ.style.display = 'inline';
		//swapIconSrc(id,'open');
		setClass(id);
	} else if (theFAQ.style.display == 'inline') {
		theFAQ.style.display = 'none';
		//swapIconSrc(id,'close');
		setClass(id);
	}
}
/* 
Note: Added by Scott 4/26/07

When adding a new item to the list, change the value in this line:
for (var i=1; i<23; i++) {
If you have 22 items in the list, then it should state i<23
If you have 23 items in the list, then it should state i<24
etc...
*/
function OpenCloseAll(action) {
	for (var i=1; i<23; i++) {
		var theId  = "faq"+i;
		var theObj = eval('document.getElementById("'+theId+'")');
		if(theObj) {
			if (action == 'open' && theObj.style.display == 'none') {
				showFAQ(theId);
			}
			if (action == 'close' && theObj.style.display == 'inline') {
				showFAQ(theId);
			}
		}
	}
}


/*############################################################################################
	Pop-up window for larger photographs

	This function opens a new window whose size is determined by that of the
	target image.  The image is dynamically written to the new window with a
	hotspot that closes the new window when an individual clicks on the image
	contained within.  
	It has been tested in IE 5.5 + and NN 6.2 + 
############################################################################################*/
	  
function getPhoto(Img,W,H){ //receives the target image name, width, and size respectively
	var photoWin 	= null;
	var wScroll 	= "no";
	var reSize		= "no";
	
	/*---------------------------------------------------------------------------
	/	sets the default url for the target image.  To change the                 /
	/	url, simply replace the "/images/" with the appropriate path (URL)				/
	/	Just be sure that the target image exists in the path (URL) specified.		/
	---------------------------------------------------------------------------*/
	var URL 			= "/Product_Images/" +Img; 

	var aW 				= screen.availWidth;
	var aH 				= screen.availHeight;
	
	//set the width & height value for the pop-up window by adding 20 pixels to the target image's width
	//and 40 pixels to the target image's height.  If the resulting window is greater than the user's
	//available screen space, then the window width and height are set to the maximum viewable area of the
	//user's screen respectively. 
	var wW 				= 20 + (parseInt(W));
	var wH 				= 40 + (parseInt(H));
	
	if (wW > aW) { wW = aW; wScroll = "yes"; reSize = "yes"; }
	if (wH > aH) { wH = aH; wW = (wW + 30); wScroll = "yes"; reSize = "yes"; }			
	


	/*------------- Positioning the Pop-Up Window ---------------------------------------------------------
	/		 To set the default top and left locations of the pop-up window, specify the appropriate values   /
	/		 below.  winTop is the distance from the top of the user's screen (in pixels).  winLeft is the    /
	/		 distance from the left of the user's screen (in pixels). Comment and uncomment the following     /
	/    lines to set the desired location of the pop up window.																					/
	-----------------------------------------------------------------------------------------------------*/

	//##### Center Window on Screen #####//
	var winTop		= (aH - wH)/2;												
	var winLeft 	= (aW - wW)/2;
	
	//##### Position window to TOP RIGHT #####//
	//var winTop 		= 0;
	//var winLeft 	= aW - (10 + parseInt(wW));
	
	//##### Position window to TOP LEFT #####//
	//var winTop	= 0;
	//var winLeft = 0;
	
	//##### Position window to TOP CENTER #####//
	//var winTop	= 0;
	//var winLeft = (aW - wW)/2;			
	

	/*---------------------------------------------------------------------------------------------------
	/		Now, we assign the HTML that's to be dynamically written into our pop-up window to a variable		/
	/		It shouldn't be necessary to change any of the code for this variable 													/	
	---------------------------------------------------------------------------------------------------*/
	 	
	var strImage 	= "<html>\r";
			strImage += "<head>\r";
			
			//define a function that resizes the window based upon the target image width and height
			strImage += "<SCR"+"IPT language='JavaScript'> \r";
			strImage += "<!-- \r";
			strImage += "function reSize(){ \r";
			strImage += "if (window.width != "+wW+"){ \r"; 							//checks existing window width
			strImage += " var wW = "+wW+";} \r"; 					 							//sets the window width to the appropriate value
			strImage += "if (window.height != "+wH+"){ \r";							//checks existing window height
			strImage += " var wH = "+wH+";} \r";					 							//sets the window height to the appropraite value
			strImage += "  window.resizeTo(wW,wH); \r";		 							//resizes the window to the new window width & height values (if necessary)
			strImage += "  window.moveTo("+winLeft+","+winTop+"); \r";	//moves the window to the appropriate place on the screen
			strImage += "} \r";
			strImage += "//--> \r";
			strImage += "</scr"+"ipt> \r";
			//end our function
			
			strImage += "</head> \r";
			strImage += "<body bgcolor='#FFFFFF' topmargin='5' leftmargin='5' marginwidth='5' marginheight='5' onLoad='reSize();'> \r";
			strImage += "<p align='center'><a href='javascript:self.close();'> \r";
			strImage += "<img src='"+URL+"' border='0'> \r";
			strImage += "</a></p> \r";
			strImage += "</body></html> \r";


/* Now that we've finished assigning our new HTML to a variable, it's time to open the pop-up window */				
	photoWin = window.open('','photoWin','width='+wW+',height='+wH+',left='+winLeft+',top='+winTop+',scrollbars='+wScroll+',resizable='+reSize+'');
	photoWin.window.focus();
	
	//Write the Image to the New Window & we're done.
	photoWin.document.write(strImage);
	photoWin.document.close();
}

function confirmReDirect() {
	var msg  = 'In order to provide you with a secure credit card transaction, \n';
			msg += 'you will be redirected to the Bank of America secure processing website. \n';
			msg += 'Once you have completed your transaction, you will automatically be returned \n';
			msg += 'to our website were you will be able to print your receipt. \n';
			msg += '\n\nIf you wish to continue, please click the <OK> button.\n';
			msg += 'If you wish to cancel your order, please click the <CANCEL> button.';
	if (confirm(msg)) {
		return true;
	} else {
		return false;
	}
}

