var ie6=null;

$(document).ready(function() {

	((document.all)&&(navigator.appVersion.indexOf("MSIE 6.")!=-1)) ? (ie6=true) : (ie6=false);

	if($('.hp').is('body')){
		$.ajax({
		 type: "GET",
		 url: "/cachearticle"
  		});
	}

	if($('#date').is('div')){
		 var date = new Date();
		 var today= dateFormat(date, "fullDate");
		 $('#date').html(today);
	}
	if ($('#archivelist').is('ul')) {
		 var today = new Date();
		 var currentMonth = today.getMonth();
		 var maxMonth = today.getMonth();
		 var currentYear = today.getYear();
		 if($.browser.msie) {
			 var currentYear = today.getYear();
			 var maxYear = today.getYear();
		 } else {
		 	var currentYear = 1900 + today.getYear();
			 var maxYear = 1900 + today.getYear();
		 }
		 var minMonth = 7;
		 var minYear = 2008;

		 createListArchive (currentMonth, currentYear, minMonth, minYear);

		 if ((currentMonth == maxMonth) && (currentYear == maxYear)) {
		 	$('#pagFwd').hide();
		 }

		 $('#pagBack').click(function(e) {
		 	currentMonth = currentMonth - 4
		 	if (currentMonth<0) {
		 		currentYear = currentYear - 1;
		 		currentMonth = 12 + currentMonth;
		 	}
			createListArchive (currentMonth, currentYear, minMonth, minYear);
			$('#pagFwd').show();
			if (currentYear < 2008) {
				$('#pagBack').hide();
			}
		 });

		  $('#pagFwd').click(function(e) {
		 	currentMonth = currentMonth + 4
		 	if (currentMonth>11) {
		 		currentYear = currentYear + 1;
		 		currentMonth = currentMonth - 12;
		 	}
			createListArchive (currentMonth, currentYear, minMonth, minYear);
			$('#pagBack').show();
			if ((currentMonth == maxMonth) && (currentYear == maxYear)) {
			 	$('#pagFwd').hide();
			 }
		 });
		 //var sList = '';
		 //sList += '<li><a href="#">' + currentYear + ' | ' + getCalendarDateEn(currentLang, currentMonth) + '</a></li>'
	}

	//adattamento larghezza txtLayer
	if ($('.title').width() > $('#txtContainer').width()) {
		$('#txtContainer').width($('p.title').width() + 20);
		$('#txtLayer').width($('#txtContainer').outerWidth());
	}

	$('li#lang>a, #lang>ul').bind('mouseover', function() {
		$('#lang ul').show();
		});
	$('#lang ul').bind('mouseout', function() {
		$(this).hide();
		});

	$('ul.level1>li>a').hover(function() {
		$('#menu div').not($('#menu li.on div')).hide();
		$('ul.level1>li>a.active').removeClass('active');
		$(this).addClass('active').next().show();
		inMenu = true;
		}, function() {
		inMenu = false;
		window.setTimeout("closeMenu()",500);
		}
	);

	$('ul.level1 li>div').hover(function() {
		inMenu = true;
	}, function() {
		inMenu = false;
		window.setTimeout("closeMenu()",500);
	});

	$('#banners a img').css({opacity:0.6});

	$('#banners a').hover(function() {
		$(this).find('img').css({opacity:1});
		}, function() {
		$(this).find('img').css({opacity:0.6});
	});

	$('#search input').focus(function() {
		searchPage ();
		if($(this).val() == searchString) {
			$(this).val('');
			}
		});

	$('#search input').blur(function() {
		if($(this).val() == '') {
			$(this).val(searchString);
			}
		});

	if($('#imgGallery').is('div')) {
		gallery.init();
		}

	$('#refineSearch input').change(function() {
			searchPage (1);
		});

	$('#searchwords').keyup(function() {
		searchPage (2);
	});

	$('#searchword').keyup(function() {
		searchPage (1);
	});

	if ($('#refineSearch').is('div')) {
		searchPage (1);
	}

	// Media per tutti i video FLV
	if($('.flvvideo').is('div')){
		$('#videoContainer').find('.flvvideo').each(function(){
			var videoUrl = $(this).attr('url');
			var vw = $(this).attr('w');
			var vh = $(this).attr('h');
			$(this).media({
									width:     460,
									height:    370,
									autoplay:  true,
									params:    {bgcolor : '#000000',scale:'noscale', allowfullscreen:'true'},
									attrs:     {bgcolor : '#000000',scale:'noscale', allowfullscreen:'true'},
									src:       '/swf/video/player.swf',
									flashvars:  {file: videoUrl, image: flvstarterimage, height : 370, width :460,frontcolor :"ffffff",backcolor : "000000",lightcolor : "FFFFFF",overstretch : false,bufferlength : 5,usefullscreen : true},
									caption:   false
							});
			var $videoTitle = $('#videoTitle');
			var pdHor = parseInt($videoTitle.css('paddingLeft')) + parseInt($videoTitle.css('paddingRight'));
			var pdVer = parseInt($videoTitle.css('paddingTop')) + parseInt($videoTitle.css('paddingBottom'));
			$videoTitle.css({width:parseInt(710-vw-pdHor), height:parseInt(vh-pdVer)});
		});
	}
	if($('.ytbvideo').is('div')){
		$('#videoContainer').find('.ytbvideo').each(function(){
			var videoUrl = $(this).attr('url');
			var vw = $(this).attr('w');
			var vh = $(this).attr('h');
			$(this).media({
									width:     vw,
									height:    vh,
									autoplay:  true,
									params:    {bgcolor : '#000000',scale:'noscale', allowfullscreen:'true'},
									attrs:     {bgcolor : '#000000',scale:'noscale', allowfullscreen:'true'},
									src:       '/swf/video/player.swf',
									flashvars:  {file: videoUrl, image: flvstarterimage, height : 370, width :460,frontcolor :"ffffff",backcolor : "000000",lightcolor : "FFFFFF",overstretch : false,bufferlength : 5,usefullscreen : true},
									caption:   false
							});
			var $videoTitle = $('#videoTitle');
			var pdHor = parseInt($videoTitle.css('paddingLeft')) + parseInt($videoTitle.css('paddingRight'));
			var pdVer = parseInt($videoTitle.css('paddingTop')) + parseInt($videoTitle.css('paddingBottom'));
			$videoTitle.css({width:parseInt(710-vw-pdHor), height:parseInt(vh-pdVer)});
		});
	}
	if($('.strvideo').is('div')){
		$('#videoContainer').find('.strvideo').each(function(){
			var videoUrl = $(this).attr('url');
			var width = $(this).attr('w');
			var height = $(this).attr('h');
			var vw = $(this).attr('w');
			var vh = $(this).attr('h');

			var sFile = videoUrl.split("$")[0];
			var sStreamer = videoUrl.split("$")[1];
			$(this).media({
									width:     vw,
									height:    vh,
									autoplay:  true,
									params:    {bgcolor : '#000000',scale:'noscale', allowfullscreen:'true'},
									attrs:     {bgcolor : '#000000',scale:'noscale', allowfullscreen:'true'},
									src:       '/swf/video/player.swf',
									flashvars:  {file: sFile, streamer: sStreamer, image: flvstarterimage, height : 370, width :460,frontcolor :"ffffff",backcolor : "000000",lightcolor : "FFFFFF",overstretch : false,bufferlength : 5,usefullscreen : true},
									caption:   false
							});

			var $videoTitle = $('#videoTitle');
			var pdHor = parseInt($videoTitle.css('paddingLeft')) + parseInt($videoTitle.css('paddingRight'));
			var pdVer = parseInt($videoTitle.css('paddingTop')) + parseInt($videoTitle.css('paddingBottom'));
			$videoTitle.css({width:parseInt(710-vw-pdHor), height:parseInt(vh-pdVer)});
		});
	}

});

