// showMe scripts for the history page //

function cleame(theElement) {
theElement.value="";
}

function showDesc(theDiv) {
document.getElementById(theDiv).style.display = "block";

}

function showMe(thediv) {
new Effect.Fade('readMe',{duration :1});
setTimeout('showMeMore(\'' + thediv + '\')',1000);
}

function showMeMore(thediv) {
newCode = document.getElementById(thediv).innerHTML;
document.getElementById('readMe').innerHTML = newCode;
new Effect.Appear('readMe');
}
function showProduct(pc) {
  Lightview.show({
    href: '/pwl-product-detail.php?'+pc,
    rel: 'iframe',
    title: 'Price Western Leather',
    caption: 'Product Detail',
    options: {
      width:876,height:612,
      topclose: true
    }
  });

}

function featureProduct(productCode) {
	if(productCode!="") {
	// alert ("showing " + productCode);
	showProduct(productCode);
	}
}

function childCheck() {
	if(parentExists()) {
	// alert("header found");
	} else {
	var thisProduct = window.location;
	window.location = "http://www.pwluk.com/index.php?productView="+thisProduct;
	}
}

function parentExists() {
 return (parent.location == window.location)? false : true;
}
function checkSearch() {
var mykey = document.searchForm.searchString.value;
	if(mykey !="" && mykey!="Search pwluk.com") {
	return true;
	} else {
	// alert("Checking form"); //searchString
	return false;
	}
}
function checkSearchSubmit() {
var mykey = document.searchForm.searchString.value;
	if(mykey !="" && mykey!="Search pwluk.com") {
	document.searchForm.submit();
	} else {
	}
}

function clearField(theField) {
var thisField =  theField.name;
theField.value="";
}
function checkLogin() {
var myuser = document.login.user.value;
var mykey = document.login.key.value;
	if(myuser!="" && mykey !="") {
	return true;
	} else {
	alert("Please enter your PWL Client Area username and password to continue");
	return false;
	}


}

function closeContent() {
alert("Closing sub content.");
}
