function hasClassName(element,className){var elementClassName=element.className; return(elementClassName.length>0&&(elementClassName==className||new RegExp("(^|\\s)"+className+"(\\s|$)").test(elementClassName)));}
function addClassName(element,className){if (!hasClassName(element,className))element.className+=(element.className?' ':'')+className;}
function toggleMenu(el,over){if(over){addClassName(el,'over');}else{el.className=el.className.replace(new RegExp("(^|\\s+)"+'over'+"(\\s+|$)"),' ').replace(/^\s+|\s+$/g, '');}}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}

function updWl()
{
	var ca = document.cookie.split(';');
	var innerString = "";
	
		
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if ((c.length > 38) && (c.substring(0, 5) == "taWl^") && (c.charAt(37) == "=")) {
			var item_u_id = c.substring(5, 37);
			var item = c.substring(38).split('^');
			innerString += "<form style=\"padding: 0; margin: 0;\" name=\"taWl" + item_u_id + "\" id=\"taWl" + item_u_id + "\" action=\"http://" + site_name + "/shopping_cart/\" method=\"post\"> \
			<input type=\"hidden\" name=\"u_id\" value=\"" + item_u_id + "\"> \
			<input type=\"hidden\" name=\"p_id\" value=\"" + item[0] + "\"> \
			<input type=\"hidden\" name=\"w\" value=\"" + item[1] + "\"> \
			<input type=\"hidden\" name=\"h\" value=\"" + item[2] + "\"> \
			<input type=\"hidden\" name=\"p\" value=\"" + item[3] + "\"> \
			<input type=\"hidden\" name=\"f1\" value=\"" + item[4] + "\"> \
			<input type=\"hidden\" name=\"f2\" value=\"" + item[5] + "\"> \
			</form> \
			\
			<form style=\"padding: 0; margin: 0;\" name=\"taWlx" + item_u_id + "\" id=\"taWl" + item_u_id + "\" action=\"http://" + site_name + "/painting_details/\" method=\"post\"> \
			<input type=\"hidden\" name=\"u_id\" value=\"" + item_u_id + "\"> \
			<input type=\"hidden\" name=\"p_id\" value=\"" + item[0] + "\"> \
			<input type=\"hidden\" name=\"w\" value=\"" + item[1] + "\"> \
			<input type=\"hidden\" name=\"h\" value=\"" + item[2] + "\"> \
			<input type=\"hidden\" name=\"p\" value=\"" + item[3] + "\"> \
			<input type=\"hidden\" name=\"f1\" value=\"" + item[4] + "\"> \
			<input type=\"hidden\" name=\"f2\" value=\"" + item[5] + "\"> \
			</form> \
			\
			<div style=\"float: left; height: 148px; width: 150px; background: #fff; border: 1px solid #5988b3;\"> \
			<div style=\"height: 108px; text-align: center;\"><img style=\" margin-top: 3px; border: 1px solid #c00;\" src=\"" + item[6] + "\"></div> \
			<div style=\"height: 40px; background: #5988b3; text-align: center;\">\
			<a style=\"color: #d3e4f3; text-decoration: none;\" href=\"javascript:void(0);\" onclick=\"document.taWlx" + item_u_id + ".submit();\" onmouseover=\"this.style.textDecoration='underline'\" onmouseout=\"this.style.textDecoration='none'\">" + wlTxt[0] + "</a><br> \
			<a style=\"color: #fff; text-decoration: none;\" href=\"javascript:void(0);\" onclick=\"document.taWl" + item_u_id + ".submit();\" onmouseover=\"this.style.textDecoration='underline'\" onmouseout=\"this.style.textDecoration='none'\">" + wlTxt[1] + "</a><br> \
			<a style=\"color: #d3e4f3; text-decoration: none;\" href=\"javascript:void(0);\" onclick=\"rmvWl('taWl^" + item_u_id + "')\" onmouseover=\"this.style.textDecoration='underline'\" onmouseout=\"this.style.textDecoration='none'\">" + wlTxt[2] + "</a>\
			</div></div>";
			
		}

	}
			document.getElementById('cntntWl').innerHTML = innerString;
}

function rmvWl(name) {
	eraseCookie(name);
	updWl();
}

function shwWl(state) {
	var wl = document.getElementById('wishlist');
	if (state) {
		updWl();
		wl.style.display = state;
		return;
	}

	if (wl.style.display == 'none') {
		updWl();
		wl.style.display = 'block';
	}
	else { 
		wl.style.display = 'none'; }
}

function newwindow()
{
window.open('http://www.topartprint.com/art_prints_discount.htm','jav','width=420,height=400,resizable=no');
}
																					