function closeMenu() {
	if(inMenu == false) {
		$('ul.level1 li>a.active').not($('li.on>a')).removeClass('active').next().hide();
		}
	}

var gallery = {
	currItem : 0,
	init: function() {
		images = $('#imgCounter ul a');
		caption = $('#txtContainer .title').text();
		$('#startSS').click(function(e) {
		e.preventDefault();
		gallery.open();
		});
	},
	open: function() {
		cw_h = $('#contentWrapper').height();
		backgroundDiv = '<div class="layerOverlay"></div>';
		if ((images.length)>1) {
			galleryHolder = '<div class="galleryHolder"><div class="top"><h1></h1><a href="#" class="close">Close</a></div><div class="imgHolder"></div><div class="bottom"><p class="nav"><a class="prev" href="#">Prev</a> | <a class="next" href="#">Next</a></p><p class="desc">&nbsp;</p></div></div>';
		} else {
			galleryHolder = '<div class="galleryHolder"><div class="top"><h1></h1><a href="#" class="close">Close</a></div><div class="imgHolder"></div><div class="bottom"><p class="desc">&nbsp;</p></div></div>';
		}
		$('#contentWrapper').append(backgroundDiv);
		$('#contentWrapper').append(galleryHolder);
		$('.galleryHolder .top h1').text(caption);
		$('#imgCounter ul').clone().insertBefore('.bottom a.prev');
		$('.galleryHolder').css({opacity:0})
		$('.layerOverlay').css({opacity:0}).fadeTo('fast',0.7, function() {
			$('.galleryHolder').fadeTo('fast',1);
		});
		gallery.browse();
		gallery.openImg(0);
	},
	openImg : function(n) {
		gallery.currItem = (n<0) ? (images.length-1) : (n == images.length) ? 0 : n;
		$('.galleryHolder .bottom ul a').removeClass('active');
		var pic = new Image();
		picSrc = images.eq(gallery.currItem).attr('href');
		$(pic).load(function(){
			$('.imgHolder')
				.find('img')
				.remove()
				.end()
				.append((pic));
			$('.galleryHolder .bottom p.desc').text(images.eq(gallery.currItem).attr('title'));
			$('.galleryHolder .bottom ul a').eq(gallery.currItem).addClass('active');
			if(cw_h < $('.galleryHolder').height()) {
				$('#contentWrapper').height($('.galleryHolder').height());
				}
			else {
				$('#contentWrapper').height(cw_h);
				}
			});

		$(pic).attr({src:picSrc});
		},
	browse : function() {
		$('.bottom a.prev').
			bind('click', function(e) {
				e.preventDefault();
				gallery.openImg(gallery.currItem - 1);
			});

		$('.bottom a.next').
			bind('click', function(e) {
				e.preventDefault();
				gallery.openImg(gallery.currItem + 1);
			});
		$('.top a.close').
			bind('click', function(e) {
				e.preventDefault();
				gallery.close();
				});
		$('.bottom ul a').
			bind('click', function(e) {
				e.preventDefault();
				gallery.openImg(parseInt($(this).text() -1));
			});
		},
	close : function() {
		$('div.galleryHolder').fadeTo('fast',0, function(){
			$('div.layerOverlay').fadeTo('fast',0, function(){
				$('div.galleryHolder').remove();
				$('div.layerOverlay').remove();
			});
		});
	}
}


