




function popup(datei,name,breite,hoehe,noresize)
{ 
	var posX=(screen.availWidth-breite)/2;
	var posY=(screen.availHeight-hoehe)/2;
	var resizable = (noresize==1) ? 0 : 1;
	window.open(datei,name,"resizable="+resizable+",scrollbars=1,width=" + breite + ",height=" + hoehe + "screenX=" + posX + ",screenY=" + posY + ",left=" + posX + ",top=" + posY + "");
}


function galpop(datei,name,breite,hoehe,noresize)
{ 
	var posX=(screen.availWidth-breite)/2;
	var posY=(screen.availHeight-hoehe)/2;
	var resizable = (noresize==1) ? 0 : 1;
	var scrollbar = (document.all) ? 0 : 1;
	window.open(datei,name,"resizable="+resizable+",scrollbars="+scrollbar+",width=" + breite + ",height=" + hoehe + "screenX=" + posX + ",screenY=" + posY + ",left=" + posX + ",top=" + posY + "");
}


function textCounter(field, countfield, maxlimit)
{ 
	if (field.value.length > maxlimit)
	{ 
		field.value = field.value.substring(0, maxlimit);
	} else { 
		countfield.value = maxlimit - field.value.length;
	}
}


function elemX (element) {
	var x = 0;
	while (element) {
		x += element.offsetLeft;
		element = element.offsetParent;
	}
	return x;
}

function elemY (element) {
	var y = 0;
	while (element) {
		y += element.offsetTop;
		element = element.offsetParent;
	}
	return y;
}

function getWidth (element) {
	return element.offsetWidth;
}

function getHeight (element) {
	return element.offsetHeight;
}

function elemObj(elementId) {
	if (document.all)
		return document.all[elementId];
	else if (document.getElementById)
		return document.getElementById(elementId);
	else
		return null;
}



function addtowishlist(id, name){  
    $.ajax({  
        type: "POST",  
        url: "/catalog/addtowishlist/"+id,  
        data: id, 
		success: function(html){humanMsg.displayMsg('<span class="indent">"'+name+'"<br/> добавлен в ваше избранное</span>');} 
    });  
};


function addtobasket(id, name){  
    $.ajax({  
        type: "POST",  
        url: "/catalog/addtobasket/"+id,  
        data: id, 
		success: function(html){humanMsg.displayMsg('<span class="indent">"'+name+'"<br/> добавлен в Вашу корзину</span>');$("#basket_small").html(html);  } 
    });  
};


function addnotifications(id){  
    $.ajax({  
        type: "POST",  
        url: "/catalog/addnotifications/"+id,  
        data: id, 
		success: function(html){humanMsg.displayMsg('<span class="indent">'+html+'</span>');} 
    });  
};
				

function basketdel(id, name){  
    $.ajax({  
        type: "POST",  
        url: "/catalog/basketdel/"+id+"",  
        data: id, 
		success: function(html){$("#basketitem_"+id).remove(); $("#basket_small").html(html);} 
    });  
};




function SelectItem(id){
	$("#new_topseller_"+id).everyTime(200, function(){$(this).toggleClass("new_topseller_r")} ,200);
}







function onSelectChange()
{
	var selected = $("#target option:selected");
	$.ajax({  
        type: "POST",  
        url: "/catalog/changedesign/"+ selected.val(),  
        data: selected.val(),
		success: function(html){$("#design").html(html);} 
    });  
}


 

function initMenu() {
  //$('#menu ul:first').show();
  $('#menu li a').click(
    function() {
        $(this).next().slideToggle('normal');	
      }
    );
  //$('#menu ul').hide();
  }



$(document).ready(function(){

		$("#nicemenu").flickrmenu();
		initMenu();
		humanMsg.setup();
		$("#target").change(onSelectChange);
		$("#l_land").change(getShiper);
		
		

		
		

});

	function getShiper()
	{
		var selected = $("#l_land option:selected");
		if(selected.val() == 0){
			$("#shipppayrows").html("Для выбора метода доставки укажите регион в котором Вы проживаете.");
			return
		}
			$.ajax({  
				type: "POST",  
				url: "/catalog/checkout",  
				data: "sub=request&get=shipping&l_land=" + selected.val(),
				success: function(html){  
					$("#shipppayrows").html(html);  
					$("#paymentrows").html("Пожалуйста, выберите сначала вид доставки");   
				} 
			});
	}
	
	function getPayment(l_land, shiper)
	{
			$.ajax({  
				type: "POST",  
				url: "/catalog/checkout",  
				data: "sub=request&get=payment&l_land=" + l_land + "&shiper=" + shiper,
				success: function(html){  
					$("#paymentrows").html(html);  
				} 
			});
	}
	
	function openbutton(l_land, shiper, payment)
	{
			$.ajax({  
				type: "POST",  
				url: "/catalog/checkout",  
				data: "sub=request&get=button&l_land=" + l_land + "&shiper=" + shiper + "&payment=" + payment,
				success: function(html){  
					$("#button").html(html);  
				} 
			});
	}




