
var popUpWin = false;
var browsertype=false;
if((navigator.appName=="Netscape")&&(parseInt(navigator.appVersion)>=3)) browsertype=true;
if((navigator.appName=="Microsoft Internet Explorer")&&(parseInt(navigator.appVersion)>=4)) browsertype=true;

function e (z, h, w, b, g) {
	document.write('<div style="width:'+w+';height:'+h+';background:white url(http://zoom.cafepress.com/'+(z%10)+'/'+z+'_zoom.jpg) no-repeat center center;"><img border="'+b+'" class="imageborder" src="/cp/img/'+(g?'zoom':'spacer')+'.gif" width="'+w+'" height="'+h+'"></div>')
}

function objectdata(hsize,vsize,hilite,original,messge)
{if(browsertype)
{		this.messge=messge;
		this.simg=new Image(hsize,vsize);
		this.simg.src=hilite;
		this.rimg=new Image(hsize,vsize);
		this.rimg.src=original;
}}

/**
 ** swapImg() -- swaps two images
 ** Params:
 **   ToImg - pass in the name of the target image
 **  FromImg - pass in the name of the original image
 **/
function swapimg(ToImg, FromImg)
{
	document.images[ToImg].src=document.images[FromImg].src
}

if (browsertype){
var object=new Array();
//object['home']= new objectdata(56,21,"/cp/info/img/btn_home_on.gif","/cp/info/img/btn_home_off.gif","Home");
//object['sell']= new objectdata(69,21,"/cp/info/img/btn_sell_on.gif","/cp/info/img/btn_sell_off.gif","Sell");
//object['help']= new objectdata(72,21,"/cp/info/img/btn_help_on.gif","/cp/info/img/btn_help_off.gif","Help");
//object['comm']= new objectdata(79,21,"/cp/info/img/btn_comm_on.gif","/cp/info/img/btn_comm_off.gif","Community");
}

function hilite(name)
{if(browsertype)
{//window.status=object[name].messge;
document[name].src=object[name].simg.src;}}

function original(name)
{if(browsertype)
{//window.status="";
document[name].src=object[name].rimg.src;}}

/**
 * launchHelp -> use to pop up all help windows  
 **/
function launchHelp(newURL, newFeatures)
{
  if ((navigator.appName=='Microsoft Internet Explorer') && (window.HelpWindow)) HelpWindow.close();
  HelpWindow = open(newURL, "HelpWindow", newFeatures + ",screenX=0,left=0,screenY=0,top=0,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=0,status=0,toolbar=0,scroll=1");
  if (HelpWindow.opener == null) HelpWindow.opener = window;
  HelpWindow.focus();
}

function CheckPopup() {
	if (popUpWin) {
		popUpWin.close();
	};
};

/** 
 ** launchWin()
 **     use to launch all popup windows besides help 
 **/
function launchWin(href, target, params)
{
  var features = params + ',screenX=0,left=0,screenY=0,top=0,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=1,status=0,toolbar=0';
  popWin = window.open(href, target, features);
  if (popWin.focus) popWin.focus();
}

//survey code
function openExitSurvey(SurveyURL) {
	if (ShowSurvey) { document.cookie = "ExitSurvey=1;path=/"; ExitSurveyWin = window.open(SurveyURL,'ExitSurveyWin','height=450,width=400",screenX=0,left=0,screenY=0,top=0,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=0,status=0,toolbar=0,scroll=1,scrollbars=1'); }


}

function getCPCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) { begin = dc.indexOf(prefix); if (begin != 0) return null; }
  else { begin += 2; }
  var end = document.cookie.indexOf(";", begin);
  if (end == -1) { end = dc.length; }
  return unescape(dc.substring(begin + prefix.length, end));
}

//-- Function loadLongExampleWindow -- ajagtiani, 9/15/04
//-- loads the window for the long example popup in section_edit.aspx
function loadLongExampleWindow(url) {
	launchHelp(url,"height=380,width=550,scrollbars=1");
}
 
//-- Function loadShortExampleWindow - ajagtiani, 9/15/04
//--   Loads the short Example popup window in section_edit.aspx
function loadShortExampleWindow(url) {
	launchHelp(url,"height=480,width=430,scrollbars=1");
}

//--	Function loadHelpWindow - ajagtiani, 9/15/04
//--	loads help window for section_edit.aspx
function loadHelpWindow(url) {
	launchHelp(url,"height=300,width=400,scrollbars=1");
}
    
