var ie=navigator.userAgent
var k=navigator.userAgent.indexOf('MSIE')
var ver=parseInt( ie.substring(k+5, ie.indexOf('.',k) ))
var eml='maralin';
$(document).ready(function(){
	//$('body').load(function(){
	$.ajax({
			type: "POST",
			url: 'http://maralin.ru/eml.php',
			data: ({a:1}),
			success: function(html){$("#eml").html(html);
		} 
		}); 
	
	
	//});
});
	




if(ver>=4 || isNaN(ver)) {
nav0=new Image();	nav0.src=''

centrmap=new Image();	centrmap.src='pic/map_rostov_centr.gif';

temp=new Image();
}

function MOver(nn) {
if(ver>=4 || isNaN(ver)) {
	temp.src=nn.src;
	eval("nn.src="+nn.name+".src")
	}
}

function MOut(nn) {
if(ver>=4 || isNaN(ver)) {
	nn.src=temp.src;
	}
}

function big_pic(pic) {
var new_w = Math.round(pic.width*1.3);
var new_h = Math.round(pic.height*1.3);
pic.style.width = new_w;
pic.style.height = new_h;

}

function small_pic(pic) {
var new_w = Math.round(pic.width/1.3);
var new_h = Math.round(pic.height/1.3);
pic.style.width = new_w;
pic.style.height = new_h;

}

function Toggle(div) {
div.style.display = (div.style.display == 'none')?'block':'none';
}

function FormatPrice(s) {
var sformat="";
var sraw=s.value.replace(/ /g,"");
if(sraw.length>3) {
	for(i=1;i<(Math.floor(sraw.length/3))+1;i++) {
		//sformat=sraw.substr(0,sraw.length-3*i)+" "+sraw.substr(sraw.length-3*i,3*i); // перв.вариант
		//alert(sraw.substr(sraw.length-3*i,3));
		sformat=" "+sraw.substr(sraw.length-3*i,3)+sformat;
	}
	//i--;
	//alert(sraw.substr(0,sraw.length-3*i));
	sformat=sraw.substr(0,sraw.length-3*(i-1))+sformat;
	s.value=sformat;
}
}

function SelectRegionSearch () {
	if(search.region.selectedIndex==0) { RegRostov.style.display='inline'; RegRostovObl.style.display='none'; RegOther.style.display='none'; }
	if(search.region.selectedIndex==1) { RegRostov.style.display='none'; RegRostovObl.style.display='inline'; RegOther.style.display='none'; }
	if(search.region.selectedIndex==2) { RegRostov.style.display='none'; RegRostovObl.style.display='none'; RegOther.style.display='inline'; }
}

function SelectRegionOrder () {
	alert(document.order.prototype());
	if(order.orderregion.selectedIndex==0) { OrderRegRostov.style.display='inline'; OrderRegRostovObl.style.display='none'; OrderRegOther.style.display='none'; }
	if(order.orderregion.selectedIndex==1) { OrderRegRostov.style.display='none'; OrderRegRostovObl.style.display='inline'; OrderRegOther.style.display='none'; }
	if(order.orderregion.selectedIndex==2) { OrderRegRostov.style.display='none'; OrderRegRostovObl.style.display='none'; OrderRegOther.style.display='inline'; }
}
