function submitYellowpay(){
	document.yellowpay.submit();
}

function showhideObj(s,mode){
	var obj = document.getElementById(s);
	if (!obj) {
		document.writeln("Warning: object '"+s+"' does not exist")
		return(false)
	}
	switch(mode) {
		case "switch":
			if(obj.style.display!="none")
				obj.style.display="none";
			else
				obj.style.display="";
			break;
		case "hide":
			obj.style.display="none";
			break;
		case "show":
			obj.style.display="";
			break;
	}
	return(false);
}

function showMonCartonImg(flag){
	var objs=document.getElementsByTagName('span');
	for (e=0;e<objs.length;e++) {
		if (objs[e].className=='mon_carton') if (flag) objs[e].style.display=""; else objs[e].style.display="none";
	}
}
function ajax_functions(action,page,htmlId,basketTxt){
	var obj = document.getElementById(htmlId);
	if (!obj) {
		alert("Warning: object '"+htmlId+"' does not exist")
		return(false)
	}
	var xmlHttp;
	try {  // Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	} catch (e) {  // Internet Explorer
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {
				alert("Your browser does not support AJAX!");
				return false;
			}
		}
	}

	xmlHttp.onreadystatechange=function() {
		if(xmlHttp.readyState==4) {
			result=xmlHttp.responseText;
			if (result=="reload") document.location.reload(); else obj.innerHTML=result;
		}
	}

	url="?mode=ajax&rnd="+new Date().getTime()+"&action="+action+"&basketTxt="+basketTxt+"&htmlId="+htmlId+"&page="+page;
	switch (action) {
		case "basket":
		case "moncarton":
			xmlHttp.open("GET",url,true);
			xmlHttp.send(null);
			break;
		default:
			alert("Error in ajax_function (unknown action "+action+")");
			return false;
	}
	return false;
}
function utf8_decode ( str_data ) {
    // http://kevin.vanzonneveld.net
    // +   original by: Webtoolkit.info (http://www.webtoolkit.info/)
    // *     example 1: utf8_decode('Kevin van Zonneveld');
    // *     returns 1: 'Kevin van Zonneveld'
 
    var string = "", i = 0, c = c1 = c2 = 0;
 
    while ( i < str_data.length ) {
        c = str_data.charCodeAt(i);
        if (c < 128) {
            string += String.fromCharCode(c);
            i++;
        } else if((c > 191) && (c < 224)) {
            c2 = str_data.charCodeAt(i+1);
            string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
            i += 2;
        } else {
            c2 = str_data.charCodeAt(i+1);
            c3 = str_data.charCodeAt(i+2);
            string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
            i += 3;
        }
    }
 
    return string;
}