document.write('\');
function getURLVar(urlVarName) {
//divide the URL in half at the '?'
var urlHalves = String(document.location).split('?');
var urlVarValue = '';
if(urlHalves[1]){
//load all the name/value pairs into an array
var urlVars = urlHalves[1].split('&');
//loop over the list, and find the specified url variable
for(i=0; i<=(urlVars.length); i++){
if(urlVars[i]){
//load the name/value pair into an array
var urlVarPair = urlVars[i].split('=');
if (urlVarPair[0] && urlVarPair[0] == urlVarName) {
//I found a variable that matches, load it's value into the return variable
urlVarValue = urlVarPair[1];
}
}
}
}
return urlVarValue;
}
function per_url(url, wildcard) {
var url_string = url.replace("[ufa_end]", "");
var url_array = url_string.split("[ufa_url]");
var len = url_array.length;
for(var i = 0; i < len; i++) {
//alert("url array position " + i + ""); //Debugging
//alert(url_array[i]); //Debugging
var scan = window.location.href;
//alert(scan);
//var wildcard_scan = url_array[i].replace("/", "\/");
//var wildcard_scan = /url_array[i]/i;
if ( wildcard != 'WILDCARD_ON' && scan == url_array[i] ) {
//alert('show ad1'); //Debugging
//alert(url_array[i]); //Debugging
return 'show';
}
else if ( wildcard == 'WILDCARD_ON' && url_array[i] && scan.search(url_array[i]) != -1 ) {
//alert('show ad2'); //Debugging
//alert(window.location.href); //Debugging
//alert(url_array[i]); //Debugging
return 'show';
}
else if ( url_array.length == 1 && url_array[i] == '' ) {
//alert('show ad3'); //Debugging
return 'show';
}
}
}
function referrer_url(url) {
//alert(url); // Debugging
url = '';
var referrer_1_wild = '';
var referrer_2_wild = '';
var referrer_3_wild = '';
if ( !url ) {
//alert('run_ad'); // Debugging
return 'run_ad';
//alert('no url'); // Debugging
}
else if ( url == "" ) {
//alert('run_ad'); // Debugging
return 'run_ad';
}
else if ( url == "" ) {
//alert('run_ad'); // Debugging
return 'run_ad';
}
else if ( url == "" ) {
//alert('run_ad'); // Debugging
return 'run_ad';
}
else {
return '';
}
}
//////////////////////////////////////////////////////////////
function init_ufa(ad_url, custom_var, ad_id, ad_group, wildcard) {
var use_id = ad_id ? '&single=' + ad_id : '';
var use_group = ad_group ? '&group=' + ad_group : '';
if ( per_url(ad_url, wildcard) == "show" ) {
if ( referrer_url(document.referrer) == "run_ad" ) {
document.write('\');
}
}
}