function showPop(popId){
	leftPos = 0;
	topPos = 0;
	
		leftPos	= $('pop_'+popId).viewportOffset()[0];
		switch(popId){
			case 0:{
				leftPos	-= 310;
				topPos	= 350;
			}break;
			case 1: {
				leftPos	-= 360;
				topPos	= 570;
			}break;
			case 2: {
				leftPos	-= 360;
				topPos	= 820;
			}break;
			case 3: {
				leftPos	-= 360;
				topPos	= 1070
			}break;
			case 4: {
				leftPos	-= 70;
				topPos	= 1560
			}break;
			case 5:{
				leftPos	-= 160;
				topPos	= 350;
			}break;
		}
		$('dpop-' + popId).style.left = leftPos + 'px';
		$('dpop-' + popId).style.top = topPos + 'px';
		$('dpop-' + popId).style.display = 'block';
	
}

function closePop(popId){
		$('dpop-' + popId).style.display = 'none';
}


var currShowcase = 1;
function showcasePic(showcaseId, showcaseType){

	try{
		currShowcase = showcaseId;	
		$('showcaseId').src = "/images/" + showcaseType + "_" + showcaseId + ".jpg";
		$('showcaseCountId').innerHTML = currShowcase;
	}
	catch(e){}

}

function showcasePreNext(preNextId,showcaseType){
	
	try{
		if(preNextId == 0){
			currShowcase--;
			if(currShowcase < 1) currShowcase = 43;
		}
		else{
			currShowcase++;
			if(currShowcase > 43) currShowcase = 1;			
		}
		$('showcaseId').src = "/images/" + showcaseType + "_" + currShowcase + ".jpg";
		$('showcaseCountId').innerHTML = currShowcase;
	}
	catch(e){}
}



function showVideo(){
	window.open ("http://www.longwindows.com/media/","video","status=0,toolbar=0,width=480,height=360"); 
}

function savingsCalc(){
	var amountAEC = 0.00;
	var amountESFive = 0.00;
	var amountEAS = 0.00;
	var amountESTen = 0.00;
	
	try{
		var ameb = $('avg_bill').value;
		amountAEC = ameb * 12;
		amountEAS = amountAEC * .5;
		amountESFive = amountEAS * 5;
		amountESTen = amountEAS * 10;
	}
	catch(e){}

	$('aec').innerHTML = '$' + amountAEC.toFixed(2);
	$('esFive').innerHTML = '$' + amountESFive.toFixed(2);
	$('eas').innerHTML = '$' + amountEAS.toFixed(2);
	$('esTen').innerHTML = '$' + amountESTen.toFixed(2);
}

function savingsCalcSiding(){
	var amountAEC = 0.00;
	var amountESFive = 0.00;
	var amountEAS = 0.00;
	var amountESTen = 0.00;
	
	try{
		var ameb = $('avg_bill').value;
		amountAEC = ameb * 12;
		amountEAS = amountAEC * .4;
		amountESFive = amountEAS * 5;
		amountESTen = amountEAS * 10;
	}
	catch(e){}

	$('aec').innerHTML = '$' + amountAEC.toFixed(2);
	$('esFive').innerHTML = '$' + amountESFive.toFixed(2);
	$('eas').innerHTML = '$' + amountEAS.toFixed(2);
	$('esTen').innerHTML = '$' + amountESTen.toFixed(2);
}