<!--
// Copyright (c) 2006-09 Easy2.com, Inc. All rights reserved.

// Populate the variable below with the text or image that will launch a product demo.
var easy2LinkDisplay = '<img src=\"http://includes.easy2.com/dm/images/chef_viewDemo.png\" border=\"0\">';


// The "document.write" code below can be changed to a <div>, <p> or <td> if needed, BUT MAKE SURE THE ID IS NOT CHANGED.
document.write('<span id=\"easy2Container_chef_184\" style=\"display: none;\"></span>');

// *********************************************************************************************************************
// ***************************************Do not change the code below this line.***************************************
// *********************************************************************************************************************
// This file is named with the "hacked" suffix because I changed things below the line to make this work in a hopup rather than
// in a popup window.  2/20/2010 JW

function getEasy2CheckUrl(itemnumber) {	
	//var containerObj = document.getElementById('easy2Container_' + easy2IncludeID);

   var easy2IncludeID = 'chef_184';
		
	//if(containerObj && easy2IncludeID.indexOf('_') != -1) {
	var qs_1 = '', qs_2 = '', path_1 = '', path_2 = '', other_1 = 'itemnumber', other_2 = '';
		//var check_url = 'http://media.easy2.com/dyna_includes2/actions/check_image.asp';
		var launch_url = 'http://webapps.easy2.com/dyna_includes2/actions/master_page.asp';
		var scrObj = document.getElementById('easy2Script_' + easy2IncludeID);
		//var imgObj = document.createElement('img');
							
		var this_url = easy2CurrentURL();
		var temp_url = (path_1 != '' || path_2 != '') ? easy2PathVal(this_url, true) : easy2PathVal(this_url, false);
		temp_url += (qs_1 != '') ? '?' + qs_1 + '=' + easy2ParamVal(this_url, qs_1) : '';
		temp_url += (qs_2 != '') ? '&' + qs_2 + '=' + easy2ParamVal(this_url, qs_2) : '';

		var e2_vars = '?e2__dyna_include_pid=' + easy2IncludeID.split('_')[1];
		e2_vars += '&e2__dyna_include_host=' + easy2IncludeID.split('_')[0];
		e2_vars += '&e2__dyna_include_url=' + escape(temp_url);

		
		if(scrObj && scrObj.src && scrObj.src != '') {
			var arrURL = scrObj.src.split('?');  
			if(arrURL.length > 1) e2_vars += '&' + arrURL[1];
		}

      e2_vars += "&itemnumber=" + itemnumber
		
		e2_vars += '&e2__dyna_include_cache=true';
		
		return launch_url + e2_vars;
		
		
//		imgObj.onload = function() {
//			launch_url += e2_vars;
//			var this_link = '<a href=\"#\" onclick=\"easy2PopOpenWin(\'' + launch_url + '\', \'easy2Window\', 600, 450); return false;\">';
//			this_link += easy2LinkDisplay;
//			this_link += '</a>';
//			containerObj.innerHTML = this_link;
//			containerObj.style.display = '';
//			imgObj = null;
//		}
//		
//		imgObj.onerror = function() {
//			imgObj = null;
//		}
//		
//		check_url += e2_vars;
//		imgObj.src = check_url;
//	}	
}

//function easy2PopOpenWin(theURL, Name, popW, popH) {
//	theURL += (theURL.indexOf('?') > -1) ? '&' : '?';
//	theURL += 'referurl=' + easy2CurrentURL();
//	var winHorz = (screen.width-popW)/2;
//	var winVert = (screen.height-popH)/2;
//	var winProp = 'width=' + popW + ',height=' + popH + ',left=' + winHorz + ',top=' + winVert + ',scrollbars=yes,resizable=yes';
//	easy2PopWin = window.open(theURL, Name, winProp);
//	if (easy2PopWin && !easy2PopWin.closed && easy2PopWin.top && window.focus) {easy2PopWin.focus()};
//	return false;
//}

function easy2CurrentURL() {
	var thisURL = window.location.href.toString();
	var arrURL = thisURL.split('?');
	var thisURL = unescape(arrURL[0]);
	if(arrURL.length > 1) thisURL += '?' + arrURL[1];
	return thisURL;
}	

function easy2ParamVal(url, var_name) {
	var pat = '(?:&|\\b|\\?)' + var_name + '=([^&#]*)';
	var re = new RegExp(pat,'i');
	var arr = url.match(re);
	var val = (arr) ? arr[1] : '';
	return val;
}

function easy2PathVal(url, path) {
	var val = '';
	var pat = '^([^:]+[:/]+[^/]+)([^?#]*)';
	var re = new RegExp(pat,'i');
	var arr = url.match(re);
	if(arr) {
		val = arr[1];
		val += (path) ? arr[2] : '';
	}
	return val;
}

////easy2CheckModules('chef_184');

//-->