function searchPage (mode) {

	var sSearch = "/luxury-magazine/search/" + currentLang + "/1/";
	var sCategory = "";
	var sType = "";

	$('#refineSearch').find("input").each(function(){


		 	   		if ($(this).attr("checked")==true) {
		 	   			if ($(this).attr('id') == 'style') {
		 	   				sCategory = sCategory + 'Style-';
		 	   			}
		 	   			if ($(this).attr('id') == 'faces') {
		 	   				sCategory = sCategory + 'Faces-';
		 	   			}
		 	   			if ($(this).attr('id') == 'life') {
		 	   				sCategory = sCategory + 'Life-';
		 	   			}
		 	   			if ($(this).attr('id') == 'fun') {
		 	   				sCategory = sCategory + 'Fun-';
		 	   			}
		 	   			if ($(this).attr('id') == 'history') {
		 	   				sCategory = sCategory + 'History-';
		 	   			}

		 	   			// Type
		 	   			if ($(this).attr('id') == 'articles') {
		 	   				sType = sType + '1-';
		 	   			}
		 	   			if ($(this).attr('id') == 'videos') {
		 	   				sType = sType + '3-';
		 	   			}
		 	   			if ($(this).attr('id') == 'images') {
		 	   				sType = sType + '2-';
		 	   			}
		 	   		}
		 	   });

	if (sCategory.length==0) {
		sCategory = 'NONE';
	} else {
		sCategory = sCategory;
	}

	if (sType.length==0) {
		sType = 'NONE';
	} else {
		sType = sType;
	}

	if (mode == 1) {
		if ($('#searchwords').val().length>0) {
			sSearch = sSearch + sCategory + '/' + sType + '/' + $('#searchwords').val() + '/';
		} else {
			sSearch = sSearch + sCategory + '/' + sType + '/'
		}

		$('#new').attr({href:sSearch});
		$('#old').attr({href:sSearch});
	} else {
		if ($('#searchwords').val().length>0) {
			sSearch = sSearch + sCategory + '/' + sType + '/' + $('#searchwords').val() + '/';
		} else {
			sSearch = sSearch + sCategory + '/' + sType + '/'
		}

		$('#search').attr({action:sSearch});
	}
}

