var $expire = new Date();
$expire.setMilliseconds($expire.getMilliseconds()+(60*60*24*90*1000));
var $cookie_expire = $expire.toGMTString();
var $cookie_domain = location.host;

function abre_ventana(elurl,nombre,dets) { 
	// pmadley@designet.com.mx - muy simple eh :-)
	window.open(elurl,nombre,dets);
	}


function box_click ($id) {
	var $btitle, $bcontent, $bimg;
	if (document.all && document.getElementById) {			//IE5
		$btitle = document.all($id).style;
		$bcontent = document.all($id+'c').style;
		$img = document.all($id+'i');
	} else if (!document.all && document.getElementById) {	//NS6
		$btitle = document.getElementById($id).style;
		$bcontent = document.getElementById($id+'c').style;
		$img = document.getElementById($id+'i');
	} else {	// !IE5 && !NS6
		return false;
	}
	if ($bcontent.visibility == 'hidden') {
		$bcontent.display = '';
		$bcontent.visibility = 'visible';
		$btitle.cursor = 'pointer';
		$img.src = 'images/arrow-down.gif';
		set_cookie('box['+$id+']',1,$cookie_expire,'/',$cookie_domain);
	} else {
		$bcontent.display = 'none';
		$bcontent.visibility = 'hidden';
		$btitle.cursor = 'pointer';
		$img.src = "images/arrow-right.gif";
		set_cookie('box['+$id+']',0,$cookie_expire,'/',$cookie_domain);
	}
}
function set_cookie ($name, $value, $expires, $path, $domain, $secure) {
	document.cookie = $name + '=' + escape($value) + (($expires) ? '; expires=' + $expires : '') + (($path) ? '; path=' + $path : '') + (($domain) ? '; domain=' + $domain : '') + (($secure) ? '; secure' : '');
}
function PopUp ( url, name, width, height, center, resize, scroll, posleft, postop ) {
	if (posleft != 0) { x = posleft }
	if (postop  != 0) { y = postop  }
	if (!scroll) { scroll = 1 }
	if (!resize) { resize = 1 }
	if ((parseInt (navigator.appVersion) >= 4 ) && (center)) {
		X = (screen.width  - width ) / 2;
		Y = (screen.height - height) / 2;
	}
	if (scroll != 0) { scroll = 1 }
	var extra = 'width=' + width + ', height=' + height + ', top=' + Y + ', left=' + X + ', resizable=' + resize + ', scrollbars=' + scroll + ', location=no, directories=no, status=no, menubar=no, toolbar=no';
	window.open( url, name, extra );
}
function maxchars(spanky) {
	var maxChars = 400;
	var msg = spanky.note.value;
	charsLeft = maxChars-msg.length;
	spanky.sizebox.value = charsLeft;
	if (charsLeft == 0 || charsLeft < 0) { 
		return false; 
	} else { 
		return true; 
	}
}