﻿// Detect Client Browser type
function menuOver(obj)
{
	obj.oldClass = obj.className;
	if (obj.className.indexOf('-selected') < 0)
	{
		obj.className = obj.className + '-selected';
	}
}

function menuOut(obj)
{
	if (obj.oldClass)
	{
		obj.className = obj.oldClass;
	}
}

function menuProjectsOver(obj)
{
	obj.oldClass = obj.className;
	if (obj.className.indexOf(' over') < 0)
	{
		obj.className = obj.className + ' over';
	}
}

function menuProjectsOut(obj)
{
	if (obj.oldClass)
	{
		obj.className = obj.oldClass;
	}
	else
	{
		obj.className = '';
	}
}

function menuDesignersOver(obj)
{
	obj.oldClass = obj.className;
	if (obj.className.indexOf(' over') < 0)
	{
		obj.className = obj.className + ' over';
	}
}

function menuDesignersOut(obj)
{
	if (obj.oldClass)
	{
		obj.className = obj.oldClass;
	}
	else
	{
		obj.className = '';
	}
}

function showProjectImage(project_id, id)
{
	var isFoundImage = true;
	var n = 1;
	
	while(isFoundImage)
	{
		obj = document.getElementById('project_image_' + project_id + '_' + n);
		obj_page = document.getElementById('project_image_page_' + project_id + '_' + n);
		if (obj)
		{
			if (parseInt(n) == parseInt(id))
			{
				obj.style.display = "block";
				obj_page.className = "page-num selected";
			}
			else
			{
				obj.style.display = "none";
				obj_page.className = "page-num";
			}
		}
		else
		{
			isFoundImage = false;
		}
		n++;
	}
}

function showFundsImage(id)
{
	var isFoundImage = true;
	var n = 1;
	
	while(isFoundImage)
	{
		obj = document.getElementById('funds_image_' + n);
		obj_page = document.getElementById('funds_image_page_' + n);
		if (obj)
		{
			if (parseInt(n) == parseInt(id))
			{
				obj.style.display = "block";
				obj_page.className = "page-num selected";
				document.getElementById('funds_image_name').innerHTML = document.getElementById('funds_image_name_' + n).innerHTML;
			}
			else
			{
				obj.style.display = "none";
				obj_page.className = "page-num";
			}
		}
		else
		{
			isFoundImage = false;
		}
		n++;
	}
}

function showProductImage(image)
{
	obj		= document.getElementById('gallery_big_image');
	obj_url	= document.getElementById('gallery_big_url');
	if (obj)
	{
		obj.src = 'Thumbnail.ashx?image=images/products/' + image + '&w=433&h=312&cp=1&rs=0&rb=1';
		obj_url.href = 'Thumbnail.ashx?image=images/products/' + image + '&w=1000&h=800&cp=1&rs=0&rb=1';
	}
}
function showProductImage2(image) {
    obj = document.getElementById('gallery_big_image');
    obj_url = document.getElementById('gallery_big_url');
    if (obj) {
        obj.src = 'Thumbnail.ashx?image=images/product/' + image + '&w=433&h=312&cp=1&rs=0&rb=1';
        obj_url.href = 'Thumbnail.ashx?image=images/product/' + image + '&w=1000&h=800&cp=1&rs=0&rb=1';
    }
}
function showGalleryImage(image)
{
	obj		= document.getElementById('gallery_big_image');
	obj_url	= document.getElementById('gallery_big_url');
	if (obj)
	{
		obj.src = 'Thumbnail.ashx?image=images/projects_images/' + image + '&w=433&h=312&cp=1&rs=0&rb=1';
		obj_url.href = 'Thumbnail.ashx?image=images/projects_images/' + image + '&w=1000&h=800&cp=1&rs=0&rb=1';
	}
}

function showHomeImage(image)
{
	obj		= document.getElementById('home_big_image');
	if (obj)
	{
		obj.src = 'Thumbnail.ashx?image=images/page_images/' + image + '&w=968&h=454&cp=1&rs=0&rb=1';
	}
}

function menuProductsCategoriesOver(obj)
{
	obj.oldClass = obj.className;
	if (obj.className.indexOf(' over') < 0)
	{
		obj.className = obj.className + ' over';
	}
}

function menuProductsCategoriesOut(obj)
{
	if (obj.oldClass)
	{
		obj.className = obj.oldClass;
	}
	else
	{
		obj.className = '';
	}
}

function showMap(id)
{
	obj = document.getElementById('div_map'+id);
	if (obj)
	{
		obj.style.display = 'block'; // 'block'
	}
}

function hideMap(id)
{
	obj = document.getElementById('div_map'+id);
	if (obj)
	{
		obj.style.display = 'none';
	}
}