jQuery(function(){jQuery(document).pngFix();});



(function($) { 
	eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('$.O.P=3(m){1 n={t:"u",v:"Q",w:"u",x:"/p/q/r/R.s",y:"/p/q/r/z.s",A:"/p/q/r/z.s"};1 m=$.S(n,m);T 2.U(3(){1 c=m.t;1 d=m.v;1 e=m.w;1 f=m.x;1 g=m.y;1 h=m.A;1 i=2.V;1 j=$(2);1 k=$(\'.\'+c,j);1 l=$(\'.\'+e,j);l.B(3(){$(\'7.\'+c).4(\'5\');6=$(2).W().X(\'8.\'+d);9(6.Y(\'Z\')=="10"){$(2).4("5");6.o()}11{$(2).C("5");6.D(E,3(){9(F.G.H){$(2).I(0).J.K(\'L\')}})}$(\'8.\'+d+\':12\').13(6).o()});$(\'7.\'+c).M(3(){$(2).C(\'N\')}).14(3(){$(2).4(\'N\')});$(\'8.\'+d).M(3(){$(2).D(E,3(){9(F.G.H){$(2).I(0).J.K(\'L\')}})}).15(3(){$(2).o();$(\'7.\'+c).4(\'5\')});$(16).B(3(a){1 b=$(a.17);9(b.18(\'#\'+i).19==0){$(\'#\'+i+\' 7.\'+c).4(\'5\');$(\'#\'+i+\' 8.\'+d).o()}})})};',62,72,'|var|this|function|removeClass|active|submenu|span|div|if|||||||||||||||hide|modules|navigation|templates|gif|headClass|head_menu|subClass|arrowClass|arrowPic|arrowPicA|arrow_hover|arrowPicH|click|addClass|fadeIn|400|jQuery|browser|msie|get|style|removeAttribute|filter|mouseover|over|fn|flickrmenu|sub_menu|arrow|extend|return|each|id|parent|find|css|display|block|else|visible|not|mouseout|blur|document|target|parents|length'.split('|'),0,{}))
})(jQuery);







var qTipTag = "img,a,label,input,div,strike";
var qTipX = 0;
var qTipY = 15;

tooltip = {
  name : "qTip",
  offsetX : qTipX,
  offsetY : qTipY,
  tip : null
}

tooltip.init = function () {
	var tipNameSpaceURI = "http://www.w3.org/1999/xhtml";
	if(!tipContainerID){ var tipContainerID = "qTip";}
	var tipContainer = document.getElementById(tipContainerID);

	if(!tipContainer) {
	  tipContainer = document.createElementNS ? document.createElementNS(tipNameSpaceURI, "div") : document.createElement("div");
		tipContainer.setAttribute("id", tipContainerID);
	  document.getElementsByTagName("body").item(0).appendChild(tipContainer);
	}

	if (!document.getElementById) return;
	this.tip = document.getElementById (this.name);
	if (this.tip) document.onmousemove = function (evt) {tooltip.move (evt)};

	var a, sTitle, elements;
	
	var elementList = qTipTag.split(",");
	for(var j = 0; j < elementList.length; j++)
	{	
		elements = document.getElementsByTagName(elementList[j]);
		if(elements)
		{
			for (var i = 0; i < elements.length; i ++)
			{
				a = elements[i];
				sTitle = a.getAttribute("klerol");				
				if(sTitle)
				{
					a.setAttribute("tipname", sTitle);
					a.removeAttribute("klerol");
					//a.removeAttribute("alt");
					a.onmouseover = function() {tooltip.show(this.getAttribute('tipname'))};
					a.onmouseout = function() {tooltip.hide()};
				}
			}
		}
	}
}

