You're calling the document.write before you have a value for sq1. How exactly do you expect it to work in that case? Though essentially, I see no point in the whole thing either, but eh... I guess you have your reasons.
Try the following function, called onclick on a button or whatever:
Code:
function checkVar() {
window.location="displayVar.php?sq1="+sq1;
}
See how that goes for you.
Additionally
SCRIPT LANGUAGE="JavaScript" is deprecated and obsolete, avoid using it.