// -------------------------------------------------------------------
// Affiliates Video Ads (C) 1999-2009, Universal Class, Inc.
// -------------------------------------------------------------------

//if ( !catid ) { catid = 'default'; }
//catid = 'default';
var rn=Math.floor(Math.random()*11983);
var refpg=urlencode(location.href);
if (catid) {
document.write('<iframe frameborder="0" scrolling="no" border="0" width="300" height="225" allowtransparency="true" src="http://4uc.org/aff/vdo/'+catid+'.htm?affid='+affid+'&rn=' + rn +'&crn='+crn+'&catid='+catid+'&u='+u+'&refpg='+refpg+'" NAME="vframe0" ID="vframe0"></iframe>');
} else {
document.write('<iframe frameborder="0" scrolling="no" border="0" width="300" height="225" allowtransparency="true" src="http://4uc.org/aff/vdo/vframe.htm?affid='+affid+'&rn=' + rn +'&crn='+crn+'&catid='+catid+'&u='+u+'&refpg='+refpg+'" NAME="vframe0" ID="vframe0"></iframe>');
}

function urlencode(stext) {
if (stext) {
stext=escape(stext);
stext=replace(stext,"+", "%2B");
stext=replace(stext,"/", "%2F");
stext=replace(stext,".", "%2E");
return stext;
}
}
function replace(s, t, u) {
// Replace a token in a string
// s  string to be processed
// t  token to be found and removed
// u  token to be inserted
// returns new String
i = s.indexOf(t);
r = "";
if (i == -1) return s;
r += s.substring(0,i) + u;
if ( i + t.length < s.length)
r += replace(s.substring(i + t.length, s.length), t, u);
return r;
}
