$(function() {
	//root
	try {
		if ($.browser.flash) {
			swfobject.embedSWF('/swf/banner.swf?xmlpath=' + root_xmlpath, "banner", "978", "300", "9.0.0", "/i/expressInstall.swf", {}, {wmode:"opaque"}, {wmode:"opaque"});
		} else {
			$.get(root_jsonpath, function(js) {
				try {
					eval(js)

					$.each(root_json, function(i, j) {
						var cls = j.current ? ' class="active"' : '';

						$('#banner .in').append('<a href="'+j.link+'"><img src="' + j.image + '" alt="' + j.title + '" id="imgitem' + j.id + '" ' + cls+ '/></a>');
						$('#switch').append('<a href="'+j.link+'" id="item' + j.id + '" ' + cls + ' title="'+j.title+'">' + (i + 1) + '</a>');
					});

					$('#switch a').click(function() {
						var id = $(this).attr('id');

						if(this.className !== 'active') {
							$('#banner .active').animate({top:'-300px'}, {duration:500, easing:'easeOutCubic'});
							$('#banner .active').removeClass('active');
							$('#switch .active').removeClass('active');
							$('#img'+id).css('top','300px').animate({top:'0'}, {duration:400, easing:'easeOutCubic'});
							$('#img'+id).addClass('active');
							$(this).addClass('active');

						} else {
							return false;
						}

						return false;
					});
				} catch(e) {

				}
			});
		}
	} catch(e) {
	}

	//menu
	try {
		$.each(banner_json, function(i, val) {

			if (!val.link) {
				$("#banner_" + i).closest("div.pop").addClass("no-banner");
				$("#banner_" + i).remove();
			}

			$('#banner_' + i).append('<a href="' + val.link + '" class="description" target="_top"><img src="' + val.image+ '" alt="" />' + val.text + '</a>');
		});
	} catch(e) {
	}

	//inner
	try {
		var position = new Array('left', 'center', 'right');
		var j = 0;
		
		$.each(inner_json, function(i, val) {
			$('.b-promo .promo-' + position[j++] + ' .shadow-box').append('<a href="' + val.link + '" class="sh-in"><img src="' + val.preview + '" class="img"><img src="' + val.image + '" class="img-wide"></a>');
		});
	} catch(e) {
	
	try {
		var position = new Array('left', 'center', 'right');
		var j = 0;

		$.each(footer_json, function(i, val) {
			$('.b-promo .promo-' + position[j++] + ' .shadow-box').append('<a href="' + val.link + '" class="sh-in"><img src="' + val.preview + '" class="img"><img src="' + val.image + '" class="img-wide"></a>');
		});

	} catch(e) {
	}}
});
/*

CUSTOM FORM ELEMENTS

Created by Ryan Fait
www.ryanfait.com

The only things you may need to change in this file are the following
variables: checkboxHeight, radioHeight and selectWidth (lines 24, 25, 26)

The numbers you set for checkboxHeight and radioHeight should be one quarter
of the total height of the image want to use for checkboxes and radio
buttons. Both images should contain the four stages of both inputs stacked
on top of each other in this order: unchecked, unchecked-clicked, checked,
checked-clicked.

You may need to adjust your images a bit if there is a slight vertical
movement during the different stages of the button activation.

The value of selectWidth should be the width of your select list image.

Visit http://ryanfait.com/ for more information.

*/

var checkboxHeight = "25";
var radioHeight = "25";
var selectWidth = "auto";


/* No need to change anything after this */


document.write('<style type="text/css">input.styled { display: none; } select.styled { position: relative; width: ' + selectWidth + 'px; opacity: 0; filter: alpha(opacity=0); z-index: 5; } .disabled { opacity: 0.5; filter: alpha(opacity=50); }</style>');

var Custom = {
	init: function() {
		var inputs = document.getElementsByTagName("input"), span = Array(), textnode, option, active;
		for(a = 0; a < inputs.length; a++) {
			if((inputs[a].type == "checkbox" || inputs[a].type == "radio") && inputs[a].className == "styled") {
				span[a] = document.createElement("span");
				span[a].className = inputs[a].type;

				if(inputs[a].checked == true) {
					if(inputs[a].type == "checkbox") {
						position = "0 -" + (checkboxHeight*2) + "px";
						span[a].style.backgroundPosition = position;
					} else {
						position = "0 -" + (radioHeight*2) + "px";
						span[a].style.backgroundPosition = position;
					}
				}
				inputs[a].parentNode.insertBefore(span[a], inputs[a]);
				inputs[a].onchange = Custom.clear;
				if(!inputs[a].getAttribute("disabled")) {
					span[a].onmousedown = Custom.pushed;
					span[a].onmouseup = Custom.check;
				} else {
					span[a].className = span[a].className += " disabled";
				}
			}
		}
		inputs = document.getElementsByTagName("select");
		for(a = 0; a < inputs.length; a++) {
			if(inputs[a].className == "styled") {
				option = inputs[a].getElementsByTagName("option");
				active = option[0].childNodes[0].nodeValue;
				textnode = document.createTextNode(active);
				for(b = 0; b < option.length; b++) {
					if(option[b].selected == true) {
						textnode = document.createTextNode(option[b].childNodes[0].nodeValue);
					}
				}
				span[a] = document.createElement("span");
				span[a].className = "select";
				span[a].id = "select" + inputs[a].name;
				span[a].appendChild(textnode);
				inputs[a].parentNode.insertBefore(span[a], inputs[a]);
				if(!inputs[a].getAttribute("disabled")) {
					inputs[a].onchange = Custom.choose;
				} else {
					inputs[a].previousSibling.className = inputs[a].previousSibling.className += " disabled";
				}
			}
		}
		document.onmouseup = Custom.clear;
	},
	pushed: function() {
		element = this.nextSibling;
		if(element.checked == true && element.type == "checkbox") {
			this.style.backgroundPosition = "0 -" + checkboxHeight*3 + "px";
		} else if(element.checked == true && element.type == "radio") {
			this.style.backgroundPosition = "0 -" + radioHeight*3 + "px";
		} else if(element.checked != true && element.type == "checkbox") {
			this.style.backgroundPosition = "0 -" + checkboxHeight + "px";
		} else {
			this.style.backgroundPosition = "0 -" + radioHeight + "px";
		}
	},
	check: function() {
		element = this.nextSibling;
		if(element.checked == true && element.type == "checkbox") {
			this.style.backgroundPosition = "0 0";
			element.checked = false;
		} else {
			if(element.type == "checkbox") {
				this.style.backgroundPosition = "0 -" + checkboxHeight*2 + "px";
			} else {
				this.style.backgroundPosition = "0 -" + radioHeight*2 + "px";
				group = this.nextSibling.name;
				inputs = document.getElementsByTagName("input");
				for(a = 0; a < inputs.length; a++) {
					if(inputs[a].name == group && inputs[a] != this.nextSibling) {
						inputs[a].previousSibling.style.backgroundPosition = "0 0";
					}
				}
			}
			element.checked = true;
		}
	},
	clear: function() {
		inputs = document.getElementsByTagName("input");
		for(var b = 0; b < inputs.length; b++) {
			if(inputs[b].type == "checkbox" && inputs[b].checked == true && inputs[b].className == "styled") {
				inputs[b].previousSibling.style.backgroundPosition = "0 -" + checkboxHeight*2 + "px";
			} else if(inputs[b].type == "checkbox" && inputs[b].className == "styled") {
				inputs[b].previousSibling.style.backgroundPosition = "0 0";
			} else if(inputs[b].type == "radio" && inputs[b].checked == true && inputs[b].className == "styled") {
				inputs[b].previousSibling.style.backgroundPosition = "0 -" + radioHeight*2 + "px";
			} else if(inputs[b].type == "radio" && inputs[b].className == "styled") {
				inputs[b].previousSibling.style.backgroundPosition = "0 0";
			}
		}
	},
	choose: function() {
		option = this.getElementsByTagName("option");
		for(d = 0; d < option.length; d++) {
			if(option[d].selected == true) {
				document.getElementById("select" + this.name).childNodes[0].nodeValue = option[d].childNodes[0].nodeValue;
			}
		}
	}
}
window.onload = Custom.init;

$('#print').click(function() {
	window.print();
	return false;
});

$("i.region").click( function(e) {
	var rId = $(this).attr('id');

	var form = $('form#regions');
	form.append('<input type="hidden" name="rid" value="'+rId+'" />');
	form.submit();
});

/*$(function() {
	$("#mainbgin").each(function() {
		swfobject.embedSWF("/swf/video-2.swf", "mainbgin", "100%", "100%", "9.0.0", "expressInstall.swf", {}, {wmode:"opaque"}, {wmode:"opaque"});
	})
});*/

$(function(){
	$("#topmenu-in .pop").each(function() {
		$(this).removeClass("hidden-pop");
	})

	$('#servicemenu .block').hover(function() {
		$(this).addClass('active');
		$(this).find('UL').show(150);
	}, function() {
		$(this).removeClass('active');
		$('UL', this).hide(150);
	});
});