$(window).load(function() {
	//hack per ie6 - corregge l'altezza del blocco bianco negli elementi selezionati
	if(ie6) {
		$('.hpHeadCnt, .txtRght .txtWrapper, #imgGallery #txtLayer').setHeight();
		}
	});

$.fn.setHeight = function() {
	return this.each(function() {
		var parentH = $(this).parent().find('img').height();
		$(this).height(parentH).parent().find('#imgCounter').css({top: (parentH - 35)+'px'});
	});
}

var inMenu = false;
var searchString = "Swide Search";

function createListArchive (currentMonth, currentYear, minMonth, minYear) {

	var path = $('#archivelist').attr('class');

	$('#archivelist').find('a').each(function(){
		//alert(currentYear + '-' + minYear);
		//alert(currentMonth + '-' + minMonth);
		if ((currentYear>minYear) || ((currentYear==minYear) && (currentMonth>=minMonth))) {

		 	if (currentMonth<0) {
		 		currentYear = currentYear - 1;
		 		currentMonth = 12 + currentMonth;
		 	}
		 	var href = path + getCalendarDateEn(currentLang, currentMonth) + '/' + currentYear + '/';
		 	var label = currentYear + ' | ' + getCalendarDateEn(currentLang, currentMonth);
		 	currentMonth = currentMonth - 1;
		 	$(this).attr({'href':href});
		 	$(this).html(label);
			$(this).show();
	 	} else {
	 		$(this).hide();
	 		$('#pagBack').hide();
	 	}
	 });

}

function getCalendarDateEn(idlang, idMonth)
{
   var months = new Array(13);

   months[0]  = "January";
   months[1]  = "February";
   months[2]  = "March";
   months[3]  = "April";
   months[4]  = "May";
   months[5]  = "June";
   months[6]  = "July";
   months[7]  = "August";
   months[8]  = "September";
   months[9]  = "October";
   months[10] = "November";
   months[11] = "December";

   if (idlang == 'it') {
	   months[0]  = "Gennaio";
	   months[1]  = "Febbraio";
	   months[2]  = "Marzo";
	   months[3]  = "Aprile";
	   months[4]  = "Maggio";
	   months[5]  = "Giugno";
	   months[6]  = "Luglio";
	   months[7]  = "Agosto";
	   months[8]  = "Settembre";
	   months[9]  = "Ottobre";
	   months[10] = "Novembre";
	   months[11] = "Dicembre";
   }

   return months[idMonth];
} // function getCalendarDate()

