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 ShowScrollPhoto(url) {
	var scroll = "yes";
	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.omage-house.ru', '"OMEGA-HOUSE"')
}

function hide_menu(id) {
	GetObj("img"+id).src = eval("menu"+id+"_off.src");	
	if(id_menu!='' ) {
		timer=window.setTimeout("GetObj('div"+id+"').style.visibility='hidden';id_menu='';",1000);			
	}		
}

function menu_select(td) {
//	td.className = 'selected';
}

function menu_unselect(td) {
//	td.className = 'unselected';
}


var id_menu = 0;
var id_div = 0;
var id_submenu = 0;
var timer = '';

back_menu=new Image();
back_menu.src = "images/backmenu_sel.jpg";


function menu_on (id,is_parent) {
	 var div;
	 
	if(id_menu!=0){
		GetObj("menu"+id_menu).className = 'menu_unselected';
		//GetObj("menu"+id_menu+"_1").className = 'b_menu_unselected';
		id_menu = 0;
	}
	if(id_div!=0){
		GetObj("div"+id_div).style.display="none";
		id_div = 0;
	}
	if(id_submenu!=0){
		GetObj("submenu"+id_submenu).className = 'submenu_unselected';		
		id_submenu = 0;
	}
	
	GetObj("menu"+id).className = 'menu_selected';
	//GetObj("menu"+id+"_1").className = 'b_menu_selected';
	//GetObj("menu"+id).background = back_menu.src;
	//GetObj("menu"+id+"_1").background = back_menu.src;
			
	id_menu = id;
	
	if(is_parent == 1){
		div = GetObj("div"+id);
		div.style.left = GetAbsoluteLeft("menu"+id);				
		div.style.display="Block";
		id_div=id;
	}
	
	clearTimeout(timer);
}

function menu_off(id,is_parent) {
	GetObj("menu"+id).className = 'menu_unselected';
	//GetObj("menu"+id+"_1").className = 'b_menu_unselected';
	if(is_parent == 1){
		timer = window.setTimeout(" GetObj('div"+id+"').style.display='none'; id_div = 0; id_menu = 0",1000);
	}
		
}

function submenu_off (id,id_parent) {	
	GetObj("submenu"+id).className = "submenu_unselected";
	GetObj("href"+id).className = "submenu";
	timer = window.setTimeout(" GetObj('div"+id_div+"').style.display='none'; id_div=0; GetObj('menu"+id_menu+"').className = 'menu_unselected';  id_menu = 0;",1000);	
}

function submenu_on (id,id_parent) {
	if(id_menu!=0){
		GetObj("menu"+id_menu).className = 'menu_selected';
		//GetObj("menu"+id_menu+"_1").className = 'b_menu_selected';
	}
	if(id_div!=0){
		GetObj("div"+id_div).style.display = 'Block';
	}
	if(id_submenu!=0){
		GetObj("submenu"+id_submenu).className = 'submenu_unselected';
		GetObj("href"+id).className = "submenu";
		id_submenu = 0;
	}
	
	GetObj("submenu"+id).className = "submenu_selected";
	GetObj("href"+id).className = "submenu_sel";
	id_submenu = id;
	
	clearTimeout(timer);
}


function CheckMail(form){	
	return (CheckField(form, "email", "÷Ù ÎÅ ××ÅÌÉ 'e-mail'", 3, 3, 200));
}

function StepScroll(direct){
	var div;
	var step = 150;	
	div = GetObj("content");	
	if(div.scrollTop >= 0 && div.scrollTop <= div.scrollHeight){
		for(i=0; i<step; i++){
			if(direct == 1){
				div.scrollTop--;	
			} else {
				div.scrollTop++;	
			}
		}
	}
}

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, params, border) {
	if (border) {
		border = ' style="border: 1px solid #FFFFFF"';
	}
	else {
		border = '';
	}
	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 + '" ' + border + '>');
	document.write ('<param name=movie value="' + path + '">');
	document.write ('<param name=quality value=high>');
	
	document.write ('<PARAM name=menu value=false>');
	document.write ('<PARAM name=FlashVars value="' + params + '">');
	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 +'" FlashVars="' + params + '"></embed>');
  	document.write ('</object>');
}


function PrintPhoto(iWidth,iHeight,sSrc) {
	oWindow = window.open(sSrc,null,'location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no,width=1,height=1');
	oWindow.print();
	oWindow.close();
}