$(function() {
	$('#topmenu-in>li').each(function() {
		var pop = $(this).children("div.pop");
		if (pop.find("a.description").length > 0) {
			pop.css('width', '347px');
		}
		var menu_width = $('#topmenu').width();
		var pop_width  = pop.width();
		var li_width   = $(this).width();
		var li_pos     = $(this).position();
		var pop_pos    = Math.ceil(li_pos.left + li_width/2 - pop_width/2);

		if (pop_pos < 0) {
			pop.css({'left':'-5px', 'right': 'auto'});

		} else if (pop_width + li_pos.left > menu_width) {
			pop.css({'right':'-10px', 'left':'auto'});
		} else {

			pop.css({'left': pop_pos, 'right':'auto'});
		}

		if ($(this).find("iframe").size()) {
			var bannerframe = $(this).find("iframe");
			var ih = bannerframe.contents().find('body').height();
			
			if (ih > $(this).find(".in").height()) {
				bannerframe.attr("height", ih + "px");
			} else {
				bannerframe.attr("height", $(this).find(".in").height() + "px");
			}
		}
		
		pop.hide().css("visibility", "visible");
	})
	
	$('#topmenu-in>li').hover(function() {
		$("#topmenu-in div.pop").hide();   	
		var pop = $(this).children("div.pop");
		pop.show();
		
		pop.find("div.ctc").css("width", pop.width());
		pop.find("div.cbc").css("width", pop.width());
	})
})

$(function(){
	$('#topmenu').hover(
		function () {},
		function() {
			$("div.pop").hide();
		}
	)
})

$(function(){
	$('.b-promo .sh-in').hover(
		function () {
		$(this).find('.img').fadeOut(300);
		$(this).find('.img-wide').fadeIn(300);
		$(this).animate({width: '340px', height: '134px'}, 200);
		$(this).parent().animate({top: '-16px', left: '-17px'}, 200);
		$(this).parent().css('z-index','100');
	}, 

		function () {
		$(this).find('.img').fadeIn(300);
		$(this).find('.img-wide').fadeOut(200);
		$(this).animate({width: '306px', height: '102px'}, 200);
		$(this).parent().animate({top: '0', left: '0'}, 200);
		$(this).parent().css('z-index','');
	});
});

$(function(){
	$('#phone-big .cover').click(function() {
		$('#phone-big').hide();
		$('html').removeClass('screenShow');
		$('body').removeClass('screenShow');
	});
});

$(document).keydown( function( e ) {
	if( e.which == 27) {
		$('#phone-big').hide();
		$('html').removeClass('screenShow');
		$('body').removeClass('screenShow');
	}
});

$('.slideblock H2 A').click(function() {
	if($('.slideblock').className !== 'slideblock slideblock-active') {
		$('.slideblock').find('P').slideUp('fast', function() {
			$('.slideblock').removeClass('slideblock-active');
		});

		$(this).parent().parent().find('P').slideDown('fast', function() {
			$(this).parent().addClass('slideblock-active');
		});
	}

	return false;
});

$(function() {
	$("dl.faq dt a").click(function() {
		$(this).parents("dt").next("dd").toggle();
		$(this).toggleClass("opened");
		return false;
	})
})

$('.pseudoselect').each(function() {
	$(this).click(function() {
		var opt = $(this).children('.pseudooption')
		opt.toggle();
		window.pseudoMenu = opt.is(':visible') ? opt : null
			
		if(!!navigator.userAgent.match(/iP((o|a)d|hone)/)) {
	  		$('#pseudooption_ipad_scroller').jScrollPane();
		}
		
		return false
		
	})
	var opts = $(this).children("ul");
	if (opts.height() > 200) {
		opts.css("height", "200px");
	} 
});

$(document).click(function(){
	window.pseudoMenu = window.pseudoMenu && window.pseudoMenu.hide() && null
})

$(function() {
	$(".service-menu #arr").each(function() {
		var arrHeight = $(this).siblings("span").height() + 40;
		$(this).height(arrHeight);
		
		if ($(this).parents("li").prev("li").length == 0) {
			$(".service-menu .t").hide();
		}
		if ($(this).parents("li").next("li").length == 0) {
			$(".service-menu .b").hide();
		}
		
		$(this).show();
	})
})

fixPopupHeight = function(defer) {
	var myframe = window.parent.document.getElementById('roaming-popup'),
		heightChanger = function() {
			try {
				myframe.style.height = 100 + 'px';

				if (window.navigator.userAgent.search('MSIE 6.0') != -1) {
					myframe.style.height = 250 + 'px';
				}

				height = $(document).height()

				if (window.opera) {
					//height += 120;
				}

				if (height > 0) {
					myframe.style.height = height + 'px';
				}
			} catch(e) {}
		};
	
	if (myframe !== null && (window.parent !== window || defer)) {
		 window.onload = heightChanger
		
		if(defer) {
			window.setTimeout(heightChanger, 50)
		}
	
	}
};



$(function() {
	$("body.roaming #content div.places a").click(function() {
		var top = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop;
		$("#iframePopupWrapper").css({"visibility": "hidden", "top": top}).show();
		$("#roamingLoader").css("top", top+100).show();
		if (window.opera) {
			//window.scrollTo(0,0);
		}
		$("body").addClass("popup-opened");
	});
	
	$("#iframePopupWrapper a.close").click(function(e) {
		e.preventDefault();
		$(this).parents("div#iframePopupWrapper").hide();
		$("body", window.regionsIframe.document).html("");
		$("iframe#roaming-popup").height("300px");
		$("#roamingLoader").hide();
		$("body").removeClass("popup-opened");
		return false;
	})
});
$(function() {
	$("body.roaming-popup").each(function() {
		var loader = window.parent.document.getElementById("roamingLoader");
		var popup = window.parent.document.getElementById("iframePopupWrapper");
		$(popup).css("visibility", "visible");
		$(loader).hide();
	})
});

$(function() {
	$("ul.category li").click(function() {
		var selected = $(this);
		var category = $(this).attr('name');
		if (!$(this).hasClass("selected")) {
			$("li.selected").removeClass('selected');
			$(selected).addClass('selected');
			
			$('ul.tariffs', document).each(function() {
				if(!$(this).hasClass('hidden')) {
					$(this).addClass('hidden');
				} else if ($(this).attr('id') == 'category_'+category) {
					$(this).removeClass('hidden');
				}
			});
			fixTariffsList();
		}
		return;
	});
});
$(function() {
	var elem = location.href.split('#');
	var bodyClass = $('body').hasClass('tariffs');

     if(elem[1] && bodyClass) {
		$('ul.category li').each(function() {
			if ($(this).attr('name') !== elem[1]) {
				$(this).removeClass('selected');
			} else {
				$(this).addClass('selected');
 			}
		});
		
		$('ul.tariffs').each(function() { 
			if($(this).attr('id') == 'category_'+elem[1]) {
				$(this).removeClass('hidden');
			} else {
				$(this).addClass('hidden');
			}
		});
	}
});

$(function() {
	$('.details ul.switch li a').click(function() {
		var selected = $(this).parent();
		var list     = $(selected).parent().parent();

		$('ul.switch .active', list).removeClass('active');
		$(selected).addClass('active');

		var display = $(selected).attr('name');

		var container = $(list).parent();
		$('div.descr', container).each(function() { if($(this).attr('id') == 'tariff_'+display) {$(this).removeClass('hidden')} else {$(this).addClass('hidden')}});

		return;
	});
});

$(function() {
	$('.details ul.discountSwitcher li span').click(function() {
		var selected = $(this).parent();
		var list     = $(selected).parent().parent();

		$('ul.discountSwitcher .active', list).removeClass('active');
		$(selected).addClass('active');

		var display = $(selected).attr('name');

		var container = $(list).parent();

		$('div.descr', container).each (function() {
			if ($('div.discount', this).hasClass('hidden') && display == 'discount') {
				$('div.discount', this).removeClass('hidden');
				$('div.nodiscount', this).addClass('hidden');
			} else if ($('div.nodiscount', this).hasClass('hidden') && display == 'nodiscount') {
				$('div.nodiscount', this).removeClass('hidden');
				$('div.discount', this).addClass('hidden');
			} 
		});
	});
});

$(function() {
	var elem = location.href.split('#');
	var bodyClass = $('body').hasClass('tariff');

	if(elem[1] && bodyClass) {
		$('.details ul.switch li').each(function() {
			if ($(this).attr('name') !== elem[1]) {
				$(this).removeClass('active');
			} else {
				$(this).addClass('active');
			}
		});

		$('.details div.descr').each(function() { 
			if($(this).attr('id') == 'tariff_'+elem[1]) {
				$(this).removeClass('hidden');
			} else {
				$(this).addClass('hidden');
			}
		});
	}
});

