// Detect user agent
var user_agent = navigator.userAgent;

// MSIE 6 Rollover caching bug
//if ( user_agent.search(/msie 6/i) != -1 && user_agent.search(/msie 7/i) == -1 ) 
//  {
//    try {document.execCommand("BackgroundImageCache", false, true);} 
//    catch(err) {}
//  }
//
// Image preloads
Image1= new Image(325,90);
Image1.src = "http://www.socialscene.net.au:80/footads/templates/Wait!/yellow-orange/left.gif";

Image2= new Image(1,90);
Image2.src = "http://www.socialscene.net.au:80/footads/templates/Wait!/yellow-orange/bg.gif";

var script_path = 'http://www.socialscene.net.au:80/footads/';

// Seperation may make it easier for MSIE 7 to recognize it has loaded document.getElementById('catfish') when it is called afterwards?
document.write("<div id='catfish' style='color: #fad169; font-size: 12px; '>");

document.write("<div style=\"position: relative;  z-index: 100;\"><div id='div_left_gif' style=\"position: absolute; top: 0px;  left: 0px; width: 325px; height: 90px; z-index: 101; border: 0px solid red; \"><img id=\"left_gif\" src=\"http://www.socialscene.net.au:80/footads/templates/Wait!/yellow-orange/left.gif\" alt=\"\" border=\"0\" onclick=\"\" style=\"position: relative; z-index: 101;\" /></div><table id='f_ad_gen_render' width=\"100%\" height=\"90\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"position: relative; border: 0px solid blue; z-index: 100;\"><tr>	<td colspan=\"20\" style=\"position: relative; width: 330px; height: 22px; border: 0px solid red; \">&nbsp;</td></tr><tr>	<td rowspan=\"5\" style=\"position: relative; width: 330px; \">&nbsp;</td></tr><tr>	<td valign='top' style=' background: url(http://www.socialscene.net.au:80/footads/templates/Wait!/yellow-orange/bg.gif); background-repeat: repeat-x; background-position: 0px -22px;   width: 100%; height: 68px; border: 0px solid green;'><a href=\"#\" id=\"catfish_close\" style=\"position: absolute; top: 34px; right: 3px; color: #808080; font-size: 14px; font-family: Arial, Symbol, Serif;  z-index: 100; text-decoration: none; border: 1px solid #808080; background: #e3d7d7; padding-left: 1px; padding-right: 1px;\" title='Close This Ad'><b>X</b></a></td></tr></table></div>");

// Seperation may make it easier for MSIE 7 to recognize it has loaded document.getElementById('catfish') when it is called afterwards?
document.write("</div>");

load_image1();

function load_image1() {
Image1.onLoad = load_image2();
}

function load_image2() {
Image2.onLoad = load_iframe();
}

function load_iframe() {
  document.getElementById('f_ad_gen_render').onLoad = setTimeout("allow_ad()", 1000);
}

function allow_ad() {
  jQuery(document.getElementById('catfish')).catfish({animation: 'slide',closeLink: '#catfish_close', height: 90});
}