var txtareaCount = 1000;



function isIE() {
	if (navigator.userAgent.indexOf("Firefox")!=-1)
		return false;
	else if (navigator.userAgent.indexOf("MSIE")!=-1)
		return true;
	return false;
}

function displayElement() {
	
	if (navigator.userAgent.indexOf("Firefox")!=-1) {
		x=491;
	} else if (navigator.userAgent.indexOf("MSIE")!=-1) {
		x=501;
	}
}

function jumpto(choice) {
  var opt = choice.options[choice.selectedIndex].value;
  alert(opt);
  if (opt != "")
     parent.content.location=opt;
}


function confirmDel(url) {
	if (confirm("Are you sure you want to delete this product?"))
		location.href = url;
}

function isNumberKey(evt) {
	
	var charCode = (evt.which) ? evt.which : event.keyCode;
	
	if (charCode > 31 && (charCode < 48 || charCode > 57))
		return false;

	return true;
}

function limiter(x){
	var txt = document.getElementById(x).value;
	var len = txt.length;
	
	if(len > txtareaCount){
        txt = txt.substring(0,txtareaCount);
        document.getElementById(x).value = txt;
        return false;
	}
	document.getElementById("flimit").value = txtareaCount - len;
}


function chgInfo(element, info){
	var obj = document.getElementById(element);
	obj.innerHTML = info;
}

function chgFrmInfo(element, info){
	var obj = document.getElementById(element );
	obj.value = info;
}

function chgCursor(element) {
	element.style.cursor='pointer';
}

function isEmpty(x, val, msg){
	var obj = document.getElementById(x);
	if (obj.value==val) {
		alert(msg);
		obj.focus();
		return true;
	} else {
		return false;
	}
}

function validateForm() {
	if (isEmpty("custname", "", "Please enter your Name.")) return false;
	if (isEmpty("contactno", "", "Please enter your Contact No.")) return false;
	frm.issubmit.value="1";	
	return true;
}

function validateConfirm() {	 

	if (isEmpty("shippingOpt","", "Please select your preferred shipping.")) return false;
		
	return true;
}


