function getParameterByName( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}

function jpdSetCookie( name, value, expires, path, domain, secure )
{
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );

/*
if the expires variable is set, make the correct
expires time, the current script below will set
it for x number of days, to make it for hours,
delete * 24, for minutes, delete * 60 * 24
*/
if ( expires )
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
( ( path ) ? ";path=" + path : "" ) +
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}

function jpdGetCookie( check_name ) {
	// first we'll split this cookie up into name/value pairs
	// note: document.cookie only returns name=value, not the other components
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f

	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		// now we'll split apart each name=value pair
		a_temp_cookie = a_all_cookies[i].split( '=' );


		// and trim left/right whitespace while we're at it
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');

		// if the extracted name matches passed check_name
		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			// we need to handle case where cookie has no value but exists (no = sign, that is):
			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			// note that in cases where cookie is initialized but no value, null is returned
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found )
	{
		return null;
	}
}



// Load jQuery if it isn't loaded already
var loadingJQuery = false;
function loadJQuery() {
        if(typeof(jQuery) == 'undefined'){
                if(!loadingJQuery) {
                        var head= document.getElementsByTagName('head')[0];
                        var script= document.createElement('script');
                        script.type= 'text/javascript';
                        script.src= 'http://ads.jetpackdigital.com/jquery-1.3.2.min.js';
                        head.appendChild(script);
                        loadingJQuery = true;
                }
                setTimeout("loadJQuery()",100);
        } else {
		if(typeof($) == 'undefined') {
			$ = jQuery;
		}
                runUnits();
        }
}

function initUnits() {
					customunit0.Init();
				customunit1.Init();
			}

function runUnits() {
        // Iterate through each unit, calling run on each
        						customunit0.Run();
			customunit0.ReportDelivery();
						customunit1.Run();
			customunit1.ReportDelivery();
						
							
		
}


	
			
