function Open_img(name,size1,size2,title){
view = window.open(name,"name","width="+size1+", height="+size2+" ,menubar=no,toolbar=no,status=no,scrollbars=no");
view.document.writeln('<html><head><META HTTP-EQUIV="Pragma" CONTENT="no-cache"><title>'+title+'</title></head>');
view.document.writeln('<body bgcolor="#437AD6"><div style="border: 1px solid; border-color: #E7E7E7; margin-left: 2px; margin-right: 2px; background-color: #9FC0F5;"><a href=javascript:window.close();> <img src=/'+name+' border="0" alt="закрыть окно"></a></div></body></html>');
}

function Open_img_map(name,size1,size2,title){
view = window.open(name,"name","width="+size1+", height="+size2+" ,menubar=no,toolbar=no,status=no,scrollbars=no");
view.document.writeln('<html><head><META HTTP-EQUIV="Pragma" CONTENT="no-cache"><title>'+title+'</title></head>');
view.document.writeln('<body bgcolor="#ffffff" style="font-family:Verdana; font-size:10px;"><div style="border: 1px solid; border-color: #E7E7E7; margin-left: 2px; margin-right: 2px; background-color: #9FC0F5;"><a href=javascript:window.close();> <img src=/'+name+' border="0" alt="закрыть окно"></a></div><br><div align="center">\"Fly Express Services\"<br/>Телефон: (495) 775-87-87<br/>Факс: (495) 258-44-02<br/>E-mail: info@flyex.ru, uk@flyex.ru<br/>Адрес: м.Октябрьская (кольцевая), 119049, Ленинский проспект, д.4, корп. 1-А, 4 этаж, ориентир кафе "Бабушкины блинчики", рядом коричневая дверь, 4 этаж, налево<br/><br/><a href="javascript:window.print();">печать</a></div></body></html>');
}

function Open_rev(name,size1,size2){
viewrev = window.open(name,'name','width='+size1+', height='+size2+',scrollbars=yes, menubar=no, toolbar=no, status=no');
}

function OpenLead(id){
window.open("/lead.php?lead="+id+"","win","width=600, height=550","menubar=no,toolbar=no,status=no,scrollbars=no");
}

function getElementWidth(objectId) {
	x = document.getElementById(objectId);
	return x.offsetWidth;
	}

function getAbsoluteLeft(objectId) {
	o = document.getElementById(objectId)
	oLeft = o.offsetLeft
	while(o.offsetParent!=null) {
		oParent = o.offsetParent
		oLeft += oParent.offsetLeft
		o = oParent
	}
	return oLeft
}

function getAbsoluteTop(objectId) {
	o = document.getElementById(objectId)
	oTop = o.offsetTop
	while(o.offsetParent!=null) {
		oParent = o.offsetParent
		oTop += oParent.offsetTop
		o = oParent
	}
	return oTop
}

$().ready(function() {
$('.thumb').flyout({loadingSrc:'/img/loader.gif'});

$('#copy10kg').click( function() { 
	divW = getAbsoluteLeft("copy10kg")- (parseInt($('#divcopy').css("width"))/2)+ getElementWidth("copy10kg");
	divH = getAbsoluteTop("copy10kg") - parseInt($('#divcopy').css("height"))+10;
	$('#divcopy').css({left: divW+"px", top: divH+"px"});
	$('#divcopy').toggle().fadeOut(10000); 
} );
});