$(function() {
	var servicesgroup = document.getElementById('servicesgroup');

	if (servicesgroup === null) {
		return;
	}

	var full    = document.getElementById('servicesgroup_full');
	var content = document.getElementById('content');

	var as = servicesgroup.getElementsByTagName('a');
	var ab = full.getElementsByTagName('a');

	var current = window.location.href.match(/#(.+)$/i);

	for(i in as) {
		if (i !== 'length') {
			as[i].onclick = function() {
				xpn = this.getAttribute('xpathname');
				var tmp = full.getElementsByTagName('li');
				for(i in tmp) {
					if (i !== 'length' && tmp[i].parentNode == full) {
						tmp[i].style.display = (tmp[i].className == xpn) ? 'block' : 'none';
					}
				}
				this.parentNode.parentNode.style.display = 'none';

				window.location.href = this.href.replace(xpn+'.html', '#'+xpn);
				content.scrollIntoView();
				return false;
			}

			if (current !== null && as[i].getAttribute('xpathname') === current[1]) {
				as[i].click();
			}
		}
	}

	for(i in ab) {
		if (i !== 'length' && ab[i].className == 'back') {
			ab[i].onclick = function() {
				var tmp = full.getElementsByTagName('li');
				for(i in tmp) {
					if (i !== 'length' && tmp[i].parentNode == full) {
						tmp[i].style.display = 'none';
					}
				}
				servicesgroup.style.display = 'block';
	
				window.location.href = this.href+'#servicesgroup';

				content.scrollIntoView();
				return false;
			}
		}
	}
});

$(function() {
	function ArrayFromCollection(c) {
		var a = new Array();

		for (var i=0; i<c.length; i++) {
			if(typeof c[i] === 'object') {
				a[i] = c[i];
			}
		}

		return a;
	}
	var roamingData     = document.getElementById('roamingData');
	var roamingCity     = document.getElementById('roamingCity');
	var roamingZone     = document.getElementById('roamingZone');
	var roamingZoneLink = document.getElementById('roamingZoneLink');
	
	if (roamingZone  != null && roamingZoneLink != null) {
		hash = window.location.hash.replace(/#/, '');

		if (hash !== 'worldzone') {
			roamingZone.style.display = 'none';
		} else {
			roamingZone.scrollIntoView(true);
			roamingZoneLink.parentNode.className = 'hideSpan';
		}

		roamingZoneLink.onclick = function() {
			roamingZone.style.display = (roamingZone.style.display === '') ? 'none'     : '';
			this.parentNode.className = (roamingZone.style.display === '') ? 'hideSpan' : '';
		}
	}

	if (roamingData  != null && roamingCity  != null) {
		function SelectRoamingCity() {
			if (current !== null) {
				current.div.className = '';
				current.parentNode.className = '';
			}

			this.div.className = 'current';
			this.parentNode.className = 'current';

			current = this;
			fixPopupHeight("after litil timeout");
			return false;
		}

		hash = window.location.hash.replace(/#/, '');

		roamingData.className = 'roamingDataHide';

		divs = ArrayFromCollection(roamingData.getElementsByTagName('div'));
		as   = ArrayFromCollection(roamingCity.getElementsByTagName('a'));

		var current = null;
		var change  = null;

		divsRight = [];
		// filter 
		for(i in divs) {
			if (typeof divs[i] != 'object') {
				continue;
			}

			if (divs[i].parentNode == roamingData) {
				divsRight[divsRight.length] = divs[i];
			}
		}

		for(i in as) {
			if (typeof as[i] != 'object') {
				continue;
			}

			var a = as[i];
			if (a.parentNode.className === 'current') {
				current = a;
			}

			if (hash.length && a.href.indexOf(hash) !== -1) {
				change = a;
			}
			a.div = divsRight[i];

			a.onclick = SelectRoamingCity;
		}

		if (change !== null) {
			SelectRoamingCity.call(change);
		}
	}
});

$(function() {
	fixPopupHeight();
});

fixTariffsList = function() {
	$("ul.tariffs").each(function() {
		$(this).children("li").each(function() {
			var h = $(this).height();
			var n = $(this).next("li");
			var p = $(this).prev("li");
			var pp = p.prev("li");
			if (!$(this).hasClass("third")) {
				if (h > n.height()) {
					n.height(h);
				}
				if (!p.hasClass("third") && h > p.height()) {
					p.height(h);
				}
			} else {
				if (h > p.height()) {
					p.height(h);
				}
				if (h > pp.height()) {
					pp.height(h);
				}
				if (!n.hasClass("last")) {
					n.addClass("cb");
				}
			}
		})
	})
}
fixTariffsList();

$(function() {
	if ($.browser.msie) {
		$("div#marks_popup").wrapInner("<div class='b-wrap' />").wrapInner("<div class='b-wrap2' />");
		fixMarksCorners();
	}
});
fixMarksCorners = function() {
	$("#marks_popup b").remove();
	var corners = $('<b class="tr"></b><b class="tl"></b><b class="br"></b><b class="bl"></b>');
	corners.appendTo("div#marks_popup");
}
$(function() {
	function setupBookmarks(data) {
		$("#marks_popup ul").html('');
		for(var idx in data.items) {
			$("#marks_popup ul").append('<li><a bb:i="'+idx+'" href="'+data.items[idx].u+'">'+data.items[idx].t+'</a><i></i></li>');
		}
		if(!data.allow_add) { 
			$('a#addBookmark').hide();
		} else {
			$('a#addBookmark').show();
		}
		if ($.browser.msie) {
			fixMarksCorners();
		}
		// remove bookmark
		$("div#marks_popup ul li i").click(function() {
			var req = { "a": 3, "i": $(this).parent().children('a').attr('bb:i')};
			$.post('/ext/bookmarks.phtml', req, function(data) {
				setupBookmarks(data);
			}, 'json');
		});
	}
	
	$("a#bookMarks").click(function() {
		$(this).next("#marks_popup").show();
		$(this).children("span").removeClass("dashed");
		return false;
	});

	$("a#closeMarks").click(function() {
		$(this).parents("#marks_popup").hide().prev("#bookMarks").children("span").addClass("dashed");
		return false;
	});

	// add bookmark
	$('a#addBookmark').click(function() {
		var req = { "a": 2, "t": document.title};
		$.post('/ext/bookmarks.phtml', req, function(data) {
			setupBookmarks(data);
		}, 'json');
		return false;
	});

	// load bookmarks
	$.post('/ext/bookmarks.phtml', '{}', function(data) {
		setupBookmarks(data);
	}, 'json');

});

$(function() {
	var prefix = "", phone = "";
	$(document.cookie.split(';')).each(function(k, v){
		var pair = v.split('=')
		switch($.trim(pair[0])){
			case "sms_service[phone]" :
				phone = $.trim(pair[1] || "")
				break;
			case "sms_service[prefix]" :
				prefix = $.trim(pair[1] || "")
				break;
		}
		if(prefix.length && phone.length)
			return false;
	});
	$("div.service_lite_sms_form .close").click(function(){
		$(this).parent().hide();
	});
	$(".service_lite_sms_form_open").click(function(){
		$("div.service_lite_sms_form .close").click();
		$(this).next("div.service_lite_sms_form").show();
	});
	$("div.service_lite_sms_form, div.service_sms_form")
		.find('form')
		.find("select option[value=" + prefix + "]").attr("selected", "selected")
		.end()
		.find("input:text").val(phone)
		.end()
		.append('<input type="hidden" name="ajax" value="1" />')
		.submit(function(){
			var _form = $(this)
			_form.children("img.loader").show();
			_form.children('input:image').attr("disabled","disabled").addClass('transparent')
			$.post(_form.attr('action'), _form.serialize(), function(data){
				_form.children("img.loader").hide();
				if(data.result == 'OK'){
					_form.replaceWith($('<p class="notice success">' + data.notice + '</p>').hide().fadeIn('normal'))
				} else if(data.result == 'ERROR'){
					_form.children('p.notice:first').hide().addClass('error').text(data.notice).fadeIn('normal')
					setTimeout(function(){
						_form.children('input:image').removeAttr("disabled").removeClass('transparent')
					}, 500)
				}
			}, "json")
			return false
		})
});

$(function() {
	$("body").click(function(e) {
		if (!$(e.target).closest('.twitter-option-bubble').length) {
			$(".twitter-option-bubble").hide();
			$(".social-links #tw_ic").removeClass("hover");
		}
	});

	$(".social-links #tw_ic").click(function() {
		$(this).addClass("hover");
		$(".twitter-option-bubble").show();
		return false;
	});
	$(".twitter-option-bubble .close").click(function() {
		$(".twitter-option-bubble").hide();
		$(".social-links #tw_ic").removeClass("hover");
		return false;
	});
});

$(function() {
	$('.tabsblock ul.tabs li a').click(function() {
		var selected = $(this).parent();
		var list     = $(selected).parent().parent();

		$('ul.tabs .active', list).removeClass('active');
		$(selected).addClass('active');

		var display = $(selected).attr('name');

		var container = $(list).parent();
		$('div.info', container).each(function() { if($(this).attr('id') == 'option_'+display) {$(this).removeClass('hidden')} else {$(this).addClass('hidden')}});

		return;
	});
});

$(function() {
	var elem = location.href.split('#');
	var bodyClass = $('body').hasClass('toptions');

	if(elem[1] && bodyClass) {
		$('.tabsblock ul.tabs li').each(function() {
			if ($(this).attr('name') !== elem[1]) {
				$(this).removeClass('active');
			} else {
				$(this).addClass('active');
			}
		});

		$('.tabsblock div.info').each(function() { 
			if($(this).attr('id') == 'option_'+elem[1]) {
				$(this).removeClass('hidden');
			} else {
				$(this).addClass('hidden');
			}
		});
	}
});

$(function(){
	$('.service_sms_form_open_button').click(function() {
		var open_class_name = "service_sms_form_open";
		var sms_form = $(this).next();
		
		$('.service_sms_form').removeClass(open_class_name);
		
		if(sms_form.hasClass(open_class_name)) {
			sms_form.removeClass(open_class_name);
		} else {
			sms_form.addClass(open_class_name);
		}
		
		return;
	});
});

$(function(){
	$('.service_sms_form .close').click(function() {
		$(".service_sms_form").removeClass("service_sms_form_open");
	});
});
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}('h.i[\'1a\']=h.i[\'z\'];h.O(h.i,{y:\'D\',z:9(x,t,b,c,d){6 h.i[h.i.y](x,t,b,c,d)},17:9(x,t,b,c,d){6 c*(t/=d)*t+b},D:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},13:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},X:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},U:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},R:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t+b;6 c/2*((t-=2)*t*t+2)+b},N:9(x,t,b,c,d){6 c*(t/=d)*t*t*t+b},M:9(x,t,b,c,d){6-c*((t=t/d-1)*t*t*t-1)+b},L:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t+b;6-c/2*((t-=2)*t*t*t-2)+b},K:9(x,t,b,c,d){6 c*(t/=d)*t*t*t*t+b},J:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t*t*t+1)+b},I:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t*t+b;6 c/2*((t-=2)*t*t*t*t+2)+b},G:9(x,t,b,c,d){6-c*8.C(t/d*(8.g/2))+c+b},15:9(x,t,b,c,d){6 c*8.n(t/d*(8.g/2))+b},12:9(x,t,b,c,d){6-c/2*(8.C(8.g*t/d)-1)+b},Z:9(x,t,b,c,d){6(t==0)?b:c*8.j(2,10*(t/d-1))+b},Y:9(x,t,b,c,d){6(t==d)?b+c:c*(-8.j(2,-10*t/d)+1)+b},W:9(x,t,b,c,d){e(t==0)6 b;e(t==d)6 b+c;e((t/=d/2)<1)6 c/2*8.j(2,10*(t-1))+b;6 c/2*(-8.j(2,-10*--t)+2)+b},V:9(x,t,b,c,d){6-c*(8.o(1-(t/=d)*t)-1)+b},S:9(x,t,b,c,d){6 c*8.o(1-(t=t/d-1)*t)+b},Q:9(x,t,b,c,d){e((t/=d/2)<1)6-c/2*(8.o(1-t*t)-1)+b;6 c/2*(8.o(1-(t-=2)*t)+1)+b},P:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6-(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b},H:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6 a*8.j(2,-10*t)*8.n((t*d-s)*(2*8.g)/p)+c+b},T:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d/2)==2)6 b+c;e(!p)p=d*(.3*1.5);e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);e(t<1)6-.5*(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b;6 a*8.j(2,-10*(t-=1))*8.n((t*d-s)*(2*8.g)/p)*.5+c+b},F:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*(t/=d)*t*((s+1)*t-s)+b},E:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},16:9(x,t,b,c,d,s){e(s==u)s=1.l;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.B))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.B))+1)*t+s)+2)+b},A:9(x,t,b,c,d){6 c-h.i.v(x,d-t,0,c,d)+b},v:9(x,t,b,c,d){e((t/=d)<(1/2.k)){6 c*(7.q*t*t)+b}m e(t<(2/2.k)){6 c*(7.q*(t-=(1.5/2.k))*t+.k)+b}m e(t<(2.5/2.k)){6 c*(7.q*(t-=(2.14/2.k))*t+.11)+b}m{6 c*(7.q*(t-=(2.18/2.k))*t+.19)+b}},1b:9(x,t,b,c,d){e(t<d/2)6 h.i.A(x,t*2,0,c,d)*.5+b;6 h.i.v(x,t*2-d,0,c,d)*.5+c*.5+b}});',62,74,'||||||return||Math|function|||||if|var|PI|jQuery|easing|pow|75|70158|else|sin|sqrt||5625|asin|||undefined|easeOutBounce|abs||def|swing|easeInBounce|525|cos|easeOutQuad|easeOutBack|easeInBack|easeInSine|easeOutElastic|easeInOutQuint|easeOutQuint|easeInQuint|easeInOutQuart|easeOutQuart|easeInQuart|extend|easeInElastic|easeInOutCirc|easeInOutCubic|easeOutCirc|easeInOutElastic|easeOutCubic|easeInCirc|easeInOutExpo|easeInCubic|easeOutExpo|easeInExpo||9375|easeInOutSine|easeInOutQuad|25|easeOutSine|easeInOutBack|easeInQuad|625|984375|jswing|easeInOutBounce'.split('|'),0,{}))

/* ------------------------------------------------------------------------
	Class: zoombox
	Author: Jonathan Boyer (http://www.grafikart.fr)
	Version: 1.1
------------------------------------------------------------------------- */
zoombox = {
	/***************************************
	 *
	 *     	CONFIGURATION
	 * 
	 * **********************************/
	Dwidth : 		640, 		// Default width
	Dheight: 		480,		// Default height
	duration:		200,		// Animation duration (ms)
	animation:		"all",		// Do we animate the size of the box ?  (all : animation everytime, img: animation only on link with an img, no : no size animation)
	maskOpacity:	0,		// Opacity of the black overlay,
	FLVPlayer:		"/swf/FLVplayer.swf",   // URL of the FLV Player
	MP3Player:	    "/swf/MP3player.swf",  // URL of the MP3 Player
	allowOverflow:	false,	// Automatically adjust width/height of the box if the content is larger than the window
	bindable:		"a[rel^='zoombox']",  // (jQuery expression) elements which have the zoombox behaviour
	theme:		"default", 			// Define the theme to use
	fixed:		true,			// Do we fix the box ? => when we scroll the box follow the window or not ?
	
	/**
	 * You can define here your own custom structure to create a new look for the box (\ at the end of lines are used to make multiline string)
	 *	IMPORTANT ELEMENTS
	 *	#zoombox			=> Needed to select all the box elements (don't delete !)
	 *	.zoombox_close 	=> A Click on these elements will close the box
	 *	#zoombox_aplat	=> The black overlay
	 *	#zoombox_content	=> The content will be placed here
	 *	#zoombox_title span		=> Title of the link will be displayed here
	 *	#zoombox_next, zoombox_prev => Clickable button used to navigate in the galery
	 * */
	themes:{
		"default" :	 '\
			<div id="zoombox"> \
				<div id="zoombox_aplat" class="zoombox_close"></div>\
				<div id="zoombox_contener">\
					<div id="zoombox_relative">\
						<div id="zoombox_close" class="zoombox_close"></div>\
						<div id="zoombox_content"></div>\
						<div id="zoombox_bg"><div class="zoombox_bg_h"></div><div class="zoombox_bg_b"></div><div class="zoombox_bg_d"></div><div class="zoombox_bg_g"></div><div class="zoombox_bg_bg"></div><div class="zoombox_bg_bd"></div><div class="zoombox_bg_hg"></div><div class="zoombox_bg_hd"></div></div>\
						<div id="zoombox_nav">\
							<table>\
								<tr>\
									<td width="39"><div id="zoombox_prev"></div></td>\
									<td><div id="zoombox_title"><span></span></div></td>\
									<td width="39"><div id="zoombox_next"></div></td>\
								</tr>\
							</table>\
						</div>\
					</div>\
				</div>\
			</div>\
			',
		// A theme that imitate the lightbox design
		"lightbox" :	 '\
			<div id="zoombox" class="lightbox"> \
				<div id="zoombox_aplat" class="zoombox_close"></div>\
				<div id="zoombox_contener">\
					<div id="zoombox_relative">\
						<div id="zoombox_content"></div>\
						<div id="zoombox_bg"><div class="zoombox_bg_h"></div><div class="zoombox_bg_b"></div><div class="zoombox_bg_d"></div><div class="zoombox_bg_g"></div><div class="zoombox_bg_bg"></div><div class="zoombox_bg_bd"></div><div class="zoombox_bg_hg"></div><div class="zoombox_bg_hd"></div></div>\
						<div id="zoombox_infos"<div id="zoombox_title"><span></span></div></div>\
						<div id="zoombox_close" class="zoombox_close"></div>\
						<div id="zoombox_next"></div><div id="zoombox_prev"></div>\
					</div>\
				</div>\
			</div>\
			'
	},


	/***************************************
	 *
	 *     	VARIABLES
	 * 
	 * **********************************/
	// Needed variable and their explanation
	inCSS:		null, 			// Initial CSS propertires
	
	width:		0,
	height:		0,
	
	url:			null,			// Url loaded in the box
	title:			null,			// Title of the link
	type:		"multimedia",	// Keep the type of media loaded in the box
	animateOpening: false,		// Do we use animation for opening/closing the box ?
	timer:		null,			// Timer to load an img
	loaded:		false,		// Is the image loaded ?
	gallery:		"",			// Gallery of the current element
	position:		0,			// Current position in the gallery
	margesH:		null,			// Horizontal marges of contener
	margesV:		null,			// Vertical marges of contener

	// Regular expressions needed for the content
	filtreImg:			/(\.jpg)|(\.jpeg)|(\.bmp)|(\.gif)|(\.png)/i,
	filtreMP3:			/(\.mp3)/i,
	filtreFLV:			/(\.flv)/i,
	filtreSWF:			/(\.swf)/i,
	filtreQuicktime:	/(\.mov)|(\.mp4)/i,
	filtreWMV:			/(\.wmv)|(\.avi)/i,
	filtreDailymotion:	/(http:\/\/www.dailymotion)|(http:\/\/dailymotion)/i,
	filtreVimeo:		/(http:\/\/www.vimeo)|(http:\/\/vimeo)/i,
	filtreYoutube:		/(youtube\.)/i,
	filtreKoreus:		/(http:\/\/www\.koreus)|(http:\/\/koreus)/i,
	filtreDeezer:		/(http:\/\/www\.deezer)|(http:\/\/deezer)/i,
	
	galleryRegExp:  /\[(?:.*)\]/,
	
	
	/***************************************
	 *
	 *     	FUNCTIONS
	 * 
	 * **********************************/
	/**
	 * Init the box binding "click" on every links with rel="zoombox and doing some cool stuff
	 * */
	init : function(){
		zoombox.images = new Array();	  // Array used to stock the "gallery"
		$(zoombox.bindable).each(function(){
			var gallery = zoombox.galleryRegExp.exec($(this).attr("rel"));
			if(!zoombox.images[gallery]){
				zoombox.images[gallery]=new Array();
			}
			zoombox.images[gallery].push($(this));
			
			//We bind click on every elements
			$(this).bind('click',function(){
				zoombox.click($(this));
				return false;
			});
		});
		$(window).resize(zoombox.resize);
		$(window).scroll(zoombox.resize);
		$(document).keyup(function(event){ zoombox.keyboard(event); });
	},
	
	/**
	 * Function called when we click one an element OR when we use next or before
	 * */
	click : function(div){
		zoombox.gallery=zoombox.galleryRegExp.exec(div.attr("rel"));	// The current Gallery
		// The position of the image in the current Gallery
		for (var i = 0; i < zoombox.images[zoombox.gallery].length; i++){
			if($(zoombox.images[zoombox.gallery][i]).html()  == div.html() && $(zoombox.images[zoombox.gallery][i]).attr("href") == div.attr("href") ){
				zoombox.position=i;
				break;
			}
		}
		zoombox.animateOpening=false;
		
		// We adjust the size and position of the box to fit with the current element if animation is needed
		if(zoombox.animation=="all"){
			zoombox.animateOpening=true;
			zoombox.inCSS = {
				"top" :	 div.offset().top,
				"left" :	div.offset().left,
				"width":	div.width(),
				"height":   div.height()
			}
		}
		if(div.children("img").length && (zoombox.animation=="all" || zoombox.animation=="img")){
			zoombox.inCSS = {
				"top" :	 div.children("img").offset().top,
				"left" :	div.children("img").offset().left,
				"width":	div.children("img").width(),
				"height":   div.children("img").height()
			}
			zoombox.animateOpening=true;
		}
						
		// We keep important informations
		zoombox.url=div.attr("href");			// We keep the url
		zoombox.title=div.attr("title");			// We keep the title
		dimensions =div.attr("rel").split(' ');		// We parse the rel attr to get the size of the box
		if((dimensions[1])&&(dimensions[2]) && parseInt(dimensions[1])>0  && parseInt(dimensions[2])>0 ){ zoombox.width = parseInt(dimensions[1]); zoombox.height =  parseInt(dimensions[2]);}
		else{zoombox.width=zoombox.Dwidth; zoombox.height=zoombox.Dheight;}
				
		zoombox.open();
		return false;
	},
	
	/**
	 * Open the box, this function could be called with javascript if you want to open a box with a specific action.
	 * @param url The link that you want to open in the box
	 * @param width (optional) Width of the box
	 * @param height (optional) Height of the box
	 * */
	open : function(url,width,height){
		// Do we use the function alone ?
		if(url!=undefined){
			zoombox.url=url;
			if(width==undefined){	zoombox.width=zoombox.Dwidth;	}	else{	zoombox.width=width;	}
			if(height==undefined){	zoombox.height=zoombox.Dheight;	}	else{	zoombox.height=height;	}	
			zoombox.animateOpening=false;
			zoombox.title = null;
		}
		// if the content is an img
		if(zoombox.filtreImg.test(zoombox.url) && zoombox.loaded==false){
		    img=new Image();
			img.src=zoombox.url;
			zoombox.type="img";
			$("body").append('<div id="zoombox_loader"></div>');
			$("#zoombox_loader").css("marginTop",zoombox.scrollY());
			zoombox.timer = window.setInterval("zoombox.loadImg(img)",100);
			return false;
		}
		zoombox.loaded=false;
		
		// Let's begin !!
		// If there isn't already a zoombox opened
		if(!$("#zoombox").length){
			$("body").append(zoombox.themes[zoombox.theme]);	// We create the zoombox structure
			// We place the overlay
			$("#zoombox_aplat").css({
				"height":zoombox.windowH(),
				"width":zoombox.windowW()
			});
			// we find the width/height of the marges
			if(zoombox.margesH==null){ zoombox.margesH = parseInt($("#zoombox_contener").css("paddingLeft")) + parseInt($("#zoombox_contener").css("paddingRight")) + parseInt($("#zoombox_contener").css("marginLeft")) + parseInt($("#zoombox_contener").css("marginRight")); }
			if(zoombox.margesV==null){ zoombox.margesV = parseInt($("#zoombox_contener").css("paddingTop")) + parseInt($("#zoombox_contener").css("paddingBottom")) + parseInt($("#zoombox_contener").css("marginTop")) + parseInt($("#zoombox_contener").css("marginBottom")); }
			
			$("#zoombox_next").hide();				// We hide some elements, we'll display them later if ther are needed
			$("#zoombox_prev").hide();
			$("#zoombox_title").hide();
			$(".zoombox_close").click(zoombox.close);		// We bind the "close" event
			$("#zoombox_next").click(zoombox.next);		// We bind the "next" event
			$("#zoombox_prev").click(zoombox.prev);		// We bind the "next" event
			$("embed").css("visibility","hidden"); 			// embed and object elements can generate overflow problem so we hide them
			$("object").css("visibility","hidden");
			if(zoombox.gallery){
				if(zoombox.position<zoombox.images[zoombox.gallery].length-1){
					$("#zoombox_next").show();
				}
				if(zoombox.position>0){
					$("#zoombox_prev").show();
				}
			}
			// We animate the black overlay
			$('#zoombox_aplat').css({'opacity': 0});
			$('#zoombox_aplat').fadeTo(zoombox.duration,zoombox.maskOpacity);
			// We adjust Two parameters that calculate the initial position of the box adding box margin
			if(zoombox.inCSS!=null){
				zoombox.inCSS.left-=parseInt($("#zoombox_contener").css("paddingLeft"))+parseInt($("#zoombox_contener").css("marginLeft"));
				zoombox.inCSS.top-=parseInt($("#zoombox_contener").css("paddingTop"))+parseInt($("#zoombox_contener").css("marginTop"));
			}
			var boxBeginCSS = zoombox.inCSS;
		}
		// If there is already a zoombox it's because we want a cool transition, so let's make some change.
		else{
			$("#zoombox_title span").empty();
			$("#zoombox_content").empty();				

			var boxBeginCSS = {
				"width":$("#zoombox_contener").css("width"),
				"height":$("#zoombox_contener").css("height"),
				"top":$("#zoombox_contener").css("top"),
				"left":$("#zoombox_contener").css("left")
			}
			var transition = true;
		}
		
		var content = zoombox.getContent(zoombox.url);					// What we want to insert
		if(zoombox.type=="img"){ $("#zoombox_content").append(content); }		// If it's an image we inset NOW
		if(transition){ $("#zoombox_content img").hide(); }					// If it's a transition (next or prev) we hide the image for a fadeIn
		if(zoombox.title && zoombox.title!="" && zoombox.title!=null){ $("#zoombox_title span").append(zoombox.title); $("#zoombox_title").show();   }  // Do we have a title ?
		else{ $("#zoombox_title").hide();	$("#zoombox_titlel").hide();	$("#zoombox_title").hide(); }// The box won't fit in the window
		if(zoombox.allowOverflow==false && (zoombox.height+120)>zoombox.windowH()){
			zoombox.width=zoombox.width*((zoombox.windowH()-120)/zoombox.height);
			zoombox.height=(zoombox.windowH()-120);
			var content = zoombox.getContent(zoombox.url);
		}
		
		// The new CSS for the box, final position
		var topPos = (zoombox.windowH() - zoombox.height - zoombox.margesV)/2 + zoombox.scrollY();
		var leftPos = (zoombox.windowW() - zoombox.width - zoombox.margesH)/2;

		var cssProp = {
			"width":zoombox.width,
			"height":zoombox.height,
			"top":topPos,
			"left":leftPos
		}
		
		//Do we want animation ? 
		if(zoombox.animateOpening==false && transition !=true){
			$("#zoombox_contener").css(cssProp);
			$('#zoombox_contener').hide();
			$('#zoombox_contener').show();
			$("#zoombox_content").empty().append(content);
		}
		else{
			$("#zoombox_contener").css(boxBeginCSS);
			$("#zoombox_contener").animate(cssProp,zoombox.duration,function(){
				if(zoombox.type=="img"){
						$("#zoombox_content img").fadeIn(zoombox.duration/2);
				}
				else{
					$("#zoombox_content").empty().append(content);
				}
			});
		}
	},
	
	/**
	 * Close the box
	 * */
	close : function(){
	    $('html').removeClass('screenShow');
        $('body').removeClass('screenShow');
		window.clearInterval(zoombox.timer);
		// To avoid lags we remove the content before animation if it isn't an image
		if(zoombox.type!="img"){	$("#zoombox_content").empty();	}	
		if(zoombox.animateOpening==true){
			zoombox.inCSS.opacity = 0; 
			$("#zoombox_contener").animate(zoombox.inCSS,zoombox.duration);
		}
		else{
			$("#zoombox_contener").remove();
		}
		$("#zoombox_aplat").animate({"opacity":0},zoombox.duration,zoombox.remove);
	},
	
	/**
	 * Destroy the zoombox structure
	 * */
	remove : function(){
		$("#zoombox").remove();
		$("#zoombox_loader").remove();
		$("embed").css("visibility","visible");  // embed and object elements can generate overflow problem so we hide them
		$("object").css("visibility","visible");
	},
	
	/**
	 *	When the window is resized we reposition the box
	 * */
	resize : function(){
		// The new CSS for the box, final position
		var topPos = (zoombox.windowH() - zoombox.height - zoombox.margesV)/2 + zoombox.scrollY();
		var leftPos = (zoombox.windowW() - zoombox.width - zoombox.margesH)/2;
		$("#zoombox_contener").css("left",leftPos);
		// We place the overlay
		$("#zoombox_aplat").css({
			"height":zoombox.windowH(),
			"width":zoombox.windowW()
		});
		// Do we fix the box ?
		if(zoombox.fixed){	$("#zoombox_contener").css("top",topPos);	}
	},
	
	/**
	 *   If we press some keys when zoombox is opened
	 *   */
	keyboard : function(event){
      		if(event.keyCode==39){
      			zoombox.next();
      		}
      		else if(event.keyCode==37){
      			zoombox.prev()
      		}
      		else if(event.keyCode==27){
      			zoombox.close();
		}
	},
	/**
	 * Go to the next element in the gallery
	 * */
	next : function(){
		if(zoombox.gallery!=null){
			zoombox.position++;
			if(zoombox.position==zoombox.images[zoombox.gallery].length-1){
				$("#zoombox_next").fadeOut();
			}
			if($("#zoombox_prev").is(":hidden")){
				$("#zoombox_prev").fadeIn();
			}
			zoombox.click(zoombox.images[zoombox.gallery][zoombox.position]);
		}
	},
	
	/**
	 * Go to the previous element in the gallery
	 * */
	prev : function(){
		if(zoombox.gallery!=null){
			zoombox.position--;
			if(zoombox.position==0){
				$("#zoombox_prev").fadeOut();
			}
			if($("#zoombox_next").is(":hidden")){
				$("#zoombox_next").fadeIn();
			}
			zoombox.click(zoombox.images[zoombox.gallery][zoombox.position]);
		}
	},

	/**
	 * Used with timer this function animate the loading of an image
	 * */
	loadImg : function(img){
			if(img.complete){
				window.clearInterval(zoombox.timer);
				zoombox.loaded=true;
				zoombox.width=img.width;
				zoombox.height=img.height;
				$('#zoombox_loader').remove();
				// There is already an img in the content, FADE OUT !!
				if($('#zoombox_content img').length){
					$('#zoombox_content img').fadeOut(zoombox.duration/2,function(){$('#zoombox_content').empty(); zoombox.open();})
				}
				else{
					$('#zoombox_content').empty();
					zoombox.open();
				}
			}	
			// On anim le loader
			if(typeof(j)=='undefined'){j=0;}
 			$('#zoombox_loader').css({'background-position': "0px "+j+"px"});
			j=j-40;
			if(j<(-440)){j=0;}
	},
	
	 /**
	 * Return the HTML content depending of the link
	 * */
	getContent : function(url){
			var content
			
			// Some regular expression to test the filetype
			zoombox.type="multimedia";
	
			if(zoombox.filtreImg.test(url)){
				content='<img src="'+img.src+'" width="100%" height="100%"/>';
				zoombox.type="img";
			}
			else if(zoombox.filtreMP3.test(url)){
				zoombox.width=300;
				zoombox.height=40;
				content ='<object type="application/x-shockwave-flash" data="'+zoombox.MP3Player+'?son='+url+'" width="'+zoombox.width+'" height="'+zoombox.height+'">';
				content+='<param name="movie" value="'+zoombox.MP3Player+'?son='+url+'" /></object>';
			}		
			
			else if(zoombox.filtreFLV.test(url)){
				content='<embed src="'+zoombox.FLVPlayer+'?video='+url+'" width="'+zoombox.width+'" height="'+zoombox.height+'" allowscriptaccess="always" allowfullscreen="true" flashvars="file='+url+'&width='+zoombox.width+'&height='+zoombox.height+'&autostart=true" wmode="transparent" />';			
			}
			
			else if(zoombox.filtreSWF.test(url)){
				content='<object width="'+zoombox.width+'" height="'+zoombox.height+'"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="'+url+'" /><embed src="'+url+'" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="'+zoombox.width+'" height="'+zoombox.height+'" wmode="transparent"></embed></object>';		
			}
			
			else if(zoombox.filtreQuicktime.test(url)){
				zoombox.height = zoombox.height+20;
				content='<embed src="'+url+'" width="'+zoombox.width+'" height="'+zoombox.height+'" controller="true" cache="true" autoplay="true"/>';
			}
			
			else if(zoombox.filtreWMV.test(url)){
				content='<embed src="'+url+'" width="'+zoombox.width+'" height="'+zoombox.height+'" controller="true" cache="true" autoplay="true" wmode="transparent" />';
			}

			else if(zoombox.filtreDailymotion.test(url)){
				id=url.split('_');
				id=id[0].split('/');
				id=id[id.length-1];
				content='<object width="'+zoombox.width+'" height="'+zoombox.height+'"><param name="movie" value="http://www.dailymotion.com/swf/'+id+'&colors=background:000000;glow:000000;foreground:FFFFFF;special:000000;&related=0"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.dailymotion.com/swf/'+id+'&colors=background:000000;glow:000000;foreground:FFFFFF;special:000000;&related=0" type="application/x-shockwave-flash" width="'+zoombox.width+'" height="'+zoombox.height+'" allowFullScreen="true" allowScriptAccess="always" wmode="transparent" ></embed></object>';
			}
			
			
			else if(zoombox.filtreVimeo.test(url)){
				id=url.split('/');
				id=id[3];
				content='<object width="'+zoombox.width+'" height="'+zoombox.height+'"><param name="allowfullscreen" value="true" />	<param name="allowscriptaccess" value="always" />	<param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id='+id+'&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00AAEB&amp;fullscreen=1" />	<embed src="http://www.vimeo.com/moogaloop.swf?clip_id='+id+'&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00AAEB&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="'+zoombox.width+'" height="'+zoombox.height+'" wmode="transparent" ></embed></object>';
			}
			
			
			else if(zoombox.filtreYoutube.test(url)){
				id=url.split('watch?v=');
				id=id[1].split('&');
				id=id[0];
				content='<object width="'+zoombox.width+'" height="'+zoombox.height+'"><param name="movie" value="http://www.youtube.com/v/'+id+'&hl=fr&rel=0&color1=0xFFFFFF&color2=0xFFFFFF&hd=1"></param><embed src="http://www.youtube.com/v/'+id+'&hl=fr&rel=0&color1=0xFFFFFF&color2=0xFFFFFF&hd=1" type="application/x-shockwave-flash" width="'+zoombox.width+'" height="'+zoombox.height+'" wmode="transparent"></embed></object>';
			}
			
			
			else if(zoombox.filtreKoreus.test(url)){
				url=url.split('.html');
				url=url[0];
				content='<object type="application/x-shockwave-flash" data="'+url+'" width="'+zoombox.width+'" height="'+zoombox.height+'"><param name="movie" value="'+url+'"><embed src="'+url+'" type="application/x-shockwave-flash" width="'+zoombox.width+'" height="'+zoombox.height+'"  wmode="transparent"></embed></object>';
			}
			
			
			else if(zoombox.filtreDeezer.test(url)){
				zoombox.width=220;
				zoombox.height=55;
				id=url.split('/');
				id=id[id.length-1];
				content='<object width="220" height="55"><param name="movie" value="http://www.deezer.com/embedded/small-widget-v2.swf?idSong='+id+'&colorBackground=0x000000&textColor1=0xFFFFFF&colorVolume=0xFF6600&autoplay=0"></param><embed src="http://www.deezer.com/embedded/small-widget-v2.swf?idSong='+id+'&colorBackground=0x000000&textColor1=0xFFFFFF&colorVolume=0xFF6600&autoplay=0" type="application/x-shockwave-flash" width="220" height="55" wmode="transparent"></embed></object>';
			}
			
			else{
				if(zoombox.width==zoombox.Dwidth && zoombox.height==zoombox.Dheight){
					zoombox.width=zoombox.windowW()-100;
					zoombox.height=zoombox.windowH()-100;
				}
				content='<iframe src="'+url+'" width="'+zoombox.width+'" height="'+zoombox.height+'" border="0"></iframe>';
			}
			return content;
	},
	
	/**
	* Return the window height
	* */
	windowH : function(){
		if (window.innerHeight) return window.innerHeight  ;
		else{return $(window).height();}
	},
	
	/**
	 * Return the window width
	 * */
	windowW : function(){
		if (window.innerWidth) return window.innerWidth  ;
		else{return $(window).width();}
	},
	
	/**
	 *  Return the position of the top
	 *  */
	scrollY : function() {
		scrOfY = 0;
		if( typeof( window.pageYOffset ) == 'number' ) {
			//Netscape compliant
			scrOfY = window.pageYOffset;
		} else if( document.body && ( document.body.scrollTop ) ) {
			//DOM compliant
			scrOfY = document.body.scrollTop;
		} else if( document.documentElement && ( document.documentElement.scrollTop ) ) {
			//IE6 standards compliant mode
			scrOfY = document.documentElement.scrollTop;
		}
		return scrOfY;
	},

	/**
	 *  Return the position of the left scroll
	 *  */
	scrollX : function() {
		scrOfX = 0;
		if( typeof( window.pageXOffset ) == 'number' ) {
			//Netscape compliant
			scrOfX = window.pageXOffset;
		} else if( document.body && ( document.body.scrollLeft ) ) {
			//DOM compliant
			scrOfX = document.body.scrollLeft;
		} else if( document.documentElement && ( document.documentElement.scrollLeft ) ) {
			//IE6 standards compliant mode
			scrOfX = document.documentElement.scrollLeft;
		}
		 return scrOfX;
	}
};

$(document).ready(function(){
	zoombox.init();
});

$(function() {
	$(":input[placeholder]").each(function() {
		if(!$(this).val()) {
			var defVal = $(this).attr("placeholder");
			$(this).val(defVal);
		}
		$(this).addClass("placeholded");
	})
	
	$(":input[placeholder]"
	).each(function() {
		this.defVal = $(this).attr("placeholder") || this.value;
	}).focus(function() {
		if (this.value == this.defVal) this.value = '';
		$(this).removeClass("placeholded");
	}).blur(function() {
		if (this.value == '') {
			this.value = this.defVal;
			$(this).addClass("placeholded");
		}
	});
})
var rocon=(function(){var p=/\.rc(\d+)\b/,A=/\brc(\d+)\b/,K=/\brc-shape\b/,ae="rocon__",h="rocon",U=[],u={update:function(){},bindProperties:function(){var e=1;return function(aj,ai,ah){U.push({"id":e++,"rule":aj,"bg":B(j(ai),function(ak){if(ak.charAt(0)!="#"){ak="#"+ak;}return N(ak);}),"border_width":ah||0});};}(),process:function(e){y(e);}},w=null,v={},H=[],r=[],M=false,a=false,J=navigator.userAgent.toLowerCase(),f={},d={version:(J.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(J),opera:/opera/.test(J),msie:/msie/.test(J)&&!/opera/.test(J),mozilla:/mozilla/.test(J)&&!/(compatible|webkit)/.test(J)};function ad(){if(!M){M=true;if(r.length){for(var e=0;e<r.length;e++){r[e].call(document);}r=null;}}}function C(e){r.push(e);}function O(){if(a){return;}a=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);ad();},false);}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);ad();}});if(document.documentElement.doScroll&&!window.frameElement){(function(){if(M){return;}try{document.documentElement.doScroll("left");}catch(e){setTimeout(arguments.callee,0);return;}ad();})();}}}}function L(ai,al,aj){if(aj){for(var ak=0,ah=ai.length;ak<ah;ak++){if(al.call(ai[ak],ak)===false){break;}}}else{for(var ak=ai.length-1,e;ak>=0;ak--){if(al.call(ai[ak],ak)===false){break;}}}}function B(e,al){var ah=[];for(var ai=0,aj=e.length;ai<aj;ai++){var ak=al(e[ai],ai);if(ak!=null){ah[ah.length]=ak;}}return ah.concat.apply([],ah);}function Y(){return;}function N(ah){var e;function ai(ak){var al=parseInt(ak,10).toString(16);return(al.length==1)?al+al:al;}function aj(ak){return ai(Math.round(ak*2.55));}if(e=/rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/.exec(ah)){return"#"+ai(e[1])+ai(e[2])+ai(e[3]);}if(e=/rgb\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*\)/.exec(ah)){return"#"+aj(e[1])+aj(e[2])+aj(e[3]);}if(e=/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/i.exec(ah)){return"#"+e[1]+e[2]+e[3];}if(e=/#([a-f0-9])([a-f0-9])([a-f0-9])/i.exec(ah)){return"#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3];}ai=null;aj=null;return ah;}function I(e,ai){var ah=document.createElement(e);if(ai){ah.className=ai;}return ah;}function Q(ah,ai){var e=new RegExp("\\b"+ai+"\\b");return ah.nodeType==1&&e.test(ah.className||"");}function P(ak,ah){var aj,e={},ai=function(am,al){return al.toUpperCase();};L(ah instanceof Array?ah:[ah],function(){var am=this,al=am.replace(/\-(\w)/g,ai);if(ak.style[al]){e[al]=ak.style[al];}else{if(d.msie){e[al]=ak.currentStyle[al];}else{if(document.defaultView&&document.defaultView.getComputedStyle){if(!aj){aj=document.defaultView.getComputedStyle(ak,"");}e[al]=aj&&aj.getPropertyValue(am);}}}});return ah instanceof Array?e:e[ah.replace(/\-(\w)/g,ai)];}function j(ah){var e=(ah||"").split("_");switch(e.length){case 1:return[e[0],e[0],e[0],e[0]];case 2:return[e[0],e[1],e[0],e[1]];case 3:return[e[0],e[1],e[2],e[1]];case 4:return e;}return null;}var i=(function(){var ah=[],ai="#ffffff";function aj(ak){var al;do{if(ak.nodeType!=1){break;}if(ak.rocon_bg){return ak.rocon_bg;}else{ah.push(ak);al=P(ak,"background-color");if(al!="transparent"){return N(al);}}}while(ak=ak.parentNode);return ai;}function e(ak){var al;do{if(ak.nodeType!=1){break;}al=P(ak,"background-color");if(al!="transparent"){return N(al);}}while(ak=ak.parentNode);return ai;}return function(ap,ao){var al=ap.className,an=null;var ak=/\brcbg([a-f0-9_]+)\b/i.exec(al);if(ak){an=B(j(ak[1]),function(aq){return N("#"+aq);});return an;}var am=G(ap);if(am){return am.bg;}if(!ao){ap=ap.parentNode;}if(i.use_cache){ah=[];an=aj(ap);L(ah,function(){this.rocon_bg=an;i.processed_elems.push(this);});ah=null;}else{an=e(ap);}return j(an);};})();i.use_cache=true;i.processed_elems=[];function G(ai){var ah=ai.className,e=null;L(U,function(){if((typeof(this.rule)=="string"&&ah.indexOf(this.rule)!=-1)||ah.search(this.rule)!=-1){e=this;return false;}},true);return e;}function l(e,ah){w.insertRule(e+" {"+ah+"}",w.cssRules.length);}function D(ah){var e;L(document.styleSheets,function(){L(this.cssRules||this.rules,function(){if(e=p.exec(this.selectorText)){ah(this,parseInt(e[1],10));}});});}function E(ai,ah){var e=(ai.className||"").replace(new RegExp("\\s*"+h+"[-_].+?\\b","ig"),"");if(ah){e+=" "+ah;}ai.className=e;return ai;}function o(ah,e){H.push(ah.selectorText.substr(1));}function ag(){if(!w){if(document.createStyleSheet){w=document.createStyleSheet();}else{var e=I("style");e.rel="rocon";document.getElementsByTagName("head")[0].appendChild(e);L(document.styleSheets,function(){if(this.ownerNode.rel=="rocon"){w=this;return false;}});}}return w;}function c(ai){var ah=[],e;L((ai||document).getElementsByTagName("*"),function(){if(e=A.exec(this.className||"")){ah.push({node:this,radius:parseInt(e[1],10)});}});return ah;}function y(ah){var e=c(ah);
if(e.length){ag();L(e,function(){Y(this.node,this.radius);});}}function q(e){return f[e]?true:false;}function T(am,ah){var ai=am.className||"";ah=ah||parseInt(ai.match(A)[1],10);var ak=K.test(ai),al=G(am);var e="";var aj=al?al.border_width:(parseInt(P(am,"border-left-width"))||0);if(aj){e=N(P(am,"border-left-color")||"#000");}return{"radius":ah,"bg_color":i(am,ak),"border_width":(aj>ah)?ah:aj,"real_border_width":aj,"border_color":e,"use_shape":ak};}function af(e,ah){L(e,function(){L((this instanceof Array)?this:[this],ah);});}function m(ai){var e={};for(var ah in ai){if(ai.hasOwnProperty(ah)){e[ah]=ai[ah];}}return e;}function S(ah,ai,ap){var aj=P(ah,["padding-top","padding-bottom","margin-top","margin-bottom"]);function e(aq){return parseInt(aj[aq],10)||0;}var ak=Math.max(e("paddingTop")-ap.radius+ap.border_width,0),ao=Math.max(e("paddingBottom")-ap.radius+ap.border_width,0),al=e("marginTop")+ap.radius,an=e("marginBottom")+ap.radius,am=ap.real_border_width-ap.border_width;l("."+ai,"border-top-width:"+am+"px;"+"border-bottom-width:"+am+"px;"+"padding-top:"+ak+"px;"+"padding-bottom:"+ao+"px;"+"margin-top:"+al+"px;"+"margin-bottom:"+an+"px");}C(y);C(function(){L(i.processed_elems,function(){this.removeAttribute("rocon_bg");});i.use_cache=false;});O();if(d.safari){Y=function(ai,ah){var e=".rc"+ah;if(!q(e)){l(e,"-webkit-border-radius:"+ah+"px; -khtml-border-radius:"+ah);f[e]=true;}};u.update=function(){af(arguments,function(){var e=A.exec(this.className||"");if(e){Y(this,parseInt(e[1]));}});};}if(d.mozilla){Y=function(ai,ah){var e=".rc"+ah;if(!q(e)){l(e,"-moz-border-radius:"+ah+"px");f[e]=true;}};u.update=function(){af(arguments,function(){var e=A.exec(this.className||"");if(e){Y(this,parseInt(e[1]));}});};}if(d.opera){ag();l("."+h,"position:absolute;background-repeat:no-repeat;z-index:1;display:none");l("."+h+"-init","position:relative;");l("."+h+"-init>."+h,"display:inline-block;");l("."+h+"-tl","top:0;left:0;background-position:100% 100%;");l("."+h+"-tr","top:0;right:0;background-position:0 100%;");l("."+h+"-bl","bottom:0;left:0;background-position:100% 0;");l("."+h+"-br","bottom:0;right:0;");var x=I("canvas");function F(ai){ai.border_width=(ai.border_width>ai.radius)?ai.radius:ai.border_width;if(ai.border_width>1){ai.radius-=ai.border_width/2;}var aj=ai.radius*2+ai.border_width,e=aj;if(ai.use_shape){aj=2000;if(ai.border_width<ai.real_border_width){e+=(ai.real_border_width-ai.border_width)*2;}}if(ai.border_width==1){aj--;e--;}x.width=ai.width=aj;x.height=ai.height=e;var ah=x.getContext("2d");ah.strokeStyle=ai.border_color;ah.lineWidth=ai.border_width;ah.lineJoin="miter";ah.lineCap="square";ah.fillStyle=ai.bg_color[0];ah.clearRect(0,0,aj,e);return ah;}function W(e,ai){var aj=Math.PI/2,ah=(ai.border_width>1)?ai.border_width:0,ak=ai.radius*2+ah;e.beginPath();e.arc(0,0,ai.radius,aj,0,true);e.stroke();e.beginPath();e.arc(ak,0,ai.radius,aj*2,aj,true);e.stroke();e.beginPath();e.arc(ak,ak,ai.radius,-aj,aj*2,true);e.stroke();e.beginPath();e.arc(0,ak,ai.radius,0,-aj,true);e.stroke();}function k(ap){ap=m(ap);var ao=F(ap),ai=Math.PI/2,e=Math.PI*2,al=ap.border_width,am=(al>1)?al:0,aj=ap.radius*2+am,an=0,ah=(ap.border_width<ap.real_border_width);var ak=function(aq,ar){ao.beginPath();ao.arc(aq,ar,ap.radius,0,e,true);ao.closePath();ao.fill();};if(ah){an=ap.real_border_width-ap.border_width;ao.save();ao.translate(0,an);}ak(0,0);ak(aj,0);ak(aj,aj);ak(0,aj);ao.fillRect(aj,0,ap.width,ap.height);if(al){W(ao,ap);ao.fillStyle=ao.strokeStyle;ao.fillRect(aj,ap.radius-(al>1?al/2:al),ap.width,al*2);if(ah){ao.restore();ao.fillStyle=ap.border_color;ao.fillRect(0,0,ap.width,an);ao.fillRect(0,ap.height-an,ap.width,an);ao.fillStyle=ap.bg_color;}}return ao.canvas.toDataURL();}function t(aj){var an=aj;aj=m(aj);var ah=F(aj),e=aj.radius,ai=(aj.border_width>1)?aj.border_width:0,am=e*2+ai,al=an.radius,ak=Math.PI/2;ah.save();ah.beginPath();ah.arc(0,0,e,ak,0,true);ah.arc(am,0,e,ak*2,ak,true);ah.arc(am,am,e,-ak,ak*2,true);ah.arc(0,am,e,0,-ak,true);ah.closePath();ah.clip();ah.fillStyle=aj.bg_color[2];ah.fillRect(0,0,al,al);ah.fillStyle=aj.bg_color[3];ah.fillRect(al,0,al,al);ah.fillStyle=aj.bg_color[0];ah.fillRect(al,al,al,al);ah.fillStyle=aj.bg_color[1];ah.fillRect(0,al,al,al);ah.restore();if(aj.border_width){W(ah,aj);}return ah.canvas.toDataURL();}function b(e,ai){var ah=G(ai);return[e.radius,e.bg_color.join("-"),e.real_border_width,e.border_color,e.use_shape,ah?ah.id:0].join(":");}function R(e,aj){var al=b(e,aj),am=e.radius,an=e.real_border_width||0,ao=(e.use_shape)?an-e.border_width:0;if(!v[al]){var ai=ae+w.cssRules.length;v[al]=ai;l("."+ai+">."+h,'background-image: url("'+(e.use_shape?k(e):t(e))+'");'+"width: "+am+"px;"+"height: "+(am+ao)+"px;");var ak=-an,ah=-an;if(e.use_shape){ah=-am-ao;S(aj,ai,e);l("."+ai+">."+h+"-tl, ."+ai+">."+h+"-bl","width:auto;left:0;right:"+(am-an)+"px;background-position:-"+am+"px 100%;");l("."+ai+">."+h+"-bl","background-position:-"+am+"px 0;");}if(ak||ah){l("."+ai+">."+h+"-tl","top:"+ah+"px; left:"+ak+"px");l("."+ai+">."+h+"-tr","top:"+ah+"px; right:"+ak+"px");
l("."+ai+">."+h+"-bl","bottom:"+ah+"px; left:"+ak+"px");l("."+ai+">."+h+"-br","bottom:"+ah+"px; right:"+ak+"px");}}return v[al];}Y=function(aj,e){if(!aj.className){return;}var ah=false;L(aj.childNodes,function(){if(Q(this,h)){ah=true;return false;}});var ai=R(T(aj,e),aj);if(!ah){L(["tl","tr","bl","br"],function(){aj.appendChild(I("span",h+" "+h+"-"+this));});}E(aj,ai+" "+h+"-init");};C(function(){document.documentElement.style.outline="none";});u.update=function(){af(arguments,function(){Y(E(this));});};}if(d.msie){v.ix=0;v.created={};var ab="",n={tl:0,tr:1,br:2,bl:3};var s="vml-"+h;try{if(!document.namespaces["v"]){document.namespaces.add("v","urn:schemas-microsoft-com:vml");}}catch(aa){}ag();var Z="."+h;w.cssText="."+s+" {behavior:url(#default#VML);display:inline-block;position:absolute}"+Z+"-init {position:relative;zoom:1;}"+Z+" {position:absolute; display:inline-block; zoom: 1; overflow:hidden}"+Z+"-tl ."+s+"{flip: 'y'}"+Z+"-tr ."+s+"{rotation: 180;right:1px;}"+Z+"-br ."+s+"{flip: 'x'; right:1px;}";if(d.version<7){w.cssText+=Z+"-tr, "+Z+"-br {margin-left: 100%;}";}l=function(e,ah){ab+=e+"{"+ah+"}";};function X(au){var ak=au.radius,al=au.border_width,ah=ak+":"+al+":"+au.use_shape;if(!X._cache[ah]){var ap=10;var ai=I("v:shape");ai.className=s;ai.strokeweight=al+"px";ai.stroked=(al)?true:false;var aq=I("v:stroke");aq.className=s;aq.joinstyle="miter";ai.appendChild(aq);var an=ak,aj=an;ai.style.width=an+"px";ai.style.height=aj+"px";ak-=al/2;ak*=ap;var e=al/2*ap;var am=Math.round((ak+e)/an);var ao=ak+e;ai.coordorigin=Math.round(am/2)+" "+Math.round(am/2);ai.coordsize=ao+" "+ao;var at="";var ar=ao+am;if(au.use_shape){ar=2000*ap;at="m"+ar+",0 ns l"+e+",0  qy"+ao+","+ak+" l"+ar+","+ak+" e ";}else{at="m0,0 ns l"+e+",0  qy"+ao+","+ak+" l"+ao+","+ao+" l0,"+ao+" e ";}at+="m"+e+","+(-am)+" nf l"+e+",0 qy"+ao+","+ak+" l "+(ar)+","+ak+" e x";ai.path=at;X._cache[ah]=ai;}return X._cache[ah].cloneNode(true);}X._cache={};function z(ah,ai){var e=X(ah);e.fillcolor=ah.bg_color[n[ai]]||"#000";e.strokecolor=ah.border_color||"#000";var aj=I("span",h+" "+h+"-"+ai);aj.appendChild(e);return aj;}function V(e){L(e.childNodes,function(){if(Q(this,h)){e.removeChild(this);}});E(e);}function ac(e){var ah=e.radius+":"+(e.real_border_width||0)+":"+e.use_shape;if(!v[ah]){v[ah]=ae+v.ix++;}return v[ah];}function g(at,ah){var an=at.radius,ao=at.real_border_width||0,ap=(at.use_shape)?at.real_border_width-at.border_width:0;var aj=ac(at);if(!v.created[aj]){var al=(d.version<7)?"."+aj+" ."+h:"."+aj+">."+h;var ai=-ao,e=-1-ao;l(al,"width:"+(an+ao+1)+"px;height:"+(an+1)+"px");if(at.use_shape){e=-an-1-ap;var aq=an+at.border_width*2+ap;S(ah,aj,at);var am=Math.max(an-ao*2,0),ar=Math.min(an-ao*2,0)*-1;if(d.version<7){ar+=parseInt(P(ah,"padding-left")||0)+parseInt(P(ah,"padding-right")||0);}var ak="width:100%;clip:rect(auto auto auto "+am+"px);padding-right:"+ar+"px;left:"+(-ao-am)+"px;";l(al+"-tl",ak+"top:"+e+"px;");l(al+"-tl ."+s,"left:"+am+"px");l(al+"-bl",ak+"bottom:"+e+"px;");l(al+"-bl ."+s,"left:"+am+"px");}else{l(al+"-tl","left:"+ai+"px;top:"+e+"px;");l(al+"-bl","left:"+ai+"px;bottom:"+e+"px;");}if(d.version<7){ai=-an+(ao?an%2-ao%2:-an%2);l(al+"-tr","left:"+ai+"px;top:"+e+"px;");l(al+"-br","left:"+ai+"px;bottom:"+e+"px;");}else{l(al+"-tr","right:"+ai+"px;top:"+e+"px;");l(al+"-br","right:"+ai+"px;bottom:"+e+"px;");}v.created[aj]=true;}}Y=function(ai,e){var ah=T(ai,e);g(ah,ai);L(["tl","tr","bl","br"],function(){ai.appendChild(z(ah,this));});ai.className+=" "+ac(ah)+" "+h+"-init";};u.update=function(){af(arguments,function(){V(this);Y(this);});};C(function(){w.cssText+=ab;ab="";l=w.addRule;});}return u;})();

var footer_json = [];


footer_json.push({
	"id": 111886,

	"preview": "/img/banners/banner2_s.jpg",
	"image": "/img/banners/banner2.jpg",

	"link": "/news/feed/12"
})

footer_json.push({
	"id": 111886,

	"preview": "/img/banners/banner1_s.jpg",
	"image": "/img/banners/banner1.jpg",

	"link": "http://#"
})

footer_json.push({
	"id": 111886,

	"preview": "/img/banners/banner_306x102.jpg",
	"image": "/img/banners/banner_340x134.jpg",

	"link": "http://#"
})

