

function rollover(imgname,newsrc){
	if (document.images){
	document.images[imgname].src=newsrc}
}

function cpwin(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();
}


var defcolor = "";
function setdefcolor(cval){
	defcolor = cval;
}



function viewlarger(pid){
	if (defcolor.length > 0){
	cpwin('http://www.cafepress.com/cp/moredetails.aspx?showBleed=false&ProductNo=' + pid + '&colorNo=' + defcolor + '&pr=F&pid=213454','height=610,width=650,scrollbars=1');
	} else {
	cpwin('http://www.cafepress.com/cp/moredetails.aspx?showBleed=false&ProductNo=' + pid + '&pr=F&pid=213454','height=610,width=650,scrollbars=1');
	}
}


function sizechart(pid){
	if (defcolor.length > 0){
	cpwin('http://www.cafepress.com/cp/moredetails.aspx?productNo=' + pid + '&colorNo=' + defcolor + '&pr=F&showbleed=false&tab=3&pid=213454','height=610,width=650,scrollbars=1');
	} else {
	cpwin('http://www.cafepress.com/cp/moredetails.aspx?productNo=' + pid + '&pr=F&showbleed=false&tab=3&pid=213454','height=610,width=650,scrollbars=1');
	}
}

function fitfab(){
	cpwin('http://www.cafepress.com/cp/info/help/help_fit.aspx','height=600,width=600,scrollbars=1');
}



function cc(price){
	cpwin('/cc/' + price + '/','height=400,width=750,scrollbars=1');
}



function updateselect(sid, newopt) {
	var selectDropDown = document.getElementById(sid);
	for(i=0; i < selectDropDown.options.length; i++) {
		var optionVal = selectDropDown.options[i].value;
		if (optionVal == newopt) {
			if (selectDropDown.options[i].selected != true) {
				selectDropDown.options[i].selected = true;
			}
			return;
		}
	}
}

function updateimgborder(id, border) {
	var myImg = document.getElementById(id);

    if (myImg != undefined) {
		myImg.style.border=border;

    }
}

function updatetext(id, newtxt) {
	var txt = document.getElementById(id);
	if (txt != undefined) {
		txt.innerHTML = newtxt;
	}
}

function fakeclick(idprefix, sid) {
	var dropDown = document.getElementById(sid)
	var chosenVal = dropDown.options[dropDown.options.selectedIndex].value
	var imgId = idprefix + chosenVal;
	document.getElementById(imgId).onclick();
}