var ActiveSkin_10_116_92 = function() {
	// Set the campaignDataId for this unit
	this.campaignDataId = 92;
	
	this.Init = function() {
		// Make sure that the page is correct
					if(0 || window.location.search.substring(1).match(/keywords=.*?Soy.*/) || window.location.search.substring(1).match(/keywords=.*?soy.*/)) {
			
				
									
						
			var head = document.getElementsByTagName('head')[0],
    		style = document.createElement('style'),
    		rules = document.createTextNode('body { background: #ffffff url(http://ads.jetpackdigital.com/sites/vtimes/assets/116/1265000609.bgskin_116.jpg) no-repeat fixed top center !important; height: auto;}');
			style.type = 'text/css';
			if(style.styleSheet)
    			style.styleSheet.cssText = rules.nodeValue;
			else style.appendChild(rules);
			head.appendChild(style);
			
										
					}
			},

	// Run the clickable skin unit
	this.Run =  function() {
		
					if(0 || window.location.search.substring(1).match(/keywords=.*?Soy.*/) || window.location.search.substring(1).match(/keywords=.*?soy.*/)) {
				
				
									
						$("#body").ready(function() {
				// Setup the left and right well if they exist
				
										
						// Get the x position, and width of the container unit
						var position = $("#body").offset();
						var width =  $("#body").width();
						var left_position = position.left - 140 - 5;
						
						//alert("body\nX: " + position.left + "\nWIDTH: " + width);
						
						var div = document.createElement("div");
						$(div).css("position","absolute");
						$(div).css("height","800px");
						$(div).css("width","140px");
						$(div).css("top","0px");
						$(div).css("left", left_position);
						//$(div).css("background-color","#000000");
						$(div).attr("id","jpd_leftwell");
						
													var embed = document.createElement("embed");
	                    	$(embed).attr("src","http://ads.jetpackdigital.com/sites/vtimes/assets/116/1265000609.leftwell_116.swf");
	                    	$(embed).attr("quality","high");
	                    	$(embed).attr("height","800");
	                    	$(embed).attr("width","140");
	                    	$(embed).attr("FlashVars","clickTag=http://admin.jetpackdigital.com/tracking/click/?cd=92");
	                    	$(embed).attr("type","application/x-shockwave-flash");
	                    	$(embed).attr("wmode","transparent");
	                    	$(embed).attr("PLUGINSPAGE","http://www.macromedia.com/go/getflashplayer");
	                    	$(div).append(embed);
	                    	
																		
						$("body").append(div);
						$(window).resize(function() {
							var position = $("#body").offset();
							var width =  $("#body").width();
							var left_position = position.left - 140 - 5;
							$("#jpd_leftwell").css("left",left_position);
						});

					
													
														
						// Get the x position, and width of the container unit
						var position = $("#body").offset();
						var width =  $("#body").width();
						var left_position = position.left + width + 5;
						
						//alert("body\nX: " + position.left + "\nWIDTH: " + width);
						
						var div = document.createElement("div");
						$(div).css("position","absolute");
						$(div).css("height","800px");
						$(div).css("width","140px");
						$(div).css("top","0px");
						$(div).css("left", left_position);
						//$(div).css("background-color","#000000");
						$(div).attr("id","jpd_rightwell");
						
													var embed = document.createElement("embed");
	                    	$(embed).attr("src","http://ads.jetpackdigital.com/sites/vtimes/assets/116/1265000609.rightwell_116.swf");
	                    	$(embed).attr("quality","high");
	                    	$(embed).attr("height","800");
	                    	$(embed).attr("width","140");
	                    	$(embed).attr("type","application/x-shockwave-flash");
	                    	$(embed).attr("wmode","transparent");
	                    	$(embed).attr("FlashVars","clickTag=http://admin.jetpackdigital.com/tracking/click/?cd=92");
	                    	$(embed).attr("PLUGINSPAGE","http://www.macromedia.com/go/getflashplayer");
	                    	$(div).append(embed);
	                    	
																		
						$("body").append(div);
						$(window).resize(function() {
							var position = $("#body").offset();
							var width =  $("#body").width();
							var left_position = position.left + width + 5;
							$("#jpd_rightwell").css("left",left_position);
						});

					
									});
						
			
			$(document).click(function(e) {	
    			e = e || event;
    			var target = e.srcElement || e.target;
    			
    			
    			    			
				if(target.tagName.toLowerCase() == 'body') {
					// get mouse position
					
					var posx = 0;
					var posy = 0;
					
					if (!e) var e = window.event;
					if (e.pageX || e.pageY) {
						posx = e.pageX;
						posy = e.pageY - document.body.scrollTop;
					} else if (e.clientX || e.clientY) 	{
						posx = e.clientX;// + document.body.scrollLeft + document.documentElement.scrollLeft;
						posy = e.clientY;// + document.body.scrollTop + document.documentElement.scrollTop;
					}

   					
   					var w = 0;
   					var h = 0;
   					if (document.documentElement) {
         				w = document.documentElement.offsetWidth;
          				h = document.documentElement.offsetHeight;
      				} else if (window.innerWidth && window.innerHeight) {
          				w = window.innerWidth;
          				h = window.innerHeight;
      				}

					if(typeof ord == 'undefined') ord=Math.random()*10000000000000000;
					window.open("http://admin.jetpackdigital.com/tracking/click/?ord="+ord+"&cd=92&d=w:"+w+"::h:"+h+"::x:"+posx+"::y:"+posy+"::sw:"+screen.width,"_blank");
					//window.open("http://ad.n2434.doubleclick.net/clk;220767175;44372011;y","_blank");
				}
			});
		
			$(document).mouseover(function(e) {	
    			e = e || event;
    			var target = e.srcElement || e.target;
				var original_cursor = target.style.cursor;
				if(target.tagName.toLowerCase() == 'body') {
					$(document.body).css({"cursor":"pointer"});
				} else {
					$(document.body).css({"cursor":target.style.cursor});
				}
			});
			
									
				
					}
				
	},
	
	this.ReportDelivery = function() {
					
			if(0 || window.location.search.substring(1).match(/keywords=.*?Soy.*/) || window.location.search.substring(1).match(/keywords=.*?soy.*/)) {
				
		if(typeof ord == 'undefined') ord=Math.random()*10000000000000000;
		var imgdiv = document.createElement("div");
		var img = document.createElement("img");
		imgdiv.style.display = "none";
		
		img.src = 'http://admin.jetpackdigital.com/tracking/view/?ord='+ord+'&cd=92';
		//img.src = 'http://ad.n2434.doubleclick.net/ad/N2434.VegetarianTimes/B4135423.16;sz=1x1';
		imgdiv.appendChild(img);
		
		//imgdiv.innerHTML = "<img src='http://ad.n2434.doubleclick.net/ad/N2434.VegetarianTimes/B4135423.16;sz=1x1/ord="+ord+"?'/>";
		
					}
			},
	
	this.ShowTracking = function() {
			}
};



			
var ActiveSkin_10_141_128 = function() {
	// Set the campaignDataId for this unit
	this.campaignDataId = 128;
	
	this.Init = function() {
		// Make sure that the page is correct
					if(0 || location.pathname.match(/^\/$/) || location.pathname.match(/^\/index.*$/)) {
			
				
									
						
			var head = document.getElementsByTagName('head')[0],
    		style = document.createElement('style'),
    		rules = document.createTextNode('body { background: #ffffff url(http://ads.jetpackdigital.com/sites/vtimes/assets/141/1268030302.bgskin_141.jpg) no-repeat fixed top center !important; height: auto;}');
			style.type = 'text/css';
			if(style.styleSheet)
    			style.styleSheet.cssText = rules.nodeValue;
			else style.appendChild(rules);
			head.appendChild(style);
			
										
					}
			},

	// Run the clickable skin unit
	this.Run =  function() {
		
					if(0 || location.pathname.match(/^\/$/) || location.pathname.match(/^\/index.*$/)) {
				
				
									
						$("#body").ready(function() {
				// Setup the left and right well if they exist
				
										
						// Get the x position, and width of the container unit
						var position = $("#body").offset();
						var width =  $("#body").width();
						var left_position = position.left - 140 - 5;
						
						//alert("body\nX: " + position.left + "\nWIDTH: " + width);
						
						var div = document.createElement("div");
						$(div).css("position","absolute");
						$(div).css("height","800px");
						$(div).css("width","140px");
						$(div).css("top","0px");
						$(div).css("left", left_position);
						//$(div).css("background-color","#000000");
						$(div).attr("id","jpd_leftwell");
						
													var embed = document.createElement("embed");
	                    	$(embed).attr("src","http://ads.jetpackdigital.com/sites/vtimes/assets/141/1268030302.leftwell_141.swf");
	                    	$(embed).attr("quality","high");
	                    	$(embed).attr("height","800");
	                    	$(embed).attr("width","140");
	                    	$(embed).attr("FlashVars","clickTag=http://admin.jetpackdigital.com/tracking/click/?cd=128");
	                    	$(embed).attr("type","application/x-shockwave-flash");
	                    	$(embed).attr("wmode","transparent");
	                    	$(embed).attr("PLUGINSPAGE","http://www.macromedia.com/go/getflashplayer");
	                    	$(div).append(embed);
	                    	
																		
						$("body").append(div);
						$(window).resize(function() {
							var position = $("#body").offset();
							var width =  $("#body").width();
							var left_position = position.left - 140 - 5;
							$("#jpd_leftwell").css("left",left_position);
						});

					
													
														
						// Get the x position, and width of the container unit
						var position = $("#body").offset();
						var width =  $("#body").width();
						var left_position = position.left + width + 5;
						
						//alert("body\nX: " + position.left + "\nWIDTH: " + width);
						
						var div = document.createElement("div");
						$(div).css("position","absolute");
						$(div).css("height","800px");
						$(div).css("width","140px");
						$(div).css("top","0px");
						$(div).css("left", left_position);
						//$(div).css("background-color","#000000");
						$(div).attr("id","jpd_rightwell");
						
													var embed = document.createElement("embed");
	                    	$(embed).attr("src","http://ads.jetpackdigital.com/sites/vtimes/assets/141/1268030302.rightwell_141.swf");
	                    	$(embed).attr("quality","high");
	                    	$(embed).attr("height","800");
	                    	$(embed).attr("width","140");
	                    	$(embed).attr("type","application/x-shockwave-flash");
	                    	$(embed).attr("wmode","transparent");
	                    	$(embed).attr("FlashVars","clickTag=http://admin.jetpackdigital.com/tracking/click/?cd=128");
	                    	$(embed).attr("PLUGINSPAGE","http://www.macromedia.com/go/getflashplayer");
	                    	$(div).append(embed);
	                    	
																		
						$("body").append(div);
						$(window).resize(function() {
							var position = $("#body").offset();
							var width =  $("#body").width();
							var left_position = position.left + width + 5;
							$("#jpd_rightwell").css("left",left_position);
						});

					
									});
						
			
			$(document).click(function(e) {	
    			e = e || event;
    			var target = e.srcElement || e.target;
    			
    			
    			    			
				if(target.tagName.toLowerCase() == 'body') {
					// get mouse position
					
					var posx = 0;
					var posy = 0;
					
					if (!e) var e = window.event;
					if (e.pageX || e.pageY) {
						posx = e.pageX;
						posy = e.pageY - document.body.scrollTop;
					} else if (e.clientX || e.clientY) 	{
						posx = e.clientX;// + document.body.scrollLeft + document.documentElement.scrollLeft;
						posy = e.clientY;// + document.body.scrollTop + document.documentElement.scrollTop;
					}

   					
   					var w = 0;
   					var h = 0;
   					if (document.documentElement) {
         				w = document.documentElement.offsetWidth;
          				h = document.documentElement.offsetHeight;
      				} else if (window.innerWidth && window.innerHeight) {
          				w = window.innerWidth;
          				h = window.innerHeight;
      				}

					if(typeof ord == 'undefined') ord=Math.random()*10000000000000000;
					window.open("http://admin.jetpackdigital.com/tracking/click/?ord="+ord+"&cd=128&d=w:"+w+"::h:"+h+"::x:"+posx+"::y:"+posy+"::sw:"+screen.width,"_blank");
					//window.open("http://ad.n2434.doubleclick.net/clk;220767175;44371994;r","_blank");
				}
			});
		
			$(document).mouseover(function(e) {	
    			e = e || event;
    			var target = e.srcElement || e.target;
				var original_cursor = target.style.cursor;
				if(target.tagName.toLowerCase() == 'body') {
					$(document.body).css({"cursor":"pointer"});
				} else {
					$(document.body).css({"cursor":target.style.cursor});
				}
			});
			
									
				
					}
				
	},
	
	this.ReportDelivery = function() {
					
			if(0 || location.pathname.match(/^\/$/) || location.pathname.match(/^\/index.*$/)) {
				
		if(typeof ord == 'undefined') ord=Math.random()*10000000000000000;
		var imgdiv = document.createElement("div");
		var img = document.createElement("img");
		imgdiv.style.display = "none";
		
		img.src = 'http://admin.jetpackdigital.com/tracking/view/?ord='+ord+'&cd=128';
		//img.src = 'http://ad.n2434.doubleclick.net/ad/N2434.VegetarianTimes/B4135423.3;sz=1x1';
		imgdiv.appendChild(img);
		
		//imgdiv.innerHTML = "<img src='http://ad.n2434.doubleclick.net/ad/N2434.VegetarianTimes/B4135423.3;sz=1x1/ord="+ord+"?'/>";
		
					}
			},
	
	this.ShowTracking = function() {
			}
};



	
		var customunit0 = new ActiveSkin_10_116_92();
		var customunit1 = new ActiveSkin_10_141_128();
	

// Check for preview mode, and go to the preview file on the main server
if(getParameterByName("jpdpreview") && !0) {
	var previewScript = document.createElement("script");
	previewScript.src = "http://admin_1.jetpackdigital.com/preview/?jpdpreview=" + getParameterByName("jpdpreview") + "&sid=" + getParameterByName("sid");
	$(document.head).append(previewScript);
} else {
	initUnits();
	setTimeout("loadJQuery()",100);
}


