function Left(str, n){
if (n <= 0)
return "";
else if (n > String(str).length)
return str;
else
return String(str).substring(0,n);
}
function Right(str, n){
if (n <= 0)
return "";
else if (n > String(str).length)
return str;
else {
var iLen = String(str).length;
return String(str).substring(iLen, iLen - n);
}
}
function msnChat(target)
{
var msnWindowFeatures = 'toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0,width=1,height=1';
var popupWindow = window.open ('http://www.gurteen.com/gurteen/gurteen.nsf/msnchat?openpage&ima=' + target, 'msn', msnWindowFeatures)
}
function CenterWindow(url, name, width, height, params)
{
var str = "height=" + height + ",innerHeight=" + height;
str += ",resizable=yes" + "," + params + ",width=" + width + ",innerWidth=" + width;
if (window.screen) {
var ah = screen.availHeight - 30;
var aw = screen.availWidth - 10;
var xc = (aw - width) / 2;
var yc = (ah - height) / 2;
str += ",left=" + xc + ",screenX=" + xc;
str += ",top=" + yc + ",screenY=" + yc;
str += ", " + params;
}
return window.open(url, name, str);
}
function openKnowledgeSeeds()
{
CenterWindow("/gurteen/gurteen.nsf/kseed-i?openagent&delay=3600","ktips",300,400,"");
}
function RefreshPage()
{
window.location.reload();
}
function changeImage(oldImg,newImg)
{
document[oldImg].src=eval(newImg + ".src");
}
function getCookie(NameOfCookie)
{
if (document.cookie.length > 0)
{
begin = document.cookie.indexOf(NameOfCookie+"=");
if (begin != -1)
{
begin += NameOfCookie.length+1;
end = document.cookie.indexOf(";", begin);
if (end == -1) end = document.cookie.length;
return unescape(document.cookie.substring(begin, end));
}
}
return null;
}
function setCookie(cookie_name, cookie_value, cookie_life)
{
var today = new Date()
var expiry = new Date(today.getTime() + cookie_life * 24*60*60*1000)
var cookie_string =cookie_name + "=" + escape(cookie_value)
if(cookie_life){ cookie_string += "; expires=" + expiry.toGMTString()}
cookie_string += "; path=" + "/"
document.cookie = cookie_string
}
function delCookie (NameOfCookie)
{
if (getCookie(NameOfCookie))
{
value = "";
document.cookie = NameOfCookie + "=" + escape(value) + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
}
function login()
{
CenterWindow("/gurteen/gurteen.nsf/login?OpenForm", "login", 350,200,"");
}
function displayuserprofile(url)
{
win=CenterWindow(url, "userprofile", 620,550,"resizable=yes,scrollbars=yes,toolbar=yes,menubar=yes,status=yes,location=yes,directories=yes");
win.focus();
}
function newwindow(winurl)
{
window.open(winurl, "_blank", "");
}
function newsmallwindow(winurl)
{
CenterWindow(winurl, "_blank",600,450,"resizable=yes,scrollbars=yes,toolbar=yes,menubar=yes,status=yes,location=yes,directories=yes");
}
function openVisitorForm()
{
CenterWindow("/gurteen/gurteen.nsf/visitor?OpenForm", "visitor",600,600,"scrollbars=yes");
}
function openMemberForm()
{
CenterWindow("/gurteen/gurteen.nsf/Member?OpenForm", "visitor",600,600,"scrollbars=yes");
}
function tellFriend(winurl)
{
CenterWindow(winurl, "tellfriend",480,470,"scrollbars=yes");
}
function trackback(winurl)
{
CenterWindow(winurl, "trackback",480,400,"scrollbars=yes");
}
function Email(winurl)
{
CenterWindow(winurl, "email", 520, 480,"scrollbars=yes");
}
function Blog()
{
CenterWindow("/gurteen/gurteen.nsf/Blog?OpenForm", "blog", 550,480,"scrollbars=yes");
}
function Consultancy()
{
CenterWindow("/gurteen/gurteen.nsf/ConsultancyRequest?OpenForm", "consultancy", 550,480,"scrollbars=yes");
}
function EventRequest()
{
CenterWindow("/gurteen/gurteen.nsf/EventRequest?OpenForm", "eventrequest", 550,480,"scrollbars=yes");
}
function BookRequest()
{
CenterWindow("/gurteen/gurteen.nsf/BookReq?OpenForm", "bookrequest", 550,480,"scrollbars=yes");
}
function JobRequest()
{
CenterWindow("/gurteen/gurteen.nsf/JobRequest?OpenForm", "jobrequest", 550,480,"scrollbars=yes");
}
function comment(winurl)
{
window.open(winurl, "_blank","resizable=yes,scrollbars=yes,width=600,height=400,left=50,top=50");
}
function openEventWindow(winurl)
{
CenterWindow(winurl,"_blank", 700,450, "scrollbars=yes,toolbar=yes,menubar=yes,status=yes,location=yes,directories=yes,");
}
function openSearchWindow(winurl)
{
CenterWindow(winurl,"_blank", 700,450, "scrollbars=yes,toolbar=yes,menubar=yes,status=yes,location=yes,directories=yes,");
}
function openAmazonWindow(winurl)
{
window.open(winurl,"_blank", "resizable=yes,scrollbars=yes,width=700,height=400,toolbar=yes,menubar=yes,status=yes,location=yes,directories=yes,left=40,top=5");
}
function openStickerWindow(winurl)
{
window.open(winurl, "sticker", "resizable=yes,scrollbars=no,width=600,height=450,left=100,top=80");
}
function PopUpVisitorForm()
{
member = getCookie('member');
if ((member != null) && (member != "")) {return null};
username = getCookie('username');
if ((username != null) && (username != "")) {return null};
profile = getCookie('profilenumber');
if ((profile != null) && (profile != "")) {return null};
visitorpopup = getCookie('visitorpopup');
if (visitorpopup == 'true') {return null};
hits=getCookie('visitorhits');
if (hits != null && hits != "")
{
hits = eval(hits);
if ((hits > 8) && (hits < 50))
{
setCookie('visitorhits',0,3650);
setCookie('visitorpopup','true',1);
openVisitorForm();
}
}
}
function OpenDocDetails(url)
{
CenterWindow(url,"docdetails",700, 550,"resizable=yes,scrollbars=yes");
}
function OpenCopyDetails(url)
{
CenterWindow(url,"copydetails",700, 300,"resizable=yes,scrollbars=yes");
}
function IncrementPageHits()
{
hits = eval(getCookie('pagehits'));
hits++;
setCookie('pagehits',hits,3650);
}
function IncrementVisitorHits()
{
hits = eval(getCookie('visitorhits'));
hits++;
setCookie('visitorhits',hits,3650);
}
function DisplayCookies()
{
username = getCookie('username');
useremail = getCookie('useremail');
companyname = getCookie('companyname');
pagehits = getCookie('pagehits');
visitorhits = getCookie('visitorhits');
document.write("
Cookie Details
");
document.write("User Name: " + username);
document.write("
");
document.write("Email Address: " + useremail);
document.write("
");
document.write("Page Hits: " + pagehits);
document.write("
");
}
IncrementPageHits();
IncrementVisitorHits();