<!--

isIE = (navigator.appName.indexOf('Microsoft') == -1) ? false : true;
isMozilla = (navigator.appName.indexOf('Netscape') == -1) ? false : true;

stopSlideScrollBarConstant = 0;
menuBlocksAmount = 0;
lastCommentsObject1 = '';
lastCommentsObject2 = '';
lastVacancyObject = '';
lastVacancyPosition = '';
lastGalleryObject = '';
lastGalleryPhoto = '';
lastDropDownList = '';


function underlineTopMenu(obj) {

	var image = obj.parentNode.getElementsByTagName('img')[0];

	image.className = (image.className == '') ? 'underline' : '';

}

function changeAmount(obj, number) {
	if (document.all[obj].getAttribute('value') == 1 && number == -1) {
		return;
	}
	persons=Number(document.all[obj].getAttribute('value')) + number;
	document.all[obj].setAttribute('value', persons);
	document.getElementById("calculator_amount").value=persons;
	recountCalculatorSum();
}

function loadMenu(e) {
	if (isIE) {
		var divsArr = document.body.getElementsByTagName('div');
		
		for (var a = 0, b = divsArr.length; a < b; a++) {
			if (divsArr[a].className == 'container_calculator_popup_1') {

				divsArr[a].onmouseover = function() {this.className = 'container_calculator_popup_2'}
				divsArr[a].onmouseout = function() {this.className = 'container_calculator_popup_1'}
			}
		}
		var divsArr2 = document.body.getElementsByTagName('span');

		for (var a = 0, b = divsArr2.length; a < b; a++) {
			if (divsArr2[a].className == 'ingredients_container_1') {
				divsArr2[a].onmouseover = function() {this.className = 'ingredients_container_2'}
				divsArr2[a].onmouseout = function() {this.className = 'ingredients_container_1'}
			}
		}
	}
}

function roloverSubmenu(obj, hide, show) {
	var parent = obj.parentNode.parentNode.parentNode;
	if (parent.tagName.toLowerCase() != 'td') {

		parent = parent.parentNode;

	}
	var divsArr = parent.getElementsByTagName('div');
	divsArr[hide].style.display = 'none';
	divsArr[show].style.display = '';
}

function getCommentsParentObject(obj) {
	var parent = obj.parentNode;
	
	while (parent.tagName.toLowerCase() != 'td') {
		parent = parent.parentNode;
	}
	return parent;
}

function loadMap(e) {
	if (isIE) {
		var divsArr = document.all.map_1.getElementsByTagName('div');
		for (var a = 0, b = divsArr.length; a < b; a++) {
			if (divsArr[a].className == 'map_1') {
				divsArr[a].onmouseover = function() {this.className += ' active_map'}
				divsArr[a].onmouseout = function() {this.className = 'map_1'}
			}
		}
	}
}

function expandVacancy(obj, div_position, id) {
	var div = obj.getElementsByTagName('div')[1];
	
	if (div.style.display == 'none') {

		if (lastVacancyObject) {

			expandVacancy(lastVacancyObject, lastVacancyPosition, id);

		}
		div.style.display = '';
		document.all.vacancy_popup.style.top = 47 * div_position - 47;
		document.all.vacancy_popup.style.display = '';
		document.all.vacancy_id.value = id;
		lastVacancyObject = obj;
		lastVacancyPosition = div_position;
	}
	else {
		div.style.display = 'none';
		document.all.vacancy_popup.style.display = 'none';
		lastVacancyObject = '';
	}
}

function showMapAddress(id, cmd) {
	if (cmd == 'show') {
		document.all['map_address_' + id].className += ' active_map';
	}
	else {
		document.all['map_address_' + id].className = 'map_1';
	}
}

function loadGallery(obj) {
	if (obj.className == 'gallery_list_1') {
		if (lastGalleryObject) {
			loadGallery(lastGalleryObject);
		}
		obj.className += ' gallery_list_1_active';
		lastGalleryObject = obj;
	}
	else {
		obj.className = 'gallery_list_1';
		lastGalleryObject = '';
	}
}

