// JavaScript Document.

$(document).ready(function()
{
	
	
var iFrames = document.getElementsByTagName('iframe');
$(iFrames[0]).load(function(){
								var checkStr = iFrames[0].src;
	//alert(checkStr);

	var newHeight = document.body.offsetHeight*.8;
	switch (iFrames[0].src){
		case "http://www.housingpt.com/Northland/ChangeTab.cfm?tab=2&action=home": 
			newHeight = 800;
			break;
		case "http://www.housingpt.com/Northland/ChangeTab.cfm?tab=1&action=home": 
			newHeight = 800;
			break;
		case "http://www.housingpt.com/Northland/ChangeTab.cfm?tab=3&action=home": 
			newHeight = 700;
			break;
		case "http://www.housingpt.com/Northland/Calculator.cfm?action=sub2": 
			newHeight = 800;
			break;	
		case "http://www.housingpt.com/Northland/Search.cfm": 
			newHeight = 900;
			break;	
		case "http://www.housingpt.com/Northland/OtherResources.cfm": 
			newHeight = 800;
			break;	
		case "http://www.housingpt.com/Northland/HomePage.cfm?CFID=549217&CFTOKEN=34eb": 
			newHeight = 800;
			break;	
		case "http://dev.resourcepoint.org/signup.html": 
			newHeight = 800;
			break;	
		case "http://cg.servicept.com/northland/communitycalendar.php": 
			newHeight = 700;
			break;	
		default : 
	}
	if (checkStr.indexOf("http://www.housingpt.com/Northland/HomePage.cfm")>-1){
		newHeight = 550;
	}
	if (checkStr.indexOf("http://www.housingpt.com/Northland/Search.cfm")>-1){
		newHeight = 900;
	}
	if (checkStr.indexOf("http://www.housingpt.com/Northland/Calculator.cfm")>-1){
		newHeight = 650;
	}	
	//safari
	iFrames[0].style.height = newHeight + 'px';

			// Set specific variable to represent all iframe tags.
			//top.location.href
			//http://www.housingpt.com/Northland/ChangeTab.cfm?tab=1&action=home
			if ($.browser.mozilla || $.browser.msie){
				//						iFrames[0].style.height = document.body.offsetHeight*.8 + 'px';

						iFrames[0].style.height = newHeight + 'px';
	
				$('iframe').load(function()
					{
						// Set inline style to equal the body height of the iframed content.
						this.style.height = newHeight + 'px';
					}
				);
			}
			
			// Resize heights.
			function iResize()
			{
	
				// Iterate through all iframes in the page.
				for (var i = 0, j = iFrames.length; i < j; i++)
				{
					// Set inline style to equal the body height of the iframed content.
					//					iFrames[i].style.height = iFrames[i].contentWindow.document.body.offsetHeight + 'px';

					iFrames[i].style.height = '3600px';
				}
			}
	});
});
