function dealers(state) {

	var pageSize = this.getPageSize();
	var vpWidth = pageSize[2];
	var pleft = (pageSize[2] / 2) - (200);

	dealersWin = window.open( 'dealerslist.html#' + state,'Dealers','left=' + pleft + ', top=15, width=400,height=528,menubar=no,scrollbars=yes, resizable=yes,toolbar=no,location=no,directories=no,status=no');
	dealersWin.document.close();
	dealersWin.focus();

	}	
	
	
	
	function setSize(page) {
	var pageSize = this.getPageSize();
	var vpWidth = pageSize[2];
	var vpHeight = pageSize[3];
	// alert(vpWidth + " - " + vpHeight);


	if (page == "splash") {

		// If viewport is larger than header (175) + maintext (550) + small amp (125) + footer (50),
		// then make main text higher so that small amp and footer are at the bottom.
		// Height of main text should be viewport - header (175) - small amp (125) - footer (50).

		if (vpHeight > 900 ) {
			var mainTextHeight = vpHeight - 350;
			document.getElementById("mainText").style.height= mainTextHeight + "px";
			}
		}
		
		
	else if (page == "main") {

		// If viewport is larger than header (175) + h2 (60) + content (535) + small amp (125) + footer (50),
		// then make contentBlock higher so that small amp and footer are at the bottom.
		// Height of contentBlock should be viewport - header (175) - h2 (60) - small amp (125) - footer (50).

		if (vpHeight > 945 ) {
			var contentBlockHeight = vpHeight - 410;
			document.getElementById("contentBlock").style.height= contentBlockHeight + "px";
			}
		}		
		
	else if (page == "content") {

		// If viewport is larger than header (175) + h2 (60) + content (655) + footer (50),
		// or header (175) + h2 (60) + large album (325) + icons (165) + margin (40) + amp (125) + footer (50)
		// then make leftBlock higher so that footer is at the bottom.
		// Normally, leftBlock = 490 + 120 (negative margin of amp) + 40 (minimum space between icons and amp) = 650
		// Height of leftBlock should get amount of pixels more than 940.

		if (vpHeight > 940 ) {
			var leftBlockAddHeight = vpHeight - 940;
			// alert("SENFF DEBUGGER: viewport height = " + vpHeight + " pixels");
			// alert("SENFF DEBUGGER: leftBlock height = " + leftBlockAddHeight + " pixels");
			document.getElementById("leftBlock").style.height= 650 + leftBlockAddHeight + "px";
			}
		}		
		



		
	}


getPageSize = function() {
	var xScroll, yScroll, windowWidth, windowHeight;
	if (window.innerHeight && window.scrollMaxY) {
		xScroll = this.document.scrollWidth;
		yScroll = (this.isFrame ? parent.innerHeight : self.innerHeight) + (this.isFrame ? parent.scrollMaxY : self.scrollMaxY);
		}
	else if (this.document.body.scrollHeight > this.document.body.offsetHeight){
		xScroll = this.document.body.scrollWidth;
		yScroll = this.document.body.scrollHeight;
		}
	else {
		xScroll = this.document.getElementsByTagName("html").item(0).offsetWidth;
		yScroll = this.document.getElementsByTagName("html").item(0).offsetHeight;
		xScroll = (xScroll < this.document.body.offsetWidth) ? this.document.body.offsetWidth : xScroll;
		yScroll = (yScroll < this.document.body.offsetHeight) ? this.document.body.offsetHeight : yScroll;
		}

	if (self.innerHeight) {
		windowWidth = (this.isFrame) ? parent.innerWidth : self.innerWidth;
		windowHeight = (this.isFrame) ? parent.innerHeight : self.innerHeight;
		}
	else if (document.documentElement && document.documentElement.clientHeight) {
		windowWidth = this.document.documentElement.clientWidth;
		windowHeight = this.document.documentElement.clientHeight;
		}
	else if (document.body) {
		windowWidth = this.document.getElementsByTagName("html").item(0).clientWidth;
		windowHeight = this.document.getElementsByTagName("html").item(0).clientHeight;
		windowWidth = (windowWidth == 0) ? this.document.body.clientWidth : windowWidth;
		windowHeight = (windowHeight == 0) ? this.document.body.clientHeight : windowHeight;
		}

	var pageHeight = (yScroll < windowHeight) ? windowHeight : yScroll;
	var pageWidth = (xScroll < windowWidth) ? windowWidth : xScroll;
	return new Array(pageWidth, pageHeight, windowWidth, windowHeight);
	}





function openPop(image,pwidth,pheight) {

	var pageSize = this.getPageSize();
	var vpWidth = pageSize[2];
	var pleft = (pageSize[2] / 2) - (381);
	var marg = 495;


	$newWin = window.open( '', '65Amps', 'left=' + pleft + ', top=15, width=762,height=528,menubar=no,resizable=yes,toolbar=no,location=no,directories=no,status=no');
	$newWin.document.write( '<html><head><title> 65AMPS // the unmistakable sound of a generation </title>' );
	$newWin.document.write( '<link rel=\"stylesheet\" href=\"css/default.css\" type=\"text/css\" /></head>' );
	$newWin.document.write( '<body class=\"ampPopup\" style=\"background-image:url(images/' + image + '.jpg);\">' );
	$newWin.document.write( '<div id=\"closeWindow\" style=\"margin-top:' + marg + 'px;\"><a href=\"javascript:window.close();\">CLOSE</a></div>' );
	$newWin.document.write( '</body></html>' );
	$newWin.document.close();
	$newWin.focus();

	}
	
