function checkone(id){
	var pid = "pid_" + id;
	var p = $(pid);
	var qty = p.value;
	if(qty == ''){
		p.value = 1;
	}
}

function textBoxEdit(sid,textval){
	var tbox = document.getElementById(sid);
	if(tbox.value!=textval)	tbox.value = textval;
}

function checknewsletterForm()
{
  var theForm = document.getElementById("newsform");

  for(i=0; i<theForm.elements.length; i++){
  	 if((theForm.elements[i].type == "password" || theForm.elements[i].type == "text" || theForm.elements[i].type == "textarea") && theForm.elements[i].getAttribute('id') != "nr" ){
         	var elname = theForm.elements[i].name;
      	 	if(theForm.elements[i].value == "" || theForm.elements[i].value == "Enter Email Address"){
      	 	theForm.elements[i].style.background = "#FFCCCC";
      	 	theForm.elements[i].focus();
      	 	theForm.elements[i].value = "";
      	 	document.getElementById("erralert2").innerHTML = "Enter Email Address";
      	 	document.getElementById("erralert2").className = "newsalerton";
      	 	document.getElementById("erralert2").style.fontSize = "12px";
           document.getElementById("erralert2").style.margin = "0";
  
      	 	t=1;
      	 	return false;
      	 	}else {
      	 		theForm.elements[i].style.background = "#FFFFFF";
      	 		document.getElementById("erralert2").className = "erralertoff";
      	 		}

      }
  }
   return true;
}

/*Handle Size Click img change*/
function sizeClick(sid,hiddenval)
{
	sizeimg  = document.getElementById(sid);

	document.getElementById(hiddenval).value=sid.toUpperCase();


	navRoot = document.getElementById("sizenav");
	for (i=0; i<navRoot.childNodes.length; i++) {
	node = navRoot.childNodes[i];
	if (node.nodeName=="LI") {
		nname = node.getAttribute('name');
		if(nname!=sid){
		document.getElementById(nname).src = "./images/buttons/"+nname+".jpg";
		}else
		{document.getElementById(nname).src = "./images/buttons/"+sid+"-selected.jpg";
		  document.getElementById('sizeselected').innerHTML =  "&nbsp;&nbsp;"+sid.toUpperCase();
		}
	   }
	  }



	return true;
}

function confirmAction(url, text){
	if (confirm(text)){
		document.location = url;
	}
}

function showImage()
{
 var il = document.getElementById("il");
 il.className = 'show';
 var iu = document.getElementById("iu");
 iu.className = 'show';
 var i = document.getElementById("i");
 i.className = 'hide'; 
}

function showCustom(){
	var allTR = document.getElementsByTagName('tr');
	if(document.getElementById('custom').checked==true){ 
		for (i=0; i<allTR.length; i++) { 
			if (allTR[i].className=='hide_custom' || allTR[i].className=='show_custom') { 
				allTR[i].className='show_custom'; 
			}
		}
	}else{ 
		for (i=0; i<allTR.length; i++) { 
			if (allTR[i].className=='hide_custom' || allTR[i].className=='show_custom') { 
				allTR[i].className='hide_custom'; 
			}
		}
	}
}
