/*$(document).ready(function(){
	$(".logo").pngFix();
	$(".bitem").pngFix();
	$(".m_innertitle").pngFix();
	$(".logos").pngFix();
});
function change_img(path,alt,num,count){
	document.getElementById('model_colors_img').innerHTML='<img src="/files/Image/Gallery/'+path+'" alt="'+alt+'" id="color_img">';
	for(i=0;i<count;i++)document.getElementById('color_'+i).style.border='1px solid #888888';
	document.getElementById('color_'+num).style.border='1px solid #298ed7';
	document.getElementById('color_'+num).style.borderBottom='none';
	//for(i=0;i<count;i++)document.getElementById('gal_'+i).innerHTML='<img src="">';
	for(i=0;i<count;i++)document.getElementById('gal_'+i).innerHTML='';
	document.getElementById('gal_'+num).innerHTML='<img width="31" height="7" src="/images/colorborder.png">';
}
function show_full_pic(path){
	var myWindow = window.open("/files/Image/Gallery/"+path,'win1',
	'toolbar=no,location=no,directories=no,width=820,height=620,status=no,menubar=no,scrollbars=no,resizable=no');
}*/
function ShowFlash(flash, w, h)
{
    if (AC_FL_RunContent == 0) 
    {
		return false;
    } 
    else 
    {
        flash = flash.substring(0, flash.lastIndexOf('.'));
        
		AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0',
			'width', w,
			'height', h,
			'src', flash,
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'true',
			'scale', 'showall',
			'wmode', 'transparent',
			'devicefont', 'false',
			'id', 'fl' + w,
			'bgcolor', '#ffffff',
			'name', 'fl' + w,
			'menu', 'true',
			'allowFullScreen', 'false',
			'allowScriptAccess','sameDomain',
			'movie', flash,
			'salign', ''
		); 
	}
}

// расчет платежа по кредиту
function calculate()
{
    with (document.forms['fm1'])
    {
        if(cost.value < 150000)
        {
            alert("Кредит предоставляется на автомобили дороже 150000 руб."); 
            return false; 
        }
        
        var fpr = firstpersent.value;
        var sum = cost.value*(1-fpr/100);
        var pc = 8;
        
        firstpay.value = Math.round(cost.value*fpr/100);
        monthpay.value = Math.round((sum*pc/1200)/(1-Math.pow(1/(1+pc/1200), period.value)));
    }
}


function ChangeImg(img, alt, div)
{
	if($('#color_img'))
	{
        $('#color_img').attr('src', "/files/Image/Gallery/"+img);
        $('#color_img').attr('alt', alt);
        $('#colors').children().attr('class', 'colors-div');
        $('#item'+div).attr('class', 'colors-div-act');
	}
	
	return false;
}

function ShowFull()
{
	if($("#full").is(":hidden")) 
	{
		$("#short").fadeOut("slow", function(){ $("#full").fadeIn("slow"); });
	}
	else 
	{
		$("#full").hide("fast", function(){ $("#short").fadeIn("slow"); });
	}
	
	return false;
}

