// resize.js

function resizeElements(eventType)	{
	var browserWidth = new Number();
	browserWidth = $("body").width();

	if (browserWidth <= 1003)	{
		$("#main_section").html("<img src=\"/images/photo_2.jpg\" alt=\"Why Use A Top Texas REALTOR®?\" width=\"364\" height=\"198\" />");
		
		var cssValue = new String();
		
		cssValue = "963px";
		
		$("#main_content").css("width", cssValue);
		$("#header").css("width", cssValue);
		$("#tier_2").css("width", cssValue);
		
		cssValue = "788px";
		
		$("#header_image").css("width", cssValue);

		var cssObject = {
						"width" : "364px",
						"height" : "198px"
						};

		$("#main_section").css(cssObject);
		
		cssObject = {
					"width" : "963px",
					"height" : "202px"
					};

		$("#tier_1").css(cssObject);
		
		cssObject = {
					"width" : "579px",
					"height" : "184px"
					};

		$("#text_1").css(cssObject);

		cssObject = {
					"font-size" : "11pt",
					"margin-top" : "0"
					};
		
		$("#text_1 H4").css(cssObject);
		
		cssObject = {
					"font-size" : "9pt",
					"line-height" : "18pt"
					};
						
		$("#text_1 P").css(cssObject);

		cssObject = {
					"font-size" : "9pt",
					"width" : "310px"
					};

		$(".desc_box").css(cssObject);
		
		cssValue = "333px";
		
		$("#blocks").css("width", cssValue);
		
		cssValue = "331px";
		
		$("#agent_block").css("width", cssValue);
		$("#bonus_block").css("width", cssValue);
		
		cssValue = "201px";
		
		$("#photo_block_2").css("width", cssValue);
		$("#photo_block_4").css("width", cssValue);
		
	}
		
	 if (browserWidth > 1003 && browserWidth < 1259)	{
		var widthOfPhoto = Math.round(browserWidth * 0.39);
		var heightOfPhoto = Math.round(widthOfPhoto * 0.478);

		var imgString = "<img src=\"/images/photo_1.jpg\" alt=\"Why Use A Top Texas REALTOR®?\" width=\"" + widthOfPhoto + "\" height=\"" + heightOfPhoto + "\" />";

		$("#main_section").html(imgString);
		
		if (eventType == "load")	{
			$("head").append("<link href=\"front_page-lg.css\" rel=\"stylesheet\" type=\"text/css\">");
		}
		
		value_1 = 963 + (browserWidth - 1003) + "px";
		
		$("#header").css(
			"width", value_1
		);
				
		$("#main_content").css(
			"width", value_1
		);
		
		$("#tier_2").css(
			"width", value_1
		);
				
		cssObject = {
					"height" : (heightOfPhoto + 4) + "px",
					"width" : (963 + (browserWidth - 1003)) + "px"
					};
					
		$("#tier_1").css(cssObject);
		
		value_1 = (963 + (browserWidth - 1003)) + "px";
		
		$("#footer").css(
			"width", value_1
		);
		
		value_1 = ((963 + (browserWidth - 1003)) - 175) + "px";
		
		$("#header_image").css(
			"width", value_1
		);
		
		cssObject = {
						"width" : widthOfPhoto + "px",
						"height" : heightOfPhoto + "px"
						};
		
		$("#main_section").css(cssObject);

		cssObject = {
					"width" : ((963 + (browserWidth - 1023)) - widthOfPhoto) + "px",
					"height" : (heightOfPhoto - 14) + "px"
					};
		
		$("#text_1").css(cssObject);
			
		cssObject = {
					"font-size" : Math.round(heightOfPhoto * 0.0454) + "pt",
					"line-height" : Math.round(Math.round(heightOfPhoto * 0.0454) * 1.75) + "pt"
					};
		
		$("#text_1 > P").css(cssObject);
		
		value_1 = (Math.round(heightOfPhoto * 0.0454) + 3) + "pt";
		
		$("#text_1 > H3").css(
			"font-size", value_1
		);
		
		cssObject = {
					"font-size" : (Math.round(heightOfPhoto * 0.0454) + 2) + "pt",
					"margin-top" : (Math.round(heightOfPhoto * 0.0454) + 2) + "px"
					};

		$("#text_1 > H4").css(cssObject);
				
		cssObject = {
					"font-size" : Math.round(heightOfPhoto * 0.0454) + "pt",
					"width" : (Math.round((963 + (browserWidth - 963)) * 0.334) - 20) + "px"
					};
	
		$(".desc_box").css(cssObject);
		
		value_1 = (Math.round((963 + (browserWidth - 1003)) * 0.334) - 1) + "px";
				
		$("#blocks").css(
			"width", value_1
		);
		
		$("#agent_block").css(
			"width", value_1
		);
				
		$("#bonus_block").css(
			"width", value_1
		);
		
		value_1 = (Math.round((963 + (browserWidth - 1003)) * 0.334) - 145) + "px";
		
		$("#photo_block_2").css(
			"width", value_1
		);

		$("#photo_block_4").css(
			"width", value_1
		);
		
	}
	
	if (browserWidth >= 1259)	{
		$("#main_section").html("<img src=\"/images/photo_1.jpg\" alt=\"Why Use A Top Texas REALTOR®?\" width=\"502\" height=\"240\" />");
		
		cssValue = "1219px";
		
		$("#main_content").css("width", cssValue);
		$("#header").css("width", cssValue);
		$("#tier_2").css("width", cssValue);
		
		cssValue = "1044px";
		
		$("#header_image").css("width", cssValue);

		cssObject = {
					"width" : "1219px",
					"height" : "244px"
					};

		$("#tier_1").css(cssObject);
				
		cssObject = {
					"width" : "502px",
					"height" : "240px"
					};
		
		$("#main_section").css(cssObject);
		
		cssObject = {
					"width" : "697px",
					"height" : "226px"
					};
					
		$("#text_1").css(cssObject);

		cssObject = {
					"font-size" : "13pt",
					"margin-top" : "15px"
					};
		
		$("#text_1 H4").css(cssObject);
		
		cssObject = {
					"font-size" : "12pt",
					"line-height" : "21pt"
					};
						
		$("#text_1 P").css(cssObject);

		cssObject = {
					"font-size" : "12pt",
					"width" : "405px"
					};

		$(".desc_box").css(cssObject);
		
		cssValue = "342px";
		
		$("#blocks").css("width", cssValue);
		
		cssValue = "397px";
		
		$("#agent_block").css("width", cssValue);
		$("#bonus_block").css("width", cssValue);
		
		cssValue = "221px";
		
		$("#photo_block_2").css("width", cssValue);
		$("#photo_block_4").css("width", cssValue);
		
	}
		
}

if (navigator.appNsme == "Mozilla")	{
	$("document").load( function() { resizeElements('load'); } );	
}
else	{
	$("document").ready( function() { resizeElements('load'); } );
}
