// JavaScript Document

// email to a friend
function EmailLink(){
window.location = "mailto:"+"?subject=Gulf Keystone Petroleum" + "&body=" + "I thought this link might interest you:  " + document.title + "  " + location.href;
}

// bookmark function
function Bookmark()
{
	  // Get title
	  title = window.document.title;
	  // Get url
	  url = window.document.location;

	  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4))
	  window.external.AddFavorite(url, title);
	  else
	  alert("Press CTRL-D (Firefox) or COMMAND-D(Safari) to bookmark this page");
}

 function swapPic()
     {
     if(document.getElementById)
                 {
                 var thePicture=document.getElementById("banner");                 
                 var picPath="images/banner"+rnd(4)+".jpg";                 
                 thePicture.style.background="url("+picPath+")";
			   }
     }
     
	function rnd(n)
     {
     return Math.floor(Math.random() * n) + 1;
 }





 var path = "";
 function ReadCookie(cookieName) {
     var theCookie = "" + document.cookie;
     var ind = theCookie.indexOf(cookieName);
     if (ind == -1 || cookieName == "") return "";
     var ind1 = theCookie.indexOf(';', ind);
     if (ind1 == -1) ind1 = theCookie.length;
     return unescape(theCookie.substring(ind + cookieName.length + 1, ind1));
 }
 function fnDisclaimer(str) {
     CurrPath = ReadCookie('Path')
     if (str == 'TRUE') {
         document.cookie = "Disclaimer=TRUE";
         window.location.href = CurrPath;
     }
     else {
         document.cookie = "Disclaimer=FALSE";
         window.location.href = 'default.aspx';
     }


 }
 function fnonloadtest(str) {
     document.cookie = "Path=" + window.location;
     str = str.replace('amp;', '');
     ResultFlag = ReadCookie('Disclaimer')
     if (ResultFlag != 'TRUE')
         window.location.href = str;
 }
 function fnonloadCreate() {
        ResultFlag = ReadCookie('Disclaimer')
        if (ResultFlag == "")
            document.cookie = "Disclaimer=FALSE";

     
 } // JavaScript Document