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 scan = window.location.href;
//alert(scan);
//var wilcard_scan = url.replace("/", "\/");
//var wilcard_scan = /url/i;
if ( wildcard != 'WILDCARD_ON' && scan == url ) {
//alert('show ad1'); //Debugging
return 'show';
}
else if ( wildcard == 'WILDCARD_ON' && scan.search(url) != -1 ) {
//alert('show ad2'); //Debugging
//alert(window.location.href);
//alert(url);
return 'show';
}
else if ( url == 'AD_URL_HERE' ) {
//alert('show ad3'); //Debugging
return 'show';
}
else {
//alert('don\'t show ad'); //Debugging
return 'hide';
}
}
function referrer_url(url) {
//alert(url); // Debugging
url = '';
var referrer_1_wild = '';
var referrer_2_wild = '';
var referrer_3_wild = '';
if ( !url ) {
//alert(''); // Debugging
return 'run_ad';
//alert('no url'); // Debugging
}
else if ( url == "" ) {
//alert(''); // Debugging
return '';
}
else if ( url == "" ) {
//alert(''); // Debugging
return '';
}
else if ( url == "" ) {
//alert(''); // Debugging
return '';
}
else {
return 'show';
}
}
//////////////////////////////////////////////////////////////
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('\');
}
}
}