function ifHide(showID, hideID) {
	if ( showID && document.getElementById(showID)) {
		document.getElementById(showID).style.display = document.getElementById(showID).style.display == 'block'
			? 'none'
			: 'block';
	}

	if ( hideID && document.getElementById(hideID)) {
		document.getElementById(hideID).style.display = document.getElementById(hideID).style.display == 'block'
			? 'none'
			: 'block';
	}

	return false;
}

function showRecommends() {
	var url = document.getElementById('recommendsURL');
	var div = document.getElementById('recommendsDIV');
	if ( url && div ) {
		if ( div.style.display == 'block' ) {
			div.style.display = 'none';
			url.innerHTML = 'Показать рекомендации';
		}
		else {
			div.style.display = 'block';
			url.innerHTML = 'Убрать рекомендации';
		}
	}

	return false;
}

function openImage(url, width, height) {
	window.open('/image.php?' + url, '_blank', 'width=' + width + ', height=' + height + ', titlebar=no, toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=no');
}

function submitOnce(theform) {
	for ( i = 0; i < theform.length; i++ ) {
		var ob = theform.elements[i]
		ob.type.toLowerCase() == "submit" || ob.type.toLowerCase() == "reset"
			? ob.disabled = true
			: null;
		ob.id == "fsubmit"
			? ob.value = "javascript:tested"
			: null;
	}
}

function getHttpObject() {
	var xmlhttp;
	/*@cc_on
		@if (@_jscript_version >= 5)
		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				xmlhttp = new
				ActiveXObject("Microsoft.XMLHTTP");
			} catch (E) {
				xmlhttp = false;
			}
		}
		@else
			xmlhttp = false;
	@end @*/
	if ( !xmlhttp && typeof XMLHttpRequest != 'undefined') {
		try {
			xmlhttp = new XMLHttpRequest();
		} catch (e) {
			xmlhttp = false;
		}
	}

	return xmlhttp;
}