
new function($){
	var WorldService={
		o:{author:'BBC World Service',version:'0.0.1'},
		wsCorners:function(){return Add.corners();},
		wsQuotes:function(){return Add.quotes();}
	}
	Add={
			quotes:function(){
				$('<span class="open-quote"><span>&#8220;</span></span>').prependTo('blockquote > .body');
				$('<span class="close-quote"><span>&#8221;</span></span>').appendTo('blockquote > .body');
			},
			corners:function(){
				$('#content > .g-block').children().wrap('<div class="jq-c-wrap"><div class="jq-c-content"></div></div>');
				$('#content > .g-block').addClass("jq-c");
			}
	};
	$.ws=WorldService;
}(jQuery);

$(function(){

	$.ws.wsCorners();
	$.ws.wsQuotes();
	$('.li-promo','.g-block').parents('.g-block').addClass('jq-promo');
	
	var nw= new Object();
	nw.closed =  true;
	nw.location=null;
	
	function wsPopup(url,o){
		var p=['aod','420','220'];
		if(typeof(o)=="object")$.each(o,function(i,v){if(i);p[i]=v;}); // array
		if (!nw.closed&&nw.location){
			nw.location.href = url;
		}else{
			nw=window.open(url,"contactus"+parseInt(p[1]),'width='+parseInt(p[1])+',height='+parseInt(p[2])+',toolbar=no,personalbar=no,location=no,statusbar=no,menubar=no,resizable=yes,status=no,left=20,screenX=20,top=20,screenY=20');
			if(!nw.opener)nw.opener=self;
		}
		if(window.focus){nw.focus();}
		return false;
	}

	$('a[@class*=popup]').filter(function(e){
		var o=this.className.match(/^(\D+)(\d+)x(\d+)$/i).splice(1,3);
		$(this).click(function(){
			return wsPopup(this.href,o);
		}).error(function(){return true;});
	});

	$('a[@class*=ms-]').filter(function(e){
		$(this).click(function(){
			return wsPopup(this.href);
		}).error(function(){return true;});
	});

	function wsClosePopup() {
		window.close();
		return false;
	}

});

