function $() {
	var elements = new Array();
	for (var i = 0; i < arguments.length; i++) {
		var element = arguments[i];
		if (typeof element == 'string')
			element = document.getElementById(element);
		if (arguments.length == 1)
			return element;
		elements.push(element);
	}
	return elements;
}

function isEmpty(s) {
	return ((s == null) || (s.length == 0))
}

function LTrim(value) {
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");
}

function RTrim(value) {
	var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");
}

function trim(value) {
	return LTrim(RTrim(value));
}



function doLogin() {

	if (isEmpty($("i_username").value)) {
		$("i_username").focus();
		return false;
	}

	if (isEmpty($("i_password").value)) {
		$("i_password").focus();
		return false;
	}

	if (isEmpty($("i_accesscode").value)) {
		$("i_accesscode").focus();
		return false;
	}

	$("btn_login").disabled = true;
	return true;
}



function reloadSecuritycode() {

	img = $('securitycode');
	img.src = 'securitycode.php?' + Math.random();
}




function changeCountry(country){ 
	window.location.href="more.php?country=" + country; 
	return true; 
} 




function bookmark() {

	if (document.all) {
	window.external.AddFavorite('http://www.blindfoldedwives.com/', 'Blind Folded Wives');
	} else if (window.sidebar) {
	window.sidebar.addPanel('Blind Folded Wives', 'http://www.blindfoldedwives.com/', '');
	}
}
