
; /* Start:/bitrix/templates/gos_bitrix/components/bitrix/system.auth.form/auth/script.js*/
var authFormWindow = {

	form_window: null,
	overlay : null,
	form_window_id : "login-form-window",
	login_field_id : "auth-user-login",

	ShowLoginForm : function()
	{
		if (!this.form_window)
		{
			this.form_window = document.getElementById(this.form_window_id);
			if (!this.form_window)
				return false;

			try {document.body.appendChild(this.form_window);}
			catch (e){}
		}

		this.form_window.style.display = "block";

		if (this.GetOpacityProperty())
			this.CreateOverlay();

		var loginField = document.getElementById(this.login_field_id);
		if (loginField)
		{
			loginField.focus();
			loginField.select();
		}
		return false;
	},

	CloseLoginForm : function()
	{
		if (this.form_window)
			this.form_window.style.display = "none";

		if (this.overlay)
			this.overlay.style.display = "none";

		return false;
	},

	CreateOverlay : function()
	{
		if (!this.overlay)
		{
			this.overlay = document.body.appendChild(document.createElement("DIV"));
			this.overlay.className = "login-form-overlay";

			var _this = this;
			this.overlay.onclick = function() {_this.CloseLoginForm()};
		}

		var windowSize = this.GetWindowScrollSize();

		this.overlay.style.width = windowSize.scrollWidth + "px";
		this.overlay.style.height = windowSize.scrollHeight + "px";
		this.overlay.style.display = "block";
	},

	GetOpacityProperty : function()
	{
		if (typeof document.body.style.opacity == 'string')
			return 'opacity';
		else if (typeof document.body.style.MozOpacity == 'string')
			return 'MozOpacity';
		else if (typeof document.body.style.KhtmlOpacity == 'string')
			return 'KhtmlOpacity';
		else if (document.body.filters && navigator.appVersion.match(/MSIE ([\d.]+);/)[1]>=5.5)
			return 'filter';

		return false;
	},

	GetWindowScrollSize : function(pDoc)
	{
		var width, height;
		if (!pDoc)
			pDoc = document;

		if ( (pDoc.compatMode && pDoc.compatMode == "CSS1Compat"))
		{
			width = pDoc.documentElement.scrollWidth;
			height = pDoc.documentElement.scrollHeight;
		}
		else
		{
			if (pDoc.body.scrollHeight > pDoc.body.offsetHeight)
				height = pDoc.body.scrollHeight;
			else
				height = pDoc.body.offsetHeight;

			if (pDoc.body.scrollWidth > pDoc.body.offsetWidth || 
				(pDoc.compatMode && pDoc.compatMode == "BackCompat") ||
				(pDoc.documentElement && !pDoc.documentElement.clientWidth)
			)
				width = pDoc.body.scrollWidth;
			else
				width = pDoc.body.offsetWidth;
		}
		return {scrollWidth : width, scrollHeight : height};
	}
}

var authPreloadImages = ["close.gif", "login-form-header-bg.gif"];
for (var imageIndex = 0; imageIndex < authPreloadImages.length; imageIndex++)
{
	var imageObj = new Image();
	imageObj.src = "/bitrix/templates/modern/components/bitrix/system.auth.form/auth/images/" + authPreloadImages[imageIndex];
}
authPreloadImages = null;
/* End */
;
; /* Start:/bitrix/components/bitrix/asd.slider.text/templates/.default/script.js*/
if (typeof requestInterval != 'function') {
	window.requestInterval = function(fn, delay) {
		return setInterval(fn, delay);
	}
}
if (typeof clearRequestInterval != 'function') {
	window.clearRequestInterval = function(handle) {
		return clearInterval(handle);
	}
}

$(document).ready(function() {

	//Set Default State of each portfolio piece
	$('#asd_slider_paging').show();
	$('#asd_slider_paging a:first').addClass('active');

	//Get size of images, how many there are, then determin the size of the image reel.
	var imageWidth = $('.asd_slider_window').width();
	var imageSum = $('.asd_slider_image_reel img').size();
	var imageReelWidth = imageWidth * imageSum;

	//Adjust the image reel to its new size
	$('.asd_slider_image_reel').css({'width' : imageReelWidth});

	//Paging + Slider Function
	rotate = function(){
		var triggerID = $active.attr('rel') - 1; //Get number of times to slide
		var image_reelPosition = triggerID * imageWidth; //Determines the distance the image reel needs to slide

		$('#asd_slider_paging a').removeClass('active'); //Remove all active class
		$active.addClass('active'); //Add active class (the $active is declared in the rotateSwitch function)

		//Slider Animation
		$('.asd_slider_image_reel').animate({
			left: -image_reelPosition
		}, 500 );

		//Change text
		$('#asd_slider_overtext .asd_slider_title').html($('#asd_slider_title_' + triggerID).html());
		$('#asd_slider_overtext .asd_slider_title').attr('href', $('#asd_slider_link_' + triggerID).html());
		$('#asd_slider_overtext .asd_slider_des').html($('#asd_slider_text_' + triggerID).html());
		$('#asd_slider_overtext .asd_slider_des').attr('href', $('#asd_slider_link_' + triggerID).html());
	};

	//Rotation + Timing Event
	rotateSwitch = function(){
		play = requestInterval(function(){ //Set timer - this will repeat itself every 3 seconds
			$active = $('#asd_slider_paging a.active').next();
			if ( $active.length === 0) { //If paging reaches the end...
				$active = $('#asd_slider_paging a:first'); //go back to first
			}
			rotate(); //Trigger the paging and slider function
		}, timerSpeed); //Timer speed in milliseconds (3 seconds)
	};

	rotateSwitch(); //Run function on launch

	//On Hover
	$('.asd_slider_image_reel').hover(function() {
		clearRequestInterval(play); //Stop the rotation
	}, function() {
		rotateSwitch(); //Resume rotation
	});
	$('#asd_slider_overtext').hover(function() {
		clearRequestInterval(play); //Stop the rotation
	}, function() {
		rotateSwitch(); //Resume rotation
	});

	//On Click
	$('#asd_slider_paging a').click(function() {
		$active = $(this); //Activate the clicked paging
		//Reset Timer
		clearRequestInterval(play); //Stop the rotation
		rotate(); //Trigger rotation immediately
		rotateSwitch(); // Resume rotation
		return false; //Prevent browser jump to link anchor
	});

});
/* End */
;; /* /bitrix/templates/gos_bitrix/components/bitrix/system.auth.form/auth/script.js*/
; /* /bitrix/components/bitrix/asd.slider.text/templates/.default/script.js*/
