base = "http://flyingpenguinsmedia.com/";
lib = "adnet/";
file = "ad.php";
mExt = Math.floor(Math.random()*9871);
randExt = "?se="+mExt;

function requestCrossDomain( site, callback ) {
	if ( !site ){
		alert('No site was passed.');
		return false;
	}
	var yql = 'http://query.yahooapis.com/v1/public/yql?q=' + encodeURIComponent('select * from html where url="' + site + '"') + '&format=xml&callback=?';
	$.getJSON( yql, cbFunc );

	function cbFunc(data){
	if ( data.results[0] ) {
		data = data.results[0].replace(/<script[^>]*>[\s\S]*?<\/script>/gi, '');
		if ( typeof callback === 'function') {
			callback(data);
		}
	}
	else throw new Error('Nothing returned from getJSON.');
	}
}

baseurl = base+lib+file+randExt;

//Do load
$(document).ready(function(){
	$('#fpm').ready(function(){
	parentWidth = $('#fpm').parent('div').width();
	parentHeight = $('#fpm').parent('div').height();
	ext = "?w="+parentWidth+"&"+"h="+parentHeight;
		$('#fpm').ready(function(){
			requestCrossDomain(baseurl,function(results){ 
			$('#fpm').html(results);
				$('#slider a img').load(function(){
				imgWidth = $('#slider a img').width();
				imgHeight = $('#slider a img').height();
				if(imgWidth>parentWidth){
				tmpWidth = (parentWidth/imgWidth) * imgWidth;
				imgWidth = $('#slider a img').attr('width',tmpWidth);
				}
				
				})
			});
		});
	});
	
//long banner
	
//END
});