//returns the style of the DIV with the given divname
function getDivStyle(divname) {
 var style;
 if (isDOM) { style = document.getElementById(divname).style; }
 else { style = isIE ? document.all[divname].style
                     : document.layers[divname]; } // NS4
 return style;
}

// annoying detail: IE and NS6 store elt.top and elt.left as strings.
//Moves the given element by the given (X,Y) offset
function moveBy(elt,deltaX,deltaY) {
 elt.left = parseInt(elt.left) + deltaX;
 elt.top = parseInt(elt.top) + deltaY;
}

  //Toggles the visibility of the element with the given name
//If visible, make hidden. If hidden, make visible.
function toggleVisibility(divname,show) {
 var divstyle = document.getElementById(divname).style;
 if (show == 2) {
	divstyle.display='inline';
 } else if (show == 1) {
 	divstyle.display='block';
 } else if (show == 0) {
 	divstyle.display='none';
 }
} 

//moveDiv() - moves a DIV to a specified location on an event
function moveDiv(e,divName) {
	var productListDiv = document.getElementById(divName);
	var x,y;
	
	//If IE, use e.client(x,y) + document.documentBody.scroll(Left/Top), else use e.pageX for Mozilla/Netscape where e is an Event object
	if(!document.all) {
		x = e.pageX;
		y = e.pageY;
	} else {
		x = e.clientX + document.documentElement.scrollLeft;
		y = e.clientY + document.documentElement.scrollTop;
	}
	
	//add spacing between mouse location and top of DIV location to prevent onmouseout from being executed
	x= x + 15;
	productListDiv.style.top = y + "px";
	productListDiv.style.left = x + "px";
}

//hideDiv() - hide all the products 
function hideDiv(divName) {
	var div = document.getElementById(divName);
	div.style.display="none";
	div.innerHTML="";
}

//HitBox vars - DO NOT EDIT OR REMOVE
var cp_pagename=""; 									// _pn="PUT+PAGE+NAME+HERE"; //page name(s)
var cp_content_category=""; 					// _mlc="CONTENT+CATEGORY"; //multi-level content category
var cp_segment=""; 										// _seg=""; // visitor segmentation
var cp_campaign_id="";								// _cmp=""; // campaign id
var cp_campaign_goal="";							// _gp="";  // campaign goal
var cp_campaign_id_in_qs=""; 					// _cmpn="";// campaign id in query
var cp_campaign_goal_in_qs=""; 				// _gpn=""; // campaign goal in query
var cp_funnel="";											// _fnl=""; // funnels
var cp_error_code="";									// _pec=""; // error codes
var cp_form_validation_name=""; 			// _fv="";  // form validation function name
var cp_dynamic_campaign="";						// _dcmp="";// dynamic campaign
var cp_dynamic_campaign_in_qs="";			// _dcmpn="";//dynamic campaign in query
var cp_response_attribute="";					// _hra=""; // response attribute
var cp_conversion="";									// _hcn=""; // conversion
var cp_conversion_value="";						// _hcv=""; // conversion value
var cp_lead_tracking="";							// _hlt=""; // lead tracking
var cp_lead_attribute="";							// _hla=""; // lead attribute
var cp_response_attribute_in_rqs="";	// _hqsr="";// response attribute in referrer query
var cp_response_attribute_in_qs="att";		// _hqsp="";// response attribute in query
var cp_premium_or_basic=""; 					// _hc1=""; // custom 1 //PremiumOrBasic Shop
var cp_bought_from_own_store="";				// _hc2=""; // custom 2
var cp_is_store_owner=""; 						// _hc3=""; // custom 3 // Is a Store Owner
var cp_custom4=""; 										// _hc4=""; // custom 4
var cp_link_tracking="auto";							// _lt="none";  // link tracking
var cp_customer_id="";								// _ci="";  // customer id
var cp_campaign="";										// _cp="null"; // campaign
var cp_campaign_domain="";						// _cpd=""; // campaign domain
var cp_default_page_name="";					// _pndef="title"; //default page name
var cp_default_content_category="";		// _ctdef="full"; //default content category
var cp_download_filter="";						// _dlf="n"; //download filter
var cp_exit_link_filter="";						// _elf="n"; //exit link filter
var cp_download_file_tracker_var="";	// _dft="n"; // download file tracker variable, set to y to use the name reference
var cp_custom_referrer="";						// _hrf=""; // custom referrer. use valid url or param name
var cp_event_page_identifier="";			// _epg="n"; //event page identifier

var cp_keywords=""; //internal search variables
var cp_results=""; //internal search variables


