function goToOffer(){ 
	flexWin("http://wsprod.bbdodetroit.com/launch/2009DodgeRam1500PrivateOffer.jsp?vid=1000&sid=ENT&bid=u&pid=CWebPage&adid=RESPR-RameSpiffPop&rid=u",'yes',screen.availWidth,screen.availHeight,'webexclusive');

	//Tracking
	_hbSet('lid', 'get_it_now');
	_hbSet('lpos', 'content');
	_hbSend();

	closeHTMLNoTrack();
}

function closeHTMLNoTrack(){
	hshade.remove();
	hbox.remove();
}

function closeHTML() {
	
	//Tracking
	_hbSet('lid', 'close');
	_hbSet('lpos', 'espiff_pop_up');
	_hbSend();
	
	hshade.remove();
	hbox.remove();
}


function lightbox_espiff(){
	var ram_html;
	var vshade;
	
	var link_url = "javascript:goToOffer();";
	
	ram_html += "<div id='l-box'>";
	ram_html += "<span style='display: block; width: 400px; margin: 0 auto;'><img src = '/en/2009/ram_1500/images/ram_espiff_popup.jpg' usemap='#popup' /></span>";
	ram_html += "</div>";
	
	ram_html += "<map name='popup' id='popup'><area shape='rect' coords='338,5,394,25' href='javascript:closeHTML()' /><area shape='rect' coords='143,351,257,375' href='"+link_url+"' /></map>";
	
	showHTML(ram_html);
	
	$('l-box').setStyles({
		'position' : 'relative',
		'top' : '100px'
	});
	
	$('html_overlay').setStyle('color','black');
	
	pageTrack('','espiff');
	
    //flexWin("/en/2009/ram_1500/eSpiff/index.html",'no','400','400','ram_webexclusive');
    //Set cookie
    Cookie.set("ram_exclusive",'true');
}

function run_webexclusive(){
    var webexclusiveCookie = Cookie.get("ram_exclusive");
    var isValidPage = getValidPage();
    var randomnumber = Math.floor(Math.random()*101);
    
    if(!webexclusiveCookie){
        if(isValidPage){
            if(randomnumber <= 33){
				lightbox_espiff();
		    }
		 }
    }
    
}


function getValidPage(){
    var exclusiveSwitch = false;
   		
        //homepage
        if(cur_section == 'overview'){
            exclusiveSwitch = true;
        }
 		
/*
        //cabs & trims
        if(cur_section == 'models'){
            exclusiveSwitch = true;
        }
        
        //photos
        if(cur_section == 'photos_videos'){
            exclusiveSwitch = true;
        }
        
        //ram vs.comp
        if(cur_section == 'features'){
            if(cur_subcat == 'ram_vs_competition'){
                exclusiveSwitch = true;
            }
        }

		if(_mlc.contains('/ram_1500/gaq/') == true){
			exclusiveSwitch = true;
		}
		*/
        
    return exclusiveSwitch;
}

    

//onload_register('run_webexclusive();');