function loadPhotos(e) {

	if (isIE) {
		var divsArr = document.all.photos_container.getElementsByTagName('img');
		for (var a = 0, b = divsArr.length; a < b; a++) {
			divsArr[a].onmouseover = function() {this.parentNode.className += ' photo_1_active'}
			divsArr[a].onmouseout = function() {this.parentNode.className = this.parentNode.className.replace(' photo_1_active', '')}
		}
	}
}

function highlightArrow(obj, cmd) {
	var imagesArr = obj.getElementsByTagName('img');

	if (cmd == 'over') {
		imagesArr[0].style.display = 'none';
		imagesArr[1].style.display = '';
	}
	else {
		imagesArr[0].style.display = '';
		imagesArr[1].style.display = 'none';
	}
}

function showPhoto(obj, id) {
	if (lastGalleryPhoto) {

		lastGalleryPhoto.className = 'photo_1';

	}

	obj.className += ' photo_1_clicked';
	document.all.gallery_photo_container.getElementsByTagName('td')[0].innerHTML = '<img src="' + obj.getAttribute('photo_id') + '"><br>';
	document.all.gallery_photo_container.style.height = document.all.gallery_photo_container.getElementsByTagName('td')[0].getElementsByTagName('img')[0].height;

	lastGalleryPhoto = obj;
	
	//--RK
	if (lastGalleryPhoto.getAttribute('id')==startphoto){
		document.getElementById('right_slider').style.display='block';
		document.getElementById('left_slider').style.display='none';
	}
	else if (lastGalleryPhoto.getAttribute('id')==endphoto-1){
		document.getElementById('left_slider').style.display='block';
		document.getElementById('right_slider').style.display='none';
	}
	else{
		document.getElementById('left_slider').style.display='block';
		document.getElementById('right_slider').style.display='block';
	}
	//--!RK
	
}

//--RK
function showPhotoInvite(obj) {
	if (lastGalleryPhoto)
		lastGalleryPhoto.className = 'photo_1';
	obj.className += ' photo_1_clicked';
	document.all.gallery_photo_container.innerHTML = '<img src="' + obj.getAttribute('photo_id') + '"><br>';
	document.all.invite_image.value=obj.getAttribute('photo_id');
	setCookie('image',obj.getAttribute('photo_id'));
	lastGalleryPhoto = obj;
}

function setCookie(name,value){
	document.cookie=name+"="+value;
}
function setCookieExpires(name,value,expires){
	document.cookie=name+"="+value+"; expires="+expires;
}
function setCookiePath(name,value){
	document.cookie=name+"="+value+"; path=/menu/;";
}
function setCookieExpiresPath(name,value,expires){
	document.cookie=name+"="+value+"; expires="+expires+"; path=/menu/;";
}
function getCookie(name){
	var cookie = " " + document.cookie;
	var search = " " + name + "=";
	var setStr = null;
	var offset = 0;
	var end = 0;
	if (cookie.length > 0) {
		offset = cookie.indexOf(search);
		if (offset != -1) {
			offset += search.length;
			end = cookie.indexOf(";", offset)
			if (end == -1) {
				end = cookie.length;
			}
			setStr = unescape(cookie.substring(offset, end));
		}
	}
	return setStr;
}
function checkInviteForm(preview){
	var Fields=new Array();
	Fields[0]='time';
	Fields[1]='name1';
	Fields[2]='name2';
	Fields[3]='email';
	Fields[4]='text'; 
	var Object=null;
	var FlagForm=true;
	for(i=0;i<Fields.length;i++){
		Object=eval("document.InviteForm."+Fields[i]);
		if(Object.value==""){
			showField(Fields[i]);
			FlagForm=false;
		}else{
			if(Fields[i]=="email"){
				if(checkEMail(Object.value)!=true){
					showField(Fields[i]);
					FlagForm = false;
				}
			}
		}
	}
	if(FlagForm==false)
		return false;
	else{
		if (preview==false)
			document.getElementById('InviteForm').submit();
 		return true;
	}
}

