var to;
act=15;
isLive=0;
id=0;
a=0;
live = 'images/nbcFinal_03.gif';
non = 'images/nbcFinal_04.gif';

var reload_after;
var html_content;

//Start this code



function loadBanner(html_content,reload_after,mm)
{
	
	if(id==0){
	a = mm;
	a++;
	
    //myHtml = htmlentities(html_content);
    html_content=unescape(html_content);
    document.getElementById('ajax-banner').innerHTML = html_content;
   

    try {
        clearTimeout(to);
    } catch (e) {}
	to = setTimeout("nextAd(a)", parseInt(reload_after));


}
}


function nextAd()
{
	
    fullURL= document.domain;
	var script = document.createElement('script');
	if(a==0){
    	var headID = document.getElementsByTagName("head")[0];         
    var cssNode = document.createElement('link');
    cssNode.type = 'text/css';
    cssNode.rel = 'stylesheet';
    cssNode.href = 'http://www.doapps.com/_pfire/widget/css/pricefireWidget.css';
    cssNode.media = 'screen';
    headID.appendChild(cssNode);
    	
    	var now = new Date();
    	var url = 'http://www.doapps.com/_pfire/widget/ajax-banner.php?myId='+act+'&myLoc='+a+'&myWeb='+fullURL+'&ts=' + now.getTime();
    	
    }
    else {
    	var now = new Date();
    	var url = 'http://www.doapps.com/_pfire/widget/ajax-banner.php?myId='+act+'&myLoc='+a+'&myWeb='+fullURL+'&ts=' + now.getTime();
    		
    }
    script.setAttribute('src',url);
    document.getElementsByTagName('head')[0].appendChild(script);

}

function buyProd(){
	var buyUrl = 'http://www.doapps.com/_pfire/widget/counter.php?myId='+act;
    script.setAttribute('src',buyUrl);
    document.getElementsByTagName('head')[0].appendChild(script);
    
}


function openBuy(url){
	window.open("http://www.doapps.com/_pfire/"+url, "","resizable=0,HEIGHT=314,WIDTH=428");
}


function stopAd(){
	id=1;
}

function liveAd(){
	isLive = 1;
	nextAd();	
}

function notLive(){
	isLive = 0;
	nextAd();

}

function resumeAd(){
	id=0;
	nextAd();
}

var OnLoad = 'nextAd();';
window.onload = function() {eval(OnLoad);};


//Change Names
var browserType;
var idE;


if (document.layers) {browserType = "nn4"}
if (document.all) {browserType = "ie"}
if (window.navigator.userAgent.toLowerCase().match("gecko")) {
   browserType= "gecko"
}

function swap(h, o) {
  if (browserType == "gecko" )
     document.poppedLayer = 
         eval('document.getElementById(h)');
  else if (browserType == "ie")
     document.poppedLayer = 
        eval('document.getElementById(h)');
  else
     document.poppedLayer =   
        eval('document.layers[h]');
  document.poppedLayer.style.visibility = "hidden";
  var tes = document.getElementById('desc');
  tes.style.overflow = "auto";
  show(o);

}

function hide(idE) {
  if(idE=="buy"){
	resumeAd();
  }
  
  if(idE=="reviewPanel"){
  	resumeAd();
  }
  
  
  if (browserType == "gecko" )
     document.poppedLayer = 
         eval('document.getElementById(idE)');
  else if (browserType == "ie")
     document.poppedLayer = 
        eval('document.getElementById(idE)');
  else
     document.poppedLayer =   
        eval('document.layers[idE]');
  document.poppedLayer.style.visibility = "hidden";
  var tes = document.getElementById('desc');
  tes.style.overflow = "auto";
}

function show(idE){
  if(idE=="buy"){
  	stopAd();
  	key = document.getElementById('idE');
  }	
  
  if(idE=="addWidget"){
  	stopAd();
  	key = document.getElementById('idE');
  }	
  
   if(idE=="reviewPanel"){
  	stopAd();
  	key = document.getElementById('idE');
  }		
	
  if (browserType == "gecko" )
     document.poppedLayer = 
         eval('document.getElementById(idE)');
     
  else if (browserType == "ie")
     document.poppedLayer = 
        eval('document.getElementById(idE)');
  else 
     document.poppedLayer = 
         eval('document.layers[idE]');
         
  document.poppedLayer.style.visibility = "visible";
  var tes = document.getElementById('desc');
  tes.style.overflow = "hidden";
}



