function adjustHeight() {
  var myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE 652
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
  }
  if( myHeight != 0) {
	inHeight = myHeight;
  } else {
  	inHeight = 500;
  }
  if (inHeight > htmlheight) {
  	document.getElementById("main_holder").style.height = inHeight + "px";
  }
}
function init() {
	window.onresize = adjustHeight;
	adjustHeight();
}
function adjustPU() {
	var myWidth = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE 652
    myWidth = window.innerWidth;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
  }
  if( myWidth != 0) {
	puPos = (myWidth-726) / 2;
  } else {
  	puPos = 250;
  }
  document.getElementById("cvvpu").style.right = puPos + "px";
  adjustHeight();
}
function initPU() {
	window.onresize = adjustPU;
	adjustPU();
}
function popCVV() {
	document.getElementById("cvvpu").style.display = "block";
}
function closeCVV() {
	document.getElementById("cvvpu").style.display = "none";
}
function updateName() {
	var fname = document.getElementById("o_pd_fname").value;
	var lname = document.getElementById("o_pd_lname").value;
	var uname = document.getElementById("UserName");
	if (lname != "") {
		fulname = fname+" "+lname;
	} else {
		fulname = fname;
	}
	uname.value = fulname;
}
function updateAddress1() {
	var street = document.getElementById("o_sd_street").value;
	var house = document.getElementById("o_sd_house").value;
	var address1 = document.getElementById("BillingAddress1");
	if (street != "") {
		add1 = "רחוב "+street;
		if (house != "") {
			add1 = add1 + " "+house;
		}
	} else {
		add1 = "";
	}
	address1.value = add1;
}
function updateAddress2() {
	var app = document.getElementById("o_sd_app").value;
	var address2 = document.getElementById("BillingAddress2");
	if (app != "") {
		add2 = "דירה "+app;
	} else {
		add2 = "";
	}
	address2.value = add2;
}