function checkEMail(email){
	var FlagEmail=false;
  	reg=new RegExp('^([a-zA-Z0-9-._]+)(@)([a-zA-Z0-9-.]+)(.)([a-zA-Z]{2,4})$');
  	FlagEmail=reg.test(email);
	return FlagEmail;
}
function checkPhone(phone){
	var FlagPhone=false;
  	reg=new RegExp('^[0-9-\+]+$');
  	Flag=reg.test(phone);
	return Flag;
}

function showField(field){
	var FormField=eval("document.InviteForm."+field);
	FormField.style.backgroundColor = "#eeeeee";
	FormField.style.color = "#000000";
}

function clearField(field){
	field.style.backgroundColor = "#ffffff";
	field.style.color = "#000000";
}
//--!RK

function slidePhoto(direction) {
	var divsArr = document.all.photos_container.getElementsByTagName('div');

	if ((direction == 'left' && divsArr[0].className.indexOf('photo_1_clicked') != -1) || (direction == 'right' && divsArr[divsArr.length - 1].className.indexOf('photo_1_clicked') != -1)) {

		return;

	}

	for (var a = 0, b = divsArr.length; a < b; a++) {
		if (divsArr[a].className.indexOf('photo_1_clicked') != -1) {

			var nextDiv = (direction == 'left') ? divsArr[a - 1] : divsArr[a + 1];

			nextDiv.className += ' photo_1_clicked';
			document.all.gallery_photo_container.getElementsByTagName('td')[0].innerHTML = '<img src="' + nextDiv.getAttribute('photo_id') + '"><br>';
			lastGalleryPhoto.className = 'photo_1';
			lastGalleryPhoto = nextDiv;
			
			//--RK
			if (lastGalleryPhoto.getAttribute('id')==startphoto){
				document.getElementById('left_slider').style.display='none';
			}
			else if (lastGalleryPhoto.getAttribute('id')==endphoto-1){
				document.getElementById('right_slider').style.display='none';
			}
			else{
				document.getElementById('left_slider').style.display='block';
				document.getElementById('right_slider').style.display='block';
			}
			//--!RK

			return;
		}
	}
}

function loadDropdown(e) {

	var divsArr = document.all.form_send_1.getElementsByTagName('div');
	
	for (var a = 0, b = divsArr.length; a < b; a++) {
		if (divsArr[a].className == 'drop_down_1') {
			var divsArr2 = divsArr[a].getElementsByTagName('div');
			
			for (var c = 0, d = divsArr2.length; c < d; c++) {
				if (isIE) {
					divsArr2[c].onmouseover = function() {this.className = 'drow_down_active'}
					divsArr2[c].onmouseout = function() {this.className = ''}
				}
				divsArr2[c].onclick = function() {
					document.all[this.getAttribute('field_name') + '_id'].value = this.getAttribute('element_id');
					setCookie(this.getAttribute('field_name')+'_id',this.getAttribute('element_id'));
					document.all[this.getAttribute('field_name') + '_name'].value = this.innerHTML;
					document.all['form_' + this.getAttribute('field_name')].style.visibility = 'hidden'
				}
				//--RK
				if (c==0)
					setCookie(divsArr2[c].getAttribute('field_name')+'_id',divsArr2[c].getAttribute('element_id'));
				//--!RK
			}
		}
	}
}
function checkDropDownList(event) {

	if (lastDropDownList) {

		var srcEl = (navigator.appName == 'Microsoft Internet Explorer') ? event.srcElement : event.target;

		while (srcEl.tagName.toLowerCase() != 'body') {

			if (srcEl.getAttribute('dropdown') == lastDropDownList) {

				return;

			}

			srcEl = srcEl.parentNode;

		}

		document.all['form_' + lastDropDownList].style.visibility = 'hidden';

	}

}
function showDropdownList(obj,event) {
	document.all['form_' + obj].style.visibility = 'visible';
	checkDropDownList(event);
	lastDropDownList = obj;
}

