var now = new Date();
var jvSeed = Math.random() * now.valueOf() * 100000;
jvSeed = jvSeed.toString().substr(0, 15);
var jvPURL = '';
var defaultPath = '';
var BottomInclude = '';
var strInterstitial = '';

function GetAd(TheTile, ThePosition, ThePath, TheKeyword, TheSiteUrl, TheInterstitial, TheWidth, TheHeight) {
    if (ThePath == '') {
        ThePath = defaultPath;
    }
    ThePath = TheSiteUrl + ThePath;
    
    // This will hard code the embedded ad position (position = 'box') to width=300 and height=250.
    // This was requested by John Jenks on 3/27/2007, and should apply across the entire network.
    // The change was made by JGC on 3/30/2007.
    if (ThePosition == 'box') {
        TheWidth = '300';
        TheHeight = '250';
    }
    
    if((TheWidth=='null' && TheHeight=='null')||(TheWidth=='' && TheHeight=='')){
        document.write('<SCR'+'IPT type="text/javascript" language="JavaScript1.1" SRC="http://ad.doubleclick.net/adj/'+ThePath+';abr=!webtv;kw='+TheKeyword+';pos='+ThePosition+TheInterstitial+';'+TheTile+'='+(ThePosition-(-1))+';ord='+jvSeed+'?"></SCR'+'IPT>');
        if ((!document.images && navigator.userAgent.indexOf('Mozilla/2.') >= 0)  || navigator.userAgent.indexOf("WebTV")>= 0) {
            document.write('<A HREF="http://ad.doubleclick.net/jump/'+ThePath+';kw='+TheKeyword+';pos='+ThePosition+';'+TheTile+'='+(ThePosition-(-1))+';ord='+jvSeed+'?">');
            document.write('<IMG SRC="http://ad.doubleclick.net/ad/'+ThePath+';kw='+TheKeyword+';pos='+ThePosition+';'+TheTile+'='+(ThePosition-(-1))+';ord='+jvSeed+'?" border="0"></A>');
        }
     }else{
        document.write('<SCR'+'IPT type="text/javascript" language="JavaScript1.1" SRC="http://ad.doubleclick.net/adj/'+ThePath+';abr=!webtv;kw='+TheKeyword+';pos='+ThePosition+TheInterstitial+';sz='+TheWidth+'x'+TheHeight+';'+TheTile+'='+(ThePosition-(-1))+';ord='+jvSeed+'?"></SCR'+'IPT>');
            if ((!document.images && navigator.userAgent.indexOf('Mozilla/2.') >= 0)  || navigator.userAgent.indexOf("WebTV")>= 0) {
            document.write('<A HREF="http://ad.doubleclick.net/jump/'+ThePath+';kw='+TheKeyword+';pos='+ThePosition+';sz='+TheWidth+'x'+TheHeight +';'+TheTile+'='+(ThePosition-(-1))+';ord='+jvSeed+'?">');
            document.write('<IMG SRC="http://ad.doubleclick.net/ad/'+ThePath+';kw='+TheKeyword+';pos='+ThePosition+';sz='+TheWidth+'x'+TheHeight +';'+TheTile+'='+(ThePosition-(-1))+';ord='+jvSeed+'?" border="0"></A>');
        }
    }
}

function GetYahooAd(pub_id, site_name, ad_size_list, ad_delivery_mode, pub_content_cat_id_list, cstm_content_cat_list, content_type_list, site_section_name_list, reporting_tag_list){
    //Static variables
    var container_type="js";
    var request_type="ac";
    var ad_format_list=["Standard Graphical","Rich Media"];
    var clk_dest="_blank";
    var ad_output_encoding="utf-8";
    var max_count="3";
    var ad_content_lang="en-US";
    var disable_content_send="0";
                
	yld_mgr = {};	
	yld_mgr.pub_id=pub_id;
	yld_mgr.site_name=site_name;	
	yld_mgr.container_type=container_type;
	yld_mgr.request_type=request_type;
	yld_mgr.ad_format_list=ad_format_list;
	yld_mgr.ad_size_list=[ad_size_list];
	yld_mgr.ad_delivery_mode=ad_delivery_mode;	
	yld_mgr.clk_dest=clk_dest;
	yld_mgr.ad_output_encoding=ad_output_encoding;
	yld_mgr.max_count=max_count;
	
	if(typeof(reg_data) != 'undefined'){	
	   yld_mgr.user_city=reg_data.user_city;
	   yld_mgr.user_dma=reg_data.user_dma;
	   yld_mgr.user_state=reg_data.user_state;
	   yld_mgr.user_zip=reg_data.user_zip;
	   yld_mgr.user_country=reg_data.user_country;	
	   yld_mgr.user_age=reg_data.user_age;
	   yld_mgr.user_gender=reg_data.user_gender;
	   yld_mgr.user_income=reg_data.user_income;
	}
		
	yld_mgr.pub_content_cat_id_list=[pub_content_cat_id_list];
	yld_mgr.content_type_list=[content_type_list];
	yld_mgr.cstm_content_cat_list=cstm_content_cat_list.split(",");
	yld_mgr.site_section_name_list=[site_section_name_list];
	yld_mgr.ad_content_lang=ad_content_lang;	
	yld_mgr.reporting_tag_list=[reporting_tag_list];	
	yld_mgr.disable_content_send=disable_content_send;
	
	document.write('<SCR'+'IPT type="text/javascript" SRC="http://e.yieldmanager.net/script.js"></SCR'+'IPT>');	
}

