function win_open(win_name, where, type_val) {
	var win_type = new Array();

	win_type[0]="menubar=no,scrollbars=yes,resizable=yes,width=640,height=500";	
	win_type[1]="menubar=no,scrollbars=yes,resizable=yes,width=725,height=450";
	// warranty question form
	win_type[2]="menubar=no,scrollbars=yes,resizable=yes,width=600,height=450";
	// floorplan popup
	win_type[3]="menubar=no,scrollbars=yes,resizable=yes,width=725,height=500";
	// listing details popup	
	win_type[4]="menubar=yes,scrollbars=yes,resizable=yes,width=620,height=500";
	// promo popup
	win_type[5]="menubar=yes,scrollbars=no,resizable=no,width=350,height=500";
	// video popup
	win_type[6]="menubar=no,scrollbars=no,resizable=no,width=650,height=480";
	// video popup
	win_type[7]="menubar=yes,scrollbars=yes,resizable=yes,width=600,height=500";
	// 2-for-1 promo popup
	win_type[8]="menubar=yes,scrollbars=yes,resizable=yes,width=725,height=600";

	win_name = window.open(where, win_name, win_type[type_val]);
	try {
		win_name.focus();
	}
	catch(e) {}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
	winName = window.open(theURL,winName,features);

	winName.focus();
}

function clistON(){
	banxpos = (screen.width/2) + 266;
	document.getElementById("clist").style.left = banxpos + "px";
	document.getElementById("clist").style.visibility =  'visible';
}

function clistOFF(){
	document.getElementById("clist").style.visibility =  'hidden';
}

function sizeFPwin() {
	window.resizeTo(740,750);
	moveTo(25,25)
}

function sizeELVwin() {
	window.resizeTo(540,600);
	moveTo(25,25)
}

function set_cookie(name, hours, domain, value) {
	if (hours) exp = new Date((new Date().getTime() + hours * 3600000));
	else exp = null;

	document.cookie = name + '=' + value + '; expires=' + exp.toGMTString() + ';';
}

function get_cookie(name) {
	index = document.cookie.indexOf(name);
	if (index != -1) { 
		countbegin = (document.cookie.indexOf("=", index) + 1);
		countend = document.cookie.indexOf(";", index);

		if (countend == -1) {
			countend = document.cookie.length;
		}

		if (document.cookie.substring(countbegin, countend) != 'leads pop up window') {
			register_win_open('century_leads', 'http://www.centurycommunities.com/register_form.htm', 0);
		}
	}
	else {
		set_cookie('century_leads', 48, 'centurycommunities.com', 'leads pop up window');
		register_win_open('century_leads', 'http://www.centurycommunities.com/register_form.htm', 0);
	}
}

function register_win_open(win_name, where, type_val) {

	win_name = window.open(where, win_name, "width=450,height=475,left=100,top=100,RESIZABLE,STATUS");

	try {
		win_name.focus();
	}
	catch(e) {}
}