function loadCompanySubmenu(e) {
	document.all.company_submenu.onmouseover = function() {this.getElementsByTagName('table')[0].style.display = ''}
	document.all.company_submenu.onmouseout = function() {this.getElementsByTagName('table')[0].style.display = 'none'}
}

function expandTestimonial(obj) {
	var divsArr = obj.parentNode.getElementsByTagName('div');

	if (divsArr[2]) {
		divsArr[2].style.display = '';
	}
}

Object.prototype.attachEvent = function (sEvent, fnHandler, bUseCapture) {
	this.addEventListener(sEvent.substring(2), fnHandler, bUseCapture);
}

Object.prototype.detachEvent = function (sEvent, fnHandler, bUseCapture) {
	this.removeEventListener(sEvent.substring(2), fnHandler, bUseCapture);
}

//D2S-JAVA

function adjustIframDivWidth(intId) {
	
	var intOuterWidth = document.getElementById('table_menu_block_' + intId).offsetWidth;
	document.getElementById('iframe_div_' + intId).style.width = intOuterWidth;
	document.getElementById('iframe_block_' + intId).style.width = intOuterWidth;
	return false;
}

function switchMenuBlock(obj, block_id) {
	var imagesArr = obj.getElementsByTagName('img');
			
	adjustIframDivWidth(block_id);
	
	if (imagesArr[0].style.display == 'none') {
		imagesArr[1].style.display = 'none';
		imagesArr[0].style.display = '';
		document.all['iframe_block_' + block_id].style.display = '';
		obj.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.cells[1].style.display = '';
		//--RK
		OpenBlocks[block_id]=true;
		//--!RK
	} else {
		imagesArr[0].style.display = 'none';
		imagesArr[1].style.display = '';
		document.all['iframe_block_' + block_id].style.display = 'none';
		obj.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.cells[1].style.display = 'none';
		//--RK
		OpenBlocks[block_id]=false;
		closeWindow();
		//--!RK
	}
	
	var objMenu_right_border = document.getElementById('menu_right_border_' + block_id);
	if(objMenu_right_border != null){
		var intOuterWidth = document.getElementById('table_menu_block_' + block_id).offsetWidth -10;
		objMenu_right_border.style.left = intOuterWidth;
	}
	manageResize();
	return false;
}

