function ShowPhoto(url) {
	var scroll = "no";
	if(screen.width < 1000)	{scroll = "yes";}
	window.open(url, '_blank', 'width=0, height=0, menubar=no, scrollbars=' + scroll + ', status=no, top=0, left=0');
}

function GetObj(objId) {
	if (navigator.appName.substring(0,2) !="Mi")
		return document.getElementById(objId);
	else
		return document.all[objId];
}
		
function GetAbsoluteTop(obj_id) {
   var obj;
   var result = 0;
   obj = GetObj(obj_id);
   while( obj.tagName != 'BODY' ) {
     result += obj.offsetTop;
     obj = obj.offsetParent;
   }
   return result;
}

function GetAbsoluteLeft(obj_id) {
   var obj;
   var result = 0;
   obj = GetObj(obj_id);
   while( obj.tagName != 'BODY' ) {
     result += obj.offsetLeft;
     obj = obj.offsetParent;
   }
   return result;
}
		
function SetFavorites() {
	window.external.AddFavorite('http://www.kulon.ru', '"ïáï ëÕÌÏÎ"')
}

var id_menu = 0;
var timer = '';
var downed_menu = 0;

function hide_submenu(id) {
	GetObj("menu"+id).style.display = "none";
	if (id != downed_menu) {
		oImg = GetObj("img"+id);
		oImg.src = "images/go-up.gif";
	}
	id_menu = 0;
	
}

function menu_on (id,submenu) {
	if (submenu) {
		if (id_menu != 0) {
			hide_submenu(id_menu);
		}
		div = GetObj("menu"+id);
		div.style.left = GetAbsoluteLeft("mainmenu"+id);		
		div.style.top = GetAbsoluteTop("imposition");
		div.style.display="Block";
		id_menu = id;
		clearTimeout(timer);
	}
	if (id != downed_menu) {
		oImg = GetObj("img"+id);
		oImg.src = "images/go-down.gif";
	}
}

function menu_off(id,submenu) {
	if (submenu) {
		timer = window.setTimeout("hide_submenu("+id+");",1000);
	}
	if (id != downed_menu) {
		oImg = GetObj("img"+id);
		oImg.src = "images/go-up.gif";
	}
}

function ProductOver(id) {
	GetObj('prod'+id).src = "images/point_selected.gif";
}

function ProductOut(id) {
	GetObj('prod'+id).src = "images/punct_product.gif";
}

function CategoryOver(id,id_element) {
	GetObj('cat'+id).src = "images/point_selected.gif";
	if (id_element != 0) {
		oElement = GetObj('element'+id_element);
		oElement.src = 'images/element' + id_element + '.jpg';
	}
}

function CategoryOut(id,id_element) {
	GetObj('cat'+id).src = "images/punct_category.gif";
	if (id_element != 0) {
		oElement = GetObj('element'+id_element);
		oElement.src = 'images/element' + id_element + '_light.jpg';
	}
}

function submenu_off (id) {	
	timer = window.setTimeout("hide_submenu("+id+");",1000);
}

function submenu_on (id) {
	clearTimeout(timer);
}


function CheckMail(form){	
	return (CheckField(form, "email", "Âû íå ââåëè 'e-mail'", 3, 3, 200));
}

var version = 6;
var flash = false;
if (navigator.plugins) {
	if(navigator.plugins["Shockwave Flash"])  {
		  plugin = navigator.plugins["Shockwave Flash"].description;
		  flash = parseInt(plugin.charAt(plugin.indexOf('.') - 1)) >= version;
	} else	{
		if ((navigator.userAgent.indexOf('MSIE') != -1)&&(navigator.userAgent.indexOf('Win') != -1)) {
		   	var vb = '<script language="vbscript">\n'
		            + '  on error resume next\n'
		            + '  flash = IsObject(CreateObject('
		            + '     "ShockwaveFlash.ShockwaveFlash.' + version + '"))\n'
		            + '<' + '/script>';
			document.write(vb);
		}
	}
}

function PrintFlash(path, width, height) {
	document.write ('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=" + version + ",0,0,0" width="' + width + '" height="' + height + '">');
	document.write ('<param name=movie value="' + path + '">');
	document.write ('<param name=quality value=high>');
	document.write ('<PARAM NAME=wmode VALUE=transparent>');
	document.write ('<PARAM name=menu value=false>');
	document.write ('<embed wmode="opaque" src="' + path + '" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="' + width + '" height="' + height +'"></embed>');
  	document.write ('</object>');
}