/*
 * Date Format 1.2.2
 * (c) 2007-2008 Steven Levithan <stevenlevithan.com>
 * MIT license
 * Includes enhancements by Scott Trenda <scott.trenda.net> and Kris Kowal <cixar.com/~kris.kowal/>
 *
 * Accepts a date, a mask, or a date and a mask.
 * Returns a formatted version of the given date.
 * The date defaults to the current date/time.
 * The mask defaults to dateFormat.masks.default.
 */
var dateFormat = function () {
	var	token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,
		timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
		timezoneClip = /[^-+\dA-Z]/g,
		pad = function (val, len) {
			val = String(val);
			len = len || 2;
			while (val.length < len) val = "0" + val;
			return val;
		};

	// Regexes and supporting functions are cached through closure
	return function (date, mask, utc) {
		var dF = dateFormat;

		// You can't provide utc if you skip other args (use the "UTC:" mask prefix)
		if (arguments.length == 1 && (typeof date == "string" || date instanceof String) && !/\d/.test(date)) {
			mask = date;
			date = undefined;
		}

		// Passing date through Date applies Date.parse, if necessary
		date = date ? new Date(date) : new Date();
		if (isNaN(date)) throw new SyntaxError("invalid date");

		mask = String(dF.masks[mask] || mask || dF.masks["default"]);

		// Allow setting the utc argument via the mask
		if (mask.slice(0, 4) == "UTC:") {
			mask = mask.slice(4);
			utc = true;
		}

		var	_ = utc ? "getUTC" : "get",
			d = date[_ + "Date"](),
			D = date[_ + "Day"](),
			m = date[_ + "Month"](),
			y = date[_ + "FullYear"](),
			H = date[_ + "Hours"](),
			M = date[_ + "Minutes"](),
			s = date[_ + "Seconds"](),
			L = date[_ + "Milliseconds"](),
			o = utc ? 0 : date.getTimezoneOffset(),
			flags = {
				d:    d,
				dd:   pad(d),
				ddd:  dF.i18n.dayNames[D],
				dddd: dF.i18n.dayNames[D + 7],
				m:    m + 1,
				mm:   pad(m + 1),
				mmm:  dF.i18n.monthNames[m],
				mmmm: dF.i18n.monthNames[m + 12],
				yy:   String(y).slice(2),
				yyyy: y,
				h:    H % 12 || 12,
				hh:   pad(H % 12 || 12),
				H:    H,
				HH:   pad(H),
				M:    M,
				MM:   pad(M),
				s:    s,
				ss:   pad(s),
				l:    pad(L, 3),
				L:    pad(L > 99 ? Math.round(L / 10) : L),
				t:    H < 12 ? "a"  : "p",
				tt:   H < 12 ? "am" : "pm",
				T:    H < 12 ? "A"  : "P",
				TT:   H < 12 ? "AM" : "PM",
				Z:    utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""),
				o:    (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),
				S:    ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10]
			};

		return mask.replace(token, function ($0) {
			return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1);
		});
	};
}();

// Some common format strings
dateFormat.masks = {
	"default":      "ddd mmm dd yyyy HH:MM:ss",
	shortDate:      "m/d/yy",
	mediumDate:     "mmm d, yyyy",
	longDate:       "mmmm d, yyyy",
	fullDate:       "dddd, mmmm d, yyyy",
	shortTime:      "h:MM TT",
	mediumTime:     "h:MM:ss TT",
	longTime:       "h:MM:ss TT Z",
	isoDate:        "yyyy-mm-dd",
	isoTime:        "HH:MM:ss",
	isoDateTime:    "yyyy-mm-dd'T'HH:MM:ss",
	isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"
};

// Internationalization strings
dateFormat.i18n = {
	dayNames: [
		"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat",
		"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
	],
	monthNames: [
		"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
		"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
	]
};