function manageResize() {

	if (PageID==12 || PageID==13 || PageID==14 || PageID==15 || PageID==17){
		resizeScrollbar(30);
		for(key in OpenBlocks){
			if (!isNaN(key)){
				resizeScrollbar(key);
			}
		}
	}
	
	
	adjustAllIframDivs();
	
	var maxPercentLeft = 200;
	var maxPercentRight = 500;
	var max = 1400;
	var min = 970;
	var minResolution = 1260;
	var contentMinWidth = 880;
	var clientWidth = document.body.clientWidth;
	if (clientWidth < minResolution) {

		var percent = (clientWidth - contentMinWidth) / 2;

	}
	else {

		var percent = clientWidth / 100 * 15;

	}

	if (percent >= maxPercentLeft) {

		var left = 0;
		var right = '100%';

	}
	else {

		var left = -maxPercentLeft + percent;
		//var right = document.body.scrollWidth - percent - 435;
		var right = document.body.scrollWidth - percent - 400;

	}
	//rand=Math.ceil(Math.random()*3);
	//document.all.left_background.style.backgroundImage = 'url(/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/backgrounds/main_left_'+rand+'.jpg)';
	//document.all.right_background.style.backgroundImage = 'url(/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/backgrounds/main_right_'+rand+'.jpg)';
	//document.all.left_background.style.backgroundRepeat = 'no-repeat';
	//document.all.right_background.style.backgroundRepeat = 'no-repeat';
	document.all.left_background.style.backgroundPosition = left + ' 0px';
	document.all.right_background.style.backgroundPosition = right + ' 0px';

	return false;
}
function manageResizeOnLoad() {

	if (PageID==12 || PageID==13 || PageID==14 || PageID==15 || PageID==17){
		resizeScrollbar(30);
	}
	
	adjustAllIframDivs();
	
	var maxPercentLeft = 200;
	var maxPercentRight = 500;
	var max = 1400;
	var min = 970;
	var minResolution = 1260;
	var contentMinWidth = 880;
	var clientWidth = document.body.clientWidth;

	if (clientWidth < minResolution) {

		var percent = (clientWidth - contentMinWidth) / 2;

	}
	else {

		var percent = clientWidth / 100 * 15;

	}

	if (percent >= maxPercentLeft) {

		var left = 0;
		var right = '100%';

	}
	else {

		var left = -maxPercentLeft + percent;
		//var right = document.body.scrollWidth - percent - 435;
		var right = document.body.scrollWidth - percent - 400;

	}
	rand=Math.ceil(Math.random()*3);
	document.all.left_background.style.backgroundImage = 'url(/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/backgrounds/main_left_'+rand+'.jpg)';
	document.all.right_background.style.backgroundImage = 'url(/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/backgrounds/main_right_'+rand+'.jpg)';
	document.all.left_background.style.backgroundRepeat = 'no-repeat';
	document.all.right_background.style.backgroundRepeat = 'no-repeat';
	document.all.left_background.style.backgroundPosition = left + ' 0px';
	document.all.right_background.style.backgroundPosition = right + ' 0px';

	return false;
}


function adjustAllIframDivs()
{
	var arrAllTables = document.getElementsByTagName('table');
	for (var i=0;i<arrAllTables.length;i++) {
		
		if(arrAllTables[i].id.indexOf("table_menu_block_") != -1)
		{	
			var intId = arrAllTables[i].id.replace(/table_menu_block_/,"");
			var intOuterWidth = document.getElementById('table_menu_block_' + intId).offsetWidth-5;
			document.getElementById('iframe_div_' + intId).style.width = intOuterWidth;
			document.getElementById('iframe_block_' + intId).style.width = intOuterWidth;
			
			var objMenu_right_border = document.getElementById('menu_right_border_' + intId);
			if(objMenu_right_border != null)
			{
				objMenu_right_border.style.left = intOuterWidth -10;
			}
		}
	}
	return false;
}
/*
function resizeScrollbar(id) {
	var minSliderAreaWidthPixels = 565;
	var minBlockWidth = 855;
	var documentWidth = document.body.scrollWidth;
	var sides = documentWidth / 100 * 15 * 2;
	var block_width = documentWidth - sides - 22;

	if (block_width < minBlockWidth) 
	{
		block_width = minBlockWidth;
	}

	var DivWidth = document.getElementById('iframe_block_' + id).offsetWidth;
	var TableWidth = document.getElementById('iframe_block_table_' + id).offsetWidth;
	var ScrollBarWidth = ((DivWidth-60)/TableWidth)*DivWidth;
	var intMaxWidthScroller = document.getElementById('iframe_' + id + '_div').offsetWidth;

	if(ScrollBarWidth <= intMaxWidthScroller)
	{
		document.getElementById('iframe_' + id + '_slider').style.width = ScrollBarWidth + "px";
		document.getElementById('iframe_' + id + '_slider').style.display = '';
		document.getElementById("iframe_" + id + "_slider_left_area").style.width = "0px";
		document.getElementById("iframe_" + id + "_slider_right_area").style.width = (intMaxWidthScroller - ScrollBarWidth-30) +"px";
	}
	else
	{
		document.getElementById('iframe_' + id + '_slider').style.width = "0px";
		document.getElementById('iframe_' + id + '_slider').style.display = 'none';
		document.getElementById("iframe_" + id + "_slider_left_area").style.width = "0px";;
		document.getElementById("iframe_" + id + "_slider_right_area").style.width = "0px";
	}
		
	return false;
}
 */
