url = document.location.href;
if ( typeof(al_basedir) == "undefined" ) al_basedir = "/AL/";
if ( typeof(al_zone) == "undefined"){ al_error("Error : al_zone must be specified"); exit; }
if ( typeof(al_subid) == "undefined" ) al_subid = "NOID";
if ( typeof(al_affiliateurl) == "undefined"){ al_error("Error: al_affiliateurl must be specified"); exit; }
if ( typeof(al_layout) == "undefined" ) al_layout = "728x90";
if ( typeof(al_border) == "undefined" ) al_border = "000000";
if ( typeof(al_title) == "undefined" ) al_title = "000099";
if ( typeof(al_background) == "undefined" ) al_background = "FFFFFF";
if ( typeof(al_text) == "undefined" ) al_text = "000000";
if ( typeof(al_url) == "undefined" ) al_url = "777777";

al_base_url = url.substr(0, (url.indexOf('/', url.indexOf('//')+2))) + al_basedir;

document.write('<div id="' + al_zone + '" style="width:728;height:90;"><img src="' + al_basedir + 'loading.gif" alt="loading" /></div>');

ajax_get ( al_base_url, al_zone, al_keywords, al_subid, al_affiliateurl, al_layout, al_border, al_title, al_background, al_text, al_url  );


function ajax_do (url) { 
        var jsel = document.createElement('SCRIPT');
        jsel.type = 'text/javascript';
        jsel.src = url;
		
		if ( navigator.appName == "Microsoft Internet Explorer" ){
			myEle=document.createElement("option");
			theText=document.createTextNode("[------- SELECT ITEM -------]");
			myEle.appendChild(theText);
			myEle.setAttribute("value","0");
			myEle.appendChild(jsel);
		}else{
        	document.body.appendChild(jsel);
		}
}

function ajax_get ( szBaseUrl, szZone, szKeywords, szSubId, szAffiliateUrl, szLayout, szBorder, szTitle, szBackground, szText, szUrl ) {
		
        //if (typeof(szZone) == 'string') { szZone = document.getElementById(szZone); }
        //if (szZone == null) { return false; }
        getfile_url = szBaseUrl + 'AL_Manager.php?z=' + escape(szZone) + '&kw=' + escape(szKeywords) + '&si=' + escape(szSubId) + '&au=' + escape(szAffiliateUrl) + '&lo=' + escape(szLayout) + '&bo=' + escape(szBorder) + '&ti=' + escape(szTitle) + '&bg=' + escape(szBackground) + '&tx=' + escape(szText) + '&u=' + escape(szUrl);
        ajax_do (getfile_url);
        return true;
}

function al_error ( error_msg ){
	document.write('<div id="error">Error:' + error_msg + '</div>');
}

function isset(varname){
	if (typeof(varname) == "undefined"){return false;}else{return true;}
}