// For convenience...
Date.prototype.format = function (mask, utc) {
	return dateFormat(this, mask, utc);
};

//media
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}(';(6($){$.3.4=6(d,e,f){s S.1p(6(){5(15 d==\'6\'){f=e;e=d;d={}}2 o=1E(S,d);5(15 e==\'6\')e(S,o);2 r=22();2 m=r.3D(o.8)||[\'\'];o.K?m[0]=o.K:m.37();y(2 i=0;i<m.14;i++){3=m[i].2c();5(1b(3[0]))3=\'3\'+3;5(!$.3.4[3])2v;2 a=$.3.4[3+\'1z\'];5(!o.t)o.t={};5(a){2 b=a.1f==\'1y\';o.t[a.1f||\'11\']=b?(o.11?1:0):o.11?1c:1X}2 c=$.3.4[3](S,o);c.1U(\'1S\',o.F).u(o.u);5(15 f==\'6\')f(S,c[0],o,a.G);36}})};$.3.4.2Z=6(a,b){5(!a||!b||!$.3.4.v.H[b])s;a=a.2c();5(1b(a[0]))a=\'3\'+a;$.3.4[a]=$.3.4[b];$.3.4[a+\'1z\']=$.3.4.v.H[b]};$.3.4.v={u:1K,A:1K,11:0,F:\'#2L\',t:{2I:\'2G\'},M:{},C:{},1d:\'7\',12:10,21:\'23.U\',2a:\'23.U\',B:{1B:\'1c\',1A:\'1c\',1C:\'24\',1e:\'0.9\',1u:10,1t:10,1r:10,1q:10}};$.3.4.v.H={T:{G:\'T\',I:\'1Y,1h,U\',Q:{1a:\'18:3o-3l-1R-3h-3f\',K:\'Y/x-1P\',1O:\'R://33.2Y.P/2W/1M/2U/T/2S.1V#1e=\'+$.3.4.v.1d},O:{K:\'Y/x-1M-T\',17:\'R://W.2K.P/2J/2H\'}},1l:{G:\'1l\',I:\'2F,2D,2C,2A,2z,2y,2x,2w,2u,2t,2s,2q,2p,2n,2m,2k,2j,2g,2f,2d,4o,4l,4g,4d\',Q:{1a:\'18:4b-4a-48-46-45\',1O:\'R://W.28.P/3U/3T.1V\'},O:{17:\'R://W.28.P/1l/3S/\'}},3R:{G:\'20\',I:\'3N,3M,3L,3J,3I,3H,3G\',1f:\'1y\',Q:{1a:\'18:3F-3E-1R-3C-3B\'},O:{K:\'3A/x-3z-3x-3w\',17:\'R://W.20.P/3u/\'}},1G:{G:\'1G\',I:\'3t,3s,3r,3q\',1f:\'1y\',1T:\'3p\',Q:{1a:\'18:3n-3m-3k-3j-3i\',K:\'Y/x-1P\'},O:{K:$.1n.3g&&1Q()?\'Y/x-3e-3d\':\'Y/x-3c\',17:\'R://W.3b.P/3a/39/\'}},X:{G:\'X\',I:\'V,38\'},B:{G:\'B\',I:\'16\'}};6 1Q(){2 a=35.34;y(i=0;i<a.14;i++){2 b=a[i];5(b[\'31\']==\'30-2X.32\')s 1c}s 1X}2 l=1;y(2 n D $.3.4.v.H){2 q=$.3.4.v.H[n].I;$.1p(q.2V(\',\'),6(i,o){5(1b(o[0]))o=\'3\'+o;$.3.4[o]=$.3.4[n]=1N(n);$.3.4[o+\'1z\']=$.3.4.v.H[n]})};6 22(){2 a=\'\';y(2 b D $.3.4.v.H){5(a.14)a+=\',\';a+=$.3.4.v.H[b].I};s 1L 2T(\'\\\\.(\'+a.2R(/,/g,\'|\')+\')\\\\b\')};6 1N(c){s 6(a,b){s 1m(a,b,c)}};6 1b(c){s\'2Q\'.2P(c)>-1};6 1E(d,e){e=e||{};2 f=$(d);2 g=d.2O||\'\';2 j=$.1J?f.1J():$.2N?f.2M():{};j=j||{};2 w=j.u||1I(((g.1H(/w:(\\d+)/)||[])[1]||0));2 h=j.A||1I(((g.1H(/h:(\\d+)/)||[])[1]||0));5(w)j.u=w;5(h)j.A=h;5(g)j.L=g;2 a=$.3.4.v;2 b=e;2 c=j;2 p={t:{F:e.F||$.3.4.v.F}};2 k=$.1o({},a,b,c);$.1p([\'M\',\'t\',\'C\',\'B\'],6(i,o){k[o]=$.1o({},p[o]||{},a[o]||{},b[o]||{},c[o]||{})});5(15 k.J==\'2E\')k.J=f.3v();k.8=k.8||f.1w(\'2B\')||f.1w(\'8\')||\'3y\';s k};$.3.4.U=6(b,c){5(!Z.1W&&!Z.1k){5(c.C){2 a=[];y(2 f D c.C)a.E(f+\'=\'+c.C[f]);5(!c.t)c.t={};c.t.C=a.1j(\'&\')}s 1m(b,c,\'T\')}2 d=b.z?(\' z="\'+b.z+\'"\'):\'\';2 e=c.L?(\' 1i="\'+c.L+\'"\'):\'\';2 g=$(\'<N\'+d+e+\'>\');5(Z.1k){$(b).19(g).13(g);5(!b.z)b.z=\'1Z\'+l++;1k.3K(c.8,b.z,c.u,c.A,c.1d,c.12,c.C,c.t,c.M)}1s{$(b).19(g).1v();2 h=1L 1W(c.8,\'1Z\'+l++,c.u,c.A,c.1d,c.F);5(c.12)h.2r(c.12);y(2 p D c.t)5(p!=\'F\')h.3O(p,c.t[p]);y(2 f D c.C)h.3P(f,c.C[f]);h.3Q(g[0])}5(c.J)$(\'<N>\').13(g).V(c.J);s g};$.3.4.1Y=$.3.4.1h=6(a,b){2 c=b.8;2 d=/\\.1h\\b/i.2o(c)?$.3.4.v.2a:$.3.4.v.21;b.8=d;b.8=b.8+\'?1F=\'+c;b.C=$.1o({},{1F:c},b.C);s $.3.4.U(a,b)};$.3.4.16=6(a,b){5(!Z.1x||!Z.1x.1g){5($.3.4.16.1D)s;$.3.4.16.1D=1;2l(\'3V 3W 2i 2h 1g.3Z 40.\');s}2 c={u:b.u,A:b.A,2e:b.F,1B:b.B.1B,1A:b.B.1A,1C:b.B.1C,1e:b.B.1e};2 d={1u:b.B.1u,1t:b.B.1t};2 e=a.z?(\' z="\'+a.z+\'"\'):\'\';2 f=b.z||\'42\'+l++;2 g=b.L?(\' 1i="\'+b.L+\'"\'):\'\';2 h=$(\'<N\'+e+g+\'>\');$(a).19(h).1v();1x.1g.43({44:b.8,1r:b.B.1r,1q:b.B.1q,z:f,4n:h[0],4m:c,4h:d});5(b.J)$(\'<N>\').13(h).V(b.J);s h};6 1m(b,c,d){2 e=$(b);2 o=$.3.4.v.H[d];5(d==\'X\'){2 o=$(\'<X\'+\' u="\'+c.u+\'" A="\'+c.A+\'" >\');o.1w(\'8\',c.8);o.1U(\'1S\',o.F)}1s 5($.1n.29){2 a=[\'<4f u="\'+c.u+\'" A="\'+c.A+\'" \'];y(2 f D c.M)a.E(f+\'="\'+c.M[f]+\'" \');y(2 f D o.Q||{})a.E(f+\'="\'+o.Q[f]+\'" \');a.E(\'></4e\'+\'4c\'+\'>\');2 p=[\'<27 G="\'+(o.1T||\'8\')+\'" 26="\'+c.8+\'">\'];y(2 f D c.t)p.E(\'<27 G="\'+f+\'" 26="\'+c.t[f]+\'">\');2 o=25.2b(a.1j(\'\'));y(2 i=0;i<p.14;i++)o.49(25.2b(p[i]))}1s{2 a=[\'<47 u="\'+c.u+\'" A="\'+c.A+\'" 4i="4j:4k"\'];5(c.8)a.E(\' 8="\'+c.8+\'" \');y(2 f D c.M)a.E(f+\'="\'+c.M[f]+\'" \');y(2 f D o.O||{})a.E(f+\'="\'+o.O[f]+\'" \');y(2 f D c.t)a.E(f+\'="\'+c.t[f]+\'" \');a.E(\'></41\'+\'3Y\'+\'>\')}2 g=b.z?(\' z="\'+b.z+\'"\'):\'\';2 h=c.L?(\' 1i="\'+c.L+\'"\'):\'\';2 j=$(\'<N\'+g+h+\'>\');e.19(j).1v();($.1n.29||d==\'X\')?j.3X(o):j.V(a.1j(\'\'));5(c.J)$(\'<N>\').13(j).V(c.J);s j}})(4p);',62,274,'||var|fn|media|if|function||src||||||||||||||||||||return|params|width|defaults|||for|id|height|silverlight|flashvars|in|push|bgColor|name|players|types|caption|type|cls|attrs|div|eAttrs|com|oAttrs|http|this|flash|swf|html|www|iframe|application|window|null|autoplay|expressInstaller|appendTo|length|typeof|xaml|pluginspage|clsid|after|classid|isDigit|true|flashVersion|version|autoplayAttr|Silverlight|mp3|class|join|swfobject|quicktime|generate|browser|extend|each|userContext|initParams|else|onLoad|onError|remove|attr|Sys|autostart|_player|isWindowless|inplaceInstallPrompt|framerate|warning|getSettings|file|winmedia|match|parseInt|metadata|400|new|shockwave|getGenerator|codebase|oleobject|isFirefoxWMPPluginInstalled|11cf|backgroundColor|oUrl|css|cab|SWFObject|false|flv|movie_player_|real|flvPlayer|getTypesRegExp|mediaplayer||document|value|param|apple|msie|mp3Player|createElement|toLowerCase|tif|background|snd|qti|the|include|qif|qtif|alert|qt|psd|test|m4a|mp4|useExpressInstall|mpeg|mpg|midi|continue|mid|mov|gsm|bmp|au|href|aac|aiff|undefined|aif|transparent|getflashplayer|wmode|go|adobe|ffffff|data|meta|className|indexOf|0123456789|replace|swflash|RegExp|cabs|split|pub|mswmp|macromedia|mapFormat|np|filename|dll|fpdownload|plugins|navigator|break|shift|pdf|MediaPlayer|Windows|microsoft|mplayer2|wmp|ms|444553540000|mozilla|96b8|00C04F79FAA6|B153|11d3|ae6d|394A|6BF52A52|d27cdb6e|url|wmv|wma|avi|asf|player|text|plugin|realaudio|unknown|pn|audio|0020AFBBCCFA|B84B|exec|8BE4|CFCDAA03|smil|smi|rv|rpm|embedSWF|rm|ram|ra|addParam|addVariable|write|realplayer|download|qtplugin|qtactivex|You|must|append|bed|js|script|em|AG|createObjectEx|source|D3488ABDDC6B|BC80|embed|4B23|appendChild|8C17|02BF25D5|ject|3gp|ob|object|3g2|events|style|display|block|wav|properties|parentElement|tiff|jQuery'.split('|'),0,{}))
