$.fn['scrollWidth'] = function(val) {
	if (!this[0]) return;
	
	return val != undefined ?
	
	// Set the scrollWidth
	this.each(function() {
	this == window || this == document ?
	window.scrollWidth( val ) :
	this[ 'scrollWidth' ] = val;
	}) :
	
	// Return the scrollWidth
	this[0] == window || this[0] == document ?
	self[ 'scrollWidth' ] ||
	$.boxModel && document.documentElement[ 'scrollWidth' ] ||
	document.body[ 'scrollWidth' ] :
	this[0][ 'scrollWidth' ];
};
function load_site() {	

	full_width =   parseInt(  $(window).width() )

	$('#strech').css({'width': full_width-770+'px'})
	$('#strech').attr('src','/images/strech.jpg')
	$('#search_area').css({'left': full_width-390+'px', 'visibility':'visible'})
	$('#logo_image').attr('src','/images/new_logo.jpg')
	$('#city_1').attr('src','/images/city_scape1.jpg')
	$('#city_2').attr('src','/images/city_scape2.jpg')
	//$('.col1').css({'width': full_width-300+'px'})
//	$('.col2').css({'width': 227+'px'})

	/* IF FULL COLUMN AND 	PAGE IS NOT TALL ENOUGH */
	// header_height = 128 ; nav_height = 35; $('.colmask').height()+22 = column_height
	full_page_content_height = 128+35+parseInt($('.colmask').height())+22
	document_height = $(document).height()
	
	footer_pad = document_height - full_page_content_height - 90
	//alert(document_height + ' - ' + full_page_content_height+ ' - ' + footer_pad)
	if ((document_height > full_page_content_height) && (footer_pad > 0)){
		$('#footer').css({'padding-top':footer_pad+'px'})
	}

	
}

function resize_site() {	

	full_width =   parseInt(   $(window).width())
	$('#strech').css({'width': full_width-770+'px'})
	$('#search_area').css({'left': full_width-390+'px', 'visibility':'visible'})

	//$('.col1').css({'width': full_width-300+'px'})
//	$('.col2').css({'width': 227+'px'})

	/* IF FULL COLUMN AND 	PAGE IS NOT TALL ENOUGH */
	// header_height = 128 ; nav_height = 35; $('.colmask').height()+22 = column_height
	full_page_content_height = 128+35+parseInt($('.colmask').height())+22
	document_height = $(document).height()
	
	footer_pad = document_height - full_page_content_height - 85
	//alert(document_height + ' - ' + full_page_content_height+ ' - ' + footer_pad)
	if ((document_height > full_page_content_height) && (footer_pad > 0)){
		$('#footer').css({'padding-top':footer_pad+'px'})
	}

	
}




function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}



function load_browser_info(PageID, Other_Info) {
	/* DECLARE VARIABLES */
	var browser_info_all = '';
	var browser_version = '';
	var browser_name = '';
	var screen_width = '';
	var screen_height = '';
	var browser_width = '';
	var browser_height = '';
	var op_system = '';


 	var browser=navigator.appName;
 	var op=navigator.platform;
	var b_version=navigator.appVersion;
	var version=parseFloat(b_version);


	op_system = op
	browser_info_all = b_version	/* SET VARIABLE */

	if (b_version.indexOf("MSIE") > 1) {
		screen_width = screen.width;
		screen_height = screen.height;
		browser_width = document.body.clientWidth;
		browser_height = document.documentElement.clientHeight;

			if (b_version.indexOf("7.") > 1) {
				browser_version = '7'	/* SET VARIABLE */
			} else if (b_version.indexOf("6.") > 1) {

				browser_version = '6'	/* SET VARIABLE */
			} else if  (b_version.indexOf("8.") > 1) {

				browser_version = '8'	/* SET VARIABLE */
			} else {
				browser_version = '0'	/* SET VARIABLE */
			}
		browser_name = 'MSIE'	/* SET VARIABLE */
		


	}  else if (b_version.indexOf("hrome") > 1) {
	
		//	5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16

		screen_width = screen.width;
		screen_height = screen.height;
		browser_width = document.innerWidth;
		browser_height = document.innerHeight;

		
		thisVersion = b_version.substr(b_version.indexOf("Chrome")+7,3)

		
		browser_name = 'Chrome'	/* SET VARIABLE */
		browser_version = thisVersion	/* SET VARIABLE */
	} else 	if (b_version.indexOf("afari") > 1) {


		screen_width = screen.width;
		screen_height = screen.height;
		browser_width = document.innerWidth;
		browser_height = document.innerHeight;

		
		thisVersion = b_version.substr(b_version.indexOf("Version")+8,4)

		browser_name = 'Safari'	/* SET VARIABLE */
		browser_version = thisVersion	/* SET VARIABLE */
	
	} else 	if (browser.indexOf("etscape") >= 1) {

		screen_width = screen.width;
		screen_height = screen.height;
		browser_width =document.innerWidth;
		browser_height = document.innerHeight;

		browser_name = 'Firefox'	/* SET VARIABLE */
		browser_version = b_version	/* SET VARIABLE */
	} else {
		screen_width = screen.width;
		screen_height = screen.height;
		browser_width = 0;
		browser_height = 0;

		browser_name = '0'	/* SET VARIABLE */
		browser_version = 0	/* SET VARIABLE */
	}

	if (Other_Info) {
		Other_Info = Other_Info
	} else {
		Other_Info = ''
	}
	//document.login_form.screen_width.value = screen_width 
	createCookie('screen_width',screen_width,7)
	
	//document.login_form.screen_height.value = screen_height
	createCookie('screen_height',screen_height,7)
	
	//document.login_form.browser_width.value = browser_width
	createCookie('browser_width',browser_width,7)
	
	//document.login_form.browser_height.value = browser_height
 	createCookie('browser_height',browser_height,7)
			 $.post("/screen/screen_info_save.php"+Other_Info, { 
						AllInfo: browser_info_all,
					  Version: browser_version,
						Browser: browser_name,
					  screen_width: screen_width,
						screen_height: screen_height,
					  browser_width: browser_width,
						browser_height: browser_height,
					  OpSystem: op_system, 
						PageID: PageID
			})
	}
/* END BROWSER SAVE */
