// JavaScript Document
/*var IE = document.all ? true : false;
if (!IE) {
    document.captureEvents(Event.MOUSEMOVE);
}

document.onmousemove = getMouseXY;
var tempX = 0;
var tempY = 0;
*/
/*function Sumar(obj)
{
	var valor=0;
	if(obj.checked==true)
	{
		valor=parseInt(F1.txtCompare.value,0) + 1;
		F1.txtCompare.value=valor;
		if(valor>5)
		{
			alert("It only can select five articles");
			obj.checked=false;
			valor=parseInt(F1.txtCompare.value,0) - 1;
			F1.txtCompare.value=valor;
		}
	} else {
		valor=parseInt(F1.txtCompare.value,0) - 1;
		F1.txtCompare.value=valor;
	}
	
}	*/
var sumar = 0;
function Sumar(obj){
	var identificador=obj.value;
	var text = F1.txtCompare.value;
	if (obj.checked == true){
		if (sumar < 5){
			if (text.substring(text.length-1, text.length) != "-") { 
				if (text.length<1){
					F1.txtCompare.value = F1.txtCompare.value + identificador+'-';
				}else {
					F1.txtCompare.value = F1.txtCompare.value + '-'+identificador+'-';
				}
			} else {
			F1.txtCompare.value = F1.txtCompare.value + identificador+'-';
			}
			sumar++
		} else {
			obj.checked = false;
			alert ("You only can select five items "+sumar);
		}
	} else {
		sumar--
		F1.txtCompare.value = F1.txtCompare.value.replace(identificador+'-',"");
		F1.txtCompare.value = F1.txtCompare.value.replace('-'+identificador,"");
	}
}


function Enviar()
{
	if (F1.txtCompare.value == ""){
		alert("Select Items");
		return;
	} else {
		var text = F1.txtCompare.value;
		if (text.substring(text.length-1, text.length) == "-") { F1.txtCompare.value = text.substring(0, text.length - 1) }
		F1.submit();
	}
}

function over(id) {
    var archivo = document.getElementById(id).src;
    extension = (archivo.substring(archivo.lastIndexOf("."))).toLowerCase();
    document.getElementById(id).src = archivo.replace(extension, "-over" + extension);
}
function out(id) {
    var archivo = document.getElementById(id).src;
    extension = (archivo.substring(archivo.lastIndexOf("."))).toLowerCase();
    document.getElementById(id).src = archivo.replace("-over" + extension, extension);
}

function print_page() {
	window.print();
}