function resizeScrollbar(id) {

	document.getElementById('iframe_' + id + '_div' ).parentNode.parentNode.style.display =  '';
	var DivWidth = document.getElementById('iframe_block_' + id).offsetWidth;
	var TableWidth = document.getElementById('iframe_block_table_' + id).offsetWidth;
	var ScrollBarWidth = ((DivWidth-240)/TableWidth)*DivWidth-82;
	if (ScrollBarWidth<100) {
		ScrollBarWidth = 100;
	}
	var intMaxWidthScroller = document.getElementById('iframe_' + id + '_div').offsetWidth-60;	
		//console.log(ScrollBarWidth+"|"+intMaxWidthScroller+"|"+id);
	if(intMaxWidthScroller==0)
	return false;
	if(ScrollBarWidth <= intMaxWidthScroller)
	{
		document.getElementById('iframe_' + id + '_slider').style.width = ScrollBarWidth + "px";
		document.getElementById('iframe_' + id + '_slider').style.display = '';
		document.getElementById("iframe_" + id + "_slider_left_area").style.width = "0px";
		var strSliderLeftAreaWidth = (intMaxWidthScroller - ScrollBarWidth-30);
		if(strSliderLeftAreaWidth > 0){
			document.getElementById("iframe_" + id + "_slider_right_area").style.width = strSliderLeftAreaWidth;
		}
		
	}
	else
	{
		//alert(ScrollBarWidth);
		//alert(intMaxWidthScroller);
		document.getElementById('iframe_' + id + '_slider').style.width = "0px";
		document.getElementById('iframe_' + id + '_slider').style.display = 'none';
		document.getElementById("iframe_" + id + "_slider_left_area").style.width = "0px";;
		document.getElementById("iframe_" + id + "_slider_right_area").style.width = "0px";
		document.getElementById('iframe_' + id + '_div' ).parentNode.parentNode.style.display =  'none';
	}
		
	return false;
}


var str_gDirection ="";
var int_gID ="";
var obj_gActivatedInterval = null;

function fSlideScrollBar(strDirection,intID){
	document.onmouseup = fStopSlideScrollBar;
	str_gDirection = strDirection;
	int_gID = intID;
	fMoveProductDiv();
	obj_gActivatedInterval = window.setInterval("fMoveProductDiv()", 50);
	return false;
}

function fStopSlideScrollBar()
{
	str_gDirection = null;
  	int_gID = null;
	document.onmouseup = null;
	window.clearInterval(obj_gActivatedInterval);
	obj_gActivatedInterval= null;
	return false;
}

function fMoveProductDiv()
{
	if(int_gID != "")
	{
		var strProductDivName = "iframe_block_content_" + int_gID;
		var objVisibleDiv = document.getElementById(strProductDivName);
		var intDivMarginLeft = objVisibleDiv.style.marginLeft;
		intDivMarginLeft = intDivMarginLeft.replace(/px/,"");
	
		var intProductDivWidth = document.getElementById("iframe_block_table_" + int_gID).offsetWidth ;
		var intOverDivWidth = document.getElementById("iframe_block_" + int_gID).offsetWidth ;
		var intProductDivMax = (intProductDivWidth - intOverDivWidth)*-1;
	
		if(str_gDirection == "right")
		{
			intDivMarginLeft = parseInt(intDivMarginLeft) - intProductDivWidth * 0.001;
		}
		if(str_gDirection == "left")
		{
			intDivMarginLeft = parseInt(intDivMarginLeft) + intProductDivWidth * 0.001;
		}
		if(intDivMarginLeft > 0)
		{
			intDivMarginLeft = 0;
		}
		if(intDivMarginLeft < intProductDivMax )
		{
			intDivMarginLeft = intProductDivMax;
		}
		objVisibleDiv.style.marginLeft = intDivMarginLeft;
		
		var objScrollBar = document.getElementById("iframe_" + int_gID + "_slider");
		var objOverDiv = document.getElementById("iframe_" + int_gID + "_div");
		
		var intMaxWidth = parseInt(objOverDiv.offsetWidth) - parseInt(objScrollBar.offsetWidth) - 1;
		var intNewLeftWidth = (intDivMarginLeft/intProductDivMax)*intMaxWidth;
		objScrollBar.style.left = intNewLeftWidth + "px";
	
		var intMaxWidthScroller = (document.getElementById('iframe_' + int_gID + '_div').offsetWidth) - objScrollBar.offsetWidth;
		document.getElementById("iframe_" + int_gID + "_slider_left_area").style.width = (intNewLeftWidth) + "px";;
		document.getElementById("iframe_" + int_gID + "_slider_right_area").style.width = (intMaxWidthScroller - intNewLeftWidth-30) +"px";
	}
	return false;
}

