function checkSloginForm(){

	var txt = '';

	if(document.getElementById('slogin').value == 'E-mail' || document.getElementById('slogin').value == '')
		txt = txt + '&ndash; E-mail;<br />';

	if(document.getElementById('spass').value == 'Пароль' || document.getElementById('spass').value == '')
		txt = txt + '&ndash; Пароль;<br />';


	if(txt == '')
		document.getElementById('loginSideForm').submit();
	else {

		document.getElementById('main_message').innerHTML = '<h2 id="del_text">Заполните следующие поля:</h2>' + txt;
		document.getElementById('cont_message').style.display = 'block';
		}
	}


function add2wish(id) {

	document.getElementById('form'+id).submit();
	}

function add2wishalt(id, cd)
{
	window.location = 'http://www.mirkarapuza.ru/order.php?cd='+cd+'&good_id='+id+'&act=addtowish';
}


function getClientWidth()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
}

function getClientHeight()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
}



function mig(id1, id2)
{

var from = 0;
var to = 0.7;

var duration = 700; // Длительность - 1 секунда
var start = new Date().getTime(); // Время старта


setTimeout(function fade() {
	var now = (new Date().getTime()) - start; // Текущее время
    	var progress = now / duration; // Прогресс анимации

    	var result = (to - from) * delta(progress) + from;

    	document.getElementById('block_mask').style.opacity = result;
    	document.getElementById('block_mask').style.filter='alpha(opacity='+result*100+')';
    	document.getElementById('block_mask').style.display = 'block';
	if (progress > 0.5)  { 

	document.getElementById(id2).style.display = 'none';
	document.getElementById(id1).style.display = 'block';
}

    		if (progress < 1) { // Если анимация не закончилась, продолжаем
      	  		setTimeout(arguments.callee, 10);
		} else {
    	document.getElementById('block_mask').style.display = 'none';
		}
}, 20);

}


function delta(progress) {  

    return (1-Math.sin(Math.PI/2-progress* Math.PI*2 ))/2;  
}

function getBrowserInfo()
{
    var t,v = undefined;
    if (window.opera) t = 'Opera';
    else if (document.all) {
        t = 'IE';
        var nv = navigator.appVersion;
        var s = nv.indexOf('MSIE')+5;
        v = nv.substring(s,s+1);
    } else if (navigator.appName) t = 'Netscape';
        return {type:t,version:v};
}
 
function bookmark(a)
{
    var url = window.document.location;
    var title = window.document.title;
    var b = getBrowserInfo();
    if (b.type == 'IE' && 7 > b.version && b.version >= 4)
        window.external.AddFavorite(url,title);
    else if (b.type == 'Opera') {
        a.href = url;
        a.rel = "sidebar";
        a.title = url+','+title;
        return true;
    } else if (b.type == "Netscape")
        window.sidebar.addPanel(title,url,"");
    else alert("Нажмите CTRL-D, чтобы добавить страницу в закладки.");

    return false;
}