tooltip.move = function (evt) {
	var x=0, y=0;
	if (document.all) {//IE
		x = (document.documentElement && document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : document.body.scrollLeft;
		y = (document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
		x += window.event.clientX;
		y += window.event.clientY;
		
	} else {//Good Browsers
		x = evt.pageX;
		y = evt.pageY;
	}
	this.tip.style.left = (x + this.offsetX) + "px";
	this.tip.style.top = (y + this.offsetY) + "px";
}

tooltip.show = function (text) {
	if (!this.tip) return;
	this.tip.innerHTML = text;
	this.tip.style.display = "block";
}

tooltip.hide = function () {
	if (!this.tip) return;
	this.tip.innerHTML = "";
	this.tip.style.display = "none";
}

window.onload = function () {
	tooltip.init ();
}



var humanMsg = {
	setup: function(appendTo, logName, msgOpacity) {
		humanMsg.msgID = 'humanMsg';

		if (appendTo == undefined)
			appendTo = 'body';

		humanMsg.msgOpacity = .8;

		if (msgOpacity != undefined) 
			humanMsg.msgOpacity = parseFloat(msgOpacity);

		jQuery(appendTo).append('<div id="'+humanMsg.msgID+'" class="humanMsg"><p></p></div> ');
	},
	displayMsg: function(msg) {
		if (msg == '')
			return;

		clearTimeout(humanMsg.t2);

		jQuery('#'+humanMsg.msgID+' p').html(msg)
		jQuery('#'+humanMsg.msgID+'').show().animate({ opacity: humanMsg.msgOpacity}, 200);

		humanMsg.t1 = setTimeout("humanMsg.removeMsg()", 3000)
		humanMsg.t2 = setTimeout("humanMsg.removeMsg()", 5000)
	},

	bindEvents: function() {
		jQuery(window)
			.mousemove(humanMsg.removeMsg)
			.click(humanMsg.removeMsg)
			.keypress(humanMsg.removeMsg)
	},

	removeMsg: function() {
		jQuery(window)
			.unbind('mousemove', humanMsg.removeMsg)
			.unbind('click', humanMsg.removeMsg)
			.unbind('keypress', humanMsg.removeMsg)

		if (jQuery('#'+humanMsg.msgID).css('opacity') == humanMsg.msgOpacity)
			jQuery('#'+humanMsg.msgID).animate({ opacity: 0 }, 500, function() { jQuery(this).hide() })
	}
};




eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('5.H.A({I:6(a,b,c,d,e){j 4.u(6(){5.k.v(4,a,b,c,d,e)})},J:6(a,b,c){j 4.u(6(){5.k.v(4,a,b,c,1)})},K:6(a,b){j 4.u(6(){5.k.n(4,a,b)})}});5.A({k:{B:1,o:{},C:/^([0-9]+)\\s*(.*s)?$/,D:{\'L\':1,\'M\':10,\'N\':O,\'s\':P,\'Q\':R,\'S\':T,\'U\':V},E:6(a){3(a==W||a==r)j r;7 b=4.C.X(5.Y(a.Z()));3(b[2]){7 c=11(b[1],10);7 d=4.D[b[2]]||1;j c*d}w{j a}},v:6(a,b,c,d,e,f){7 g=0;3(5.12(c)){3(!e)e=d;d=c;c=b}b=5.k.E(b);3(13 b!=\'14\'||15(b)||b<=0)j;3(e&&e.16!=17){f=!!e;e=0}e=e||0;f=f||x;3(!a.$l)a.$l={};3(!a.$l[c])a.$l[c]={};d.$8=d.$8||4.B++;7 h=6(){3(f&&4.y)j;4.y=18;3((++g>e&&e!==0)||d.19(a,g)===x)5.k.n(a,c,d);4.y=x};h.$8=d.$8;3(!a.$l[c][d.$8])a.$l[c][d.$8]=t.1a(h,b);3(!4.o[c])4.o[c]=[];4.o[c].1b(a)},n:6(a,b,c){7 d=a.$l,m;3(d){3(!b){p(b q d)4.n(a,b,c)}w 3(d[b]){3(c){3(c.$8){t.F(d[b][c.$8]);z d[b][c.$8]}}w{p(7 c q d[b]){t.F(d[b][c]);z d[b][c]}}p(m q d[b])G;3(!m){m=r;z d[b]}}p(m q d)G;3(!m)a.$l=r}}}});3(5.1c.1d)5(t).1e("1f",6(){7 a=5.k.o;p(7 b q a){7 c=a[b],i=c.1g;1h(--i)5.k.n(c[i],b)}});',62,80,'|||if|this|jQuery|function|var|timerID|||||||||||return|timer|timers|ret|remove|global|for|in|null||window|each|add|else|false|inProgress|delete|extend|guid|regex|powers|timeParse|clearInterval|break|fn|everyTime|oneTime|stopTime|ms|cs|ds|100|1000|das|10000|hs|100000|ks|1000000|undefined|exec|trim|toString||parseInt|isFunction|typeof|number|isNaN|constructor|Number|true|call|setInterval|push|browser|msie|one|unload|length|while'.split('|'),0,{}))