var intXPosition=null;
var objElementActiveted=null;
var intLeftOffset = 0;
var intMaxWidth = 0;
var intIFrameId = 0;
var intMaxWidthRight = 0 ;

function fgetGlobalCoord(e)
{
	var e;
	if (!e)	{
		window.MouseX = event.clientX;
		window.MouseY = event.clientY;	
	} else {
		window.MouseX = e.pageX;
		window.MouseY = e.pageY;
	}
	return false;
}

function fMouseMoveScroll (e) {
	if(objElementActiveted == null)
		return false;
	
	fgetGlobalCoord(e);
	if(intXPosition == null)
	{
		intXPosition = window.MouseX;
	}
	else
	{
		var intNewXPosition = window.MouseX;
		
		var strTempName = objElementActiveted.id + "_left_area";
		objScroll_Left_Area = document.getElementById(strTempName);
		strTempName = objElementActiveted.id + "_right_area";
		objScroll_Right_Area = document.getElementById(strTempName);
		
		var intNewLeftWidth = intNewXPosition - intXPosition + intLeftOffset;
		
		if(intNewLeftWidth > intMaxWidth )
		{
			intNewLeftWidth = intMaxWidth;
		}
		if(intNewLeftWidth < 0)
		{
			intNewLeftWidth = 0;
		}
		objElementActiveted.style.left = intNewLeftWidth + "px";
		objScroll_Left_Area.style.width = intNewLeftWidth + "px";
		objScroll_Right_Area.style.width = (intMaxWidth - intNewLeftWidth) + "px";
		
		var strProductDivName = "iframe_block_content_" + intIFrameId;
		var objVisibleDiv = document.getElementById(strProductDivName);
		var intDivMarginLeft = objVisibleDiv.style.marginLeft;
		intDivMarginLeft = intDivMarginLeft.replace(/px/,"");
	
		var intProductDivWidth = document.getElementById("iframe_block_table_" + intIFrameId).offsetWidth ;
		var intOverDivWidth = document.getElementById("iframe_block_" + intIFrameId).offsetWidth ;
		var intProductDivMax = (intProductDivWidth - intOverDivWidth)*-1;
		
		intDivMarginLeft = intProductDivMax*(intNewLeftWidth/intMaxWidth);
		
		if(intDivMarginLeft > 0)
		{
			intDivMarginLeft = 0;
		}
		if(intDivMarginLeft < intProductDivMax )
		{
			intDivMarginLeft = intProductDivMax;
		}
		
		objVisibleDiv.style.marginLeft = intDivMarginLeft;
	}
	return false;
}

function fRemoveInitScrollBar(objElement)
{	
	objElementActiveted=null;
	intXPosition=null;
	intXPosition=null;
    objElementActiveted=null;
	intLeftOffset = null;
	intMaxWidth = null;
	intIFrameId = null;
	document.onmousemove = null;
	document.onmouseup = null;
	return false;
}

