home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2005 June
/
PCWJUN05A.iso
/
javascript
/
functions.js
< prev
next >
Wrap
Text File
|
2005-02-10
|
2KB
|
63 lines
// Author Mike Kelly
var DOM = (document.getElementById ? 1 : 0);
var IE4DOM = (document.all ? 1 : 0);
var NS4 = (document.layers ? 1 : 0);
function GetStyle(id) {
var idHandle = (DOM ? document.getElementById(id) : (IE4DOM ? document.all[id] : false));
return (idHandle ? idHandle.style : false);
}
function setCookie(name, value) {
var exp = new Date(); // make new date object
exp.setTime(exp.getTime() + (60 * 60 * 3)); // set it 3 hrs ahead
document.cookie = name + "=" + escape(value) + "; path=/; expires=" + exp.toGMTString();
}
function getCookie(name) {
var cname = name + "=";
var dc = document.cookie;
if (dc.length > 0) {
var begin = dc.indexOf(cname);
if (begin != -1) {
begin += cname.length;
var end = dc.indexOf(";", begin);
if (end == -1) end = dc.length;
var rtnStr = unescape(dc.substring(begin, end));
return rtnStr;
}
}
return null;
}
function deleteCookie(name, value) {
var exp = new Date(); // make new date object
exp.setTime(exp.getTime() - (60 * 60 * 3)); // set it 3 hrs behind
document.cookie = name + "=" + escape(value) + "; path=/; expires=" + exp.toGMTString();
}
function goSelect(selObj) {
if (selObj.length<=0) { return; }
var sIndex = selObj.selectedIndex;
var sValue = selObj.options[sIndex].value;
var winProps = "";
if (sValue!="") { webWarning(); window.open(sValue, 'popupWin', winProps); }
}
function initialiseUI() {
if (rotators) { setTimeout('rotate()',speed); }
}
function rememberUI() {
if (rotators) {
var rlen = rotators.length;
var firstAdStr = "";
for (var m=0;m<rlen;m++) { firstAdStr = firstAdStr + ',' + rotators[m].currentAd; }
firstAdStr = firstAdStr.substring(1);
setCookie("bannerAd",firstAdStr);
}
}