﻿function Occ56 () {
	//Закругление у картинок статьи
	this.roundStbImages = function (containerId) {
		var smalls = $('#'+containerId+' .small_image');
		for (var a=0; a<smalls.length; a++) {
			this.roundDiv(smalls[a]);
		}
		var large = $('#'+containerId+' .large_image');;
		this.roundDiv(large[0]);
	}
	//Закругление картинок у списка статей
	this.roundStbsListImages = function (containerId) {
		var images = $('#'+containerId+' .image');
		for (var a=0; a<images.length; a++) {
			this.roundDiv(images[a]);
		}
	}
	this.roundDiv = function (div) {
		//Подрисовывание закруглённых уголков.
		div.innerHTML =
			'<div class="Rc_lt"></div><div class="Rc_rt"></div>' +
			'<div class="Rc_lb"></div><div class="Rc_rb"></div>' +
			div.innerHTML;
	}
	this.processTextInputField = function (elemId) {
		var elem = document.getElementById(elemId);
		elem.onfocus = function () {this.initialValue=this.value; this.value='';}
		elem.onkeypress = function () {this.keyPressed=true;}
		elem.onblur = function () {if (!this.keyPressed) this.value=this.initialValue;}
	}
	this.showLongContent = function (tailId, linkId) {
		var tail = document.getElementById(tailId);
		var link = document.getElementById(linkId);
		tail.style.display = 'inline';
		link.style.display = 'none';
	}
	this.showAdminWindow = function (url) {
		window.open(url, 'Одминка', 'width=800,height=600,toolbar=no,status=no,menubar=no,scrollbars=yes');
	}
	this.showLargeImage = function (url) {
		window.open(url, 'Фото', 'width=700,height=500,toolbar=no,status=no,menubar=no,scrollbars=no');
	}
	this.runUserPinger = function (objectName, url, delay) {
		this.pingUser(url);
		setInterval(objectName+'.pingUser("'+url+'")', delay);
	}
	this.pingUser = function (url) {
		$.get(url)
	}
}