function fInitScrollBar(objElement,intFrameId)
{	
	objElementActiveted=objElement;
	
	var strTempName = objElementActiveted.id + "_left_area";
	objScroll_Left_Area = document.getElementById(strTempName);
	strTempName = "iframe_" + intFrameId + "_div";
	objOverDiv = document.getElementById(strTempName);
	intIFrameId = intFrameId;
	
	intLeftOffset = parseInt(objScroll_Left_Area.offsetWidth);
	intMaxWidth = parseInt(objOverDiv.offsetWidth) - parseInt(objElementActiveted.offsetWidth) - 30;
	document.onmousemove = fMouseMoveScroll;
	document.onmouseup = fRemoveInitScrollBar;
	return false;
}

function fMoveScrollBarByClick(intID,strToDirection)
{
	var strProductDivName = "iframe_block_content_" + intID;
	var objVisibleDiv = document.getElementById(strProductDivName);
	var intDivMarginLeft = objVisibleDiv.style.marginLeft;
	intDivMarginLeft = intDivMarginLeft.replace(/px/,"");

	var intProductDivWidth = document.getElementById("iframe_block_table_" + intID).offsetWidth ;
	var intOverDivWidth = document.getElementById("iframe_block_" + intID).offsetWidth ;
	var intProductDivMax = (intProductDivWidth - intOverDivWidth)*-1;

	if(strToDirection == "right")
	{
		intDivMarginLeft = parseInt(intDivMarginLeft) - intProductDivWidth * 0.15;
	}
	if(strToDirection == "left")
	{
		intDivMarginLeft = parseInt(intDivMarginLeft) + intProductDivWidth * 0.15;
	}
	if(intDivMarginLeft > 0)
	{
		intDivMarginLeft = 0;
	}
	if(intDivMarginLeft < intProductDivMax )
	{
		intDivMarginLeft = intProductDivMax;
	}
	objVisibleDiv.style.marginLeft = intDivMarginLeft;
	
	var objScrollBar = document.getElementById("iframe_" + intID + "_slider");
	var objOverDiv = document.getElementById("iframe_" + intID + "_div");
	
	var intMaxWidth = parseInt(objOverDiv.offsetWidth) - parseInt(objScrollBar.offsetWidth) - 30;
	var intNewLeftWidth = (intDivMarginLeft/intProductDivMax)*intMaxWidth;
	objScrollBar.style.left = intNewLeftWidth + "px";

	var intMaxWidthScroller = (document.getElementById('iframe_' + intID + '_div').offsetWidth) - objScrollBar.offsetWidth;
	document.getElementById("iframe_" + intID + "_slider_left_area").style.width = (intNewLeftWidth) + "px";;
	document.getElementById("iframe_" + intID + "_slider_right_area").style.width = (intMaxWidthScroller - intNewLeftWidth-30) +"px";

	return false;
}

function add_to_calculator_window(strVisible,objProduct)
{/*
	if(navigator.appName == 'Microsoft Internet Explorer')
	{
		var abc=objProduct.parentNode;
		if(strVisible == "1"){
			abc.childNodes[2].style.visibility = "visible";
		}
		else{
			abc.childNodes[2].style.visibility = "hidden";
		}
	}
 */
}/*
function checkDropDownList(event) {

	if (lastDropDownList) {

		var srcEl = (navigator.appName == 'Microsoft Internet Explorer') ? event.srcElement : event.target;

		while (srcEl.tagName.toLowerCase() != 'body') {

			if (srcEl.getAttribute('dropdown') == lastDropDownList) {

				return;

			}

			srcEl = srcEl.parentNode;

		}

		document.all['form_' + lastDropDownList].style.visibility = 'hidden';

	}

}*/

function insertImage(obj) {
	obj.setAttribute('src', obj.getAttribute('to_load'));
}

function openYear(object,year){
	if (object.className=="archiveYearClose"){
		object.className="archiveYearOpen";
		document.getElementById(year).style.display="block";
	}else{
		object.className="archiveYearClose";
		document.getElementById(year).style.display="none";
	}
}
