common.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. var ifastnet_aff = 19474;
  2. function jumpLink(action, params, target) {
  3. var fm = document.createElement("form");
  4. var params = params || {};
  5. fm.action = action;
  6. fm.method = "post";
  7. fm.target = target || "";
  8. fm.style.display = "none";
  9. for (var x in params) {
  10. var opt = document.createElement("input");
  11. opt.name = x;
  12. opt.value = params[x];
  13. fm.appendChild(opt);
  14. }
  15. document.body.appendChild(fm);
  16. fm.submit();
  17. document.body.removeChild(fm); // remove form after submit
  18. }
  19. function setCookie(name, value, expires, path, domain, secure) {
  20. var today = new Date();
  21. today.setTime(today.getTime());
  22. if (expires) {
  23. expires = expires * 1000 * 60 * 60 * 24;
  24. }
  25. var expires_date = new Date(today.getTime() + (expires));
  26. document.cookie = name + '=' + escape(value) +
  27. ((expires) ? ';expires=' + expires_date.toGMTString() : '') + //expires.toGMTString()
  28. ((path) ? ';path=' + path : '') +
  29. ((domain) ? ';domain=' + domain : '') +
  30. ((secure) ? ';secure' : '');
  31. }