var cDomain = self.location.hostname;
if(cDomain.indexOf(".") < cDomain.lastIndexOf(".")){
  var domainOffset = cDomain.indexOf(".")+1
  cDomain = cDomain.substr(domainOffset);
}
if(document.referrer.indexOf(cDomain)==-1 && document.cookie.indexOf("referrer=")==-1){
var expDays = 90;
var exp = new Date(); 
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
var refdate = new Date();
document.cookie = "referrer=" + escape(document.referrer + "&&&" + refdate.toGMTString() + "&|&" + document.URL) + "; expires=" + exp.toGMTString() + "; path=/" + "; domain=" + cDomain;
}

var allCookies = document.cookie;
var cPos = allCookies.indexOf("referrer=");
if(cPos != -1){
var cdstart = cPos + 9;
var cdend = allCookies.indexOf(";", cdstart);
if(cdend == -1) cdend = allCookies.length;
var cookieContent = allCookies.substring(cdstart,cdend);
cookieContent = unescape(cookieContent);
var cdatestart = cookieContent.indexOf("&&&", 0);
var cdatemiddle = cookieContent.indexOf("&|&", 0);
var cdateend = cookieContent.length;
var cRefer = cookieContent.substring(0,cdatestart);
var cDateRef = cookieContent.substring(cdatestart +3,cdatemiddle)
var cLandingPage = cookieContent.substring(cdatemiddle +3,cdateend)
}
else{
var cRefer = "No cookie";
var cDateRef = "No cookie";
var cLandingPage = "No cookie";
}


function NewSmallWindow(URL) {
	window.open(URL, "nieuw", "width=100,height=100,toolbars=false,location=false,resizable=false");
}

function sayHello(welkom){
nu = new Date();
if (nu.getHours() >= 18)
welkom = ("Goedenavond,");
else 
if (nu.getHours() >= 12)
welkom = ("Goedemiddag,");
else 
if (nu.getHours() >= 6)
welkom = ("Goedemorgen,");
else
welkom = ("Goedenacht,");
	
return welkom
}

function runSlideShow(){
if (document.all){
document.images.PictureBox.style.filter="blendTrans(duration=2)";
document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
document.images.PictureBox.filters.blendTrans.Apply();}
document.images.PictureBox.src = preLoad[jss].src;
if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss];
if (document.all) document.images.PictureBox.filters.blendTrans.Play();
jss = jss + 1;
if (jss > (pss)) jss=1;
tss = setTimeout('runSlideShow()', SlideShowSpeed);
}

function get_random(Input)
{
    var ranNum= Math.floor(Math.random()*Input);
    return ranNum;
}

function Addfav(){
var title="Geen Kunst Teambuilding & Workshops";
location='favorieten.htm';
// NewSmallWindow('favorieten.htm');
window.external.AddFavorite(location.href, title);
}

function AddfavPart(){
var title="Geen Kunst Teambuilding & Workshops";
location='favorieten-part.htm';
// NewSmallWindow('favorieten.htm');
window.external.AddFavorite(location.href, title);
}

function WriteRecipient(){
a = "info"
b = "geenkunst"
c = ".info"
document.write("<input type='hidden' name='recipient' value='"+ a + "@" + b + c + "' >");
document.write('<input type="hidden" name="ReferURL" value="' + cRefer + '">');
document.write('<input type="hidden" name="ReferDate" value="' + cDateRef + '">');
document.write('<input type="hidden" name="LandingPage" value="' + cLandingPage + '">');
}

function WriteTestRecipient(){
a = "beheer"
b = "geenkunst"
c = ".info"
document.write("<input type='hidden' name='recipient' value='"+ a + "@" + b + c + "' >");
document.write('<input type="hidden" name="ReferURL" value="' + cRefer + '">');
document.write('<input type="hidden" name="ReferDate" value="' + cDateRef + '">');
document.write('<input type="hidden" name="LandingPage" value="' + cLandingPage + '">');
}


function MailAFriend(){
location='mailafriend.htm';
	window.open("mailto:?subject=Website%20www.geenkunst.info&body=Hallo%20.....,%20ik%20heb%20zojuist%20deze%20site%20bezocht%20en%20wil%20hem%20graag%20onder%20je%20aandacht%20brengen:%20www.geenkunst.info");
}

function MailAFriendPart(){
location='mailafriend-part.htm';
	window.open("mailto:?subject=Website%20www.geenkunst.info&body=Hallo%20.....,%20ik%20heb%20zojuist%20deze%20site%20bezocht%20en%20wil%20hem%20graag%20onder%20je%20aandacht%20brengen:%20www.geenkunst.info");
}

function AdaptTitle(){
document.title = "Teambuilding | Workshops - Geen Kunst" 
}

function SendMail(){
location='sendmail.htm';
window.open("mailto:info@geenkunst.info?subject=Zakelijke%20Workshop&body=Voeg%20a.u.b.%20uw%20eigen%20tekst%20in%20en%20druk%20vervolgens%20op%20verzenden.");
}

function SendMailFam(){
location='sendmail-fam.htm';
window.open("mailto:info@geenkunst.info?subject=Familie%20Workshop&body=Voeg%20a.u.b.%20uw%20eigen%20tekst%20in%20en%20druk%20vervolgens%20op%20verzenden.");
}

function SendMailStd(){
location='sendmail-std.htm';
window.open("mailto:info@geenkunst.info?subject=Studenten%20Workshop&body=Voeg%20a.u.b.%20uw%20eigen%20tekst%20in%20en%20druk%20vervolgens%20op%20verzenden.");
}

function SendMailVgz(){
location='sendmail-vgz.htm';
window.open("mailto:info@geenkunst.info?subject=Vrijgezellen%20Workshop&body=Voeg%20a.u.b.%20uw%20eigen%20tekst%20in%20en%20druk%20vervolgens%20op%20verzenden.");
}

function QV_zakelijk (){
   if (window.name!='Info'
	&& !((self.innerHeight == 0) && (self.innerWidth == 0)))
  	    { top.location.replace('workshops.htm');
}
}
function QV_teambuilding (){
   if (window.name!='Info'
	&& !((self.innerHeight == 0) && (self.innerWidth == 0)))
  	    { top.location.replace('teambuilding.htm');
}
}

function QV_beeldhouwen (){
   if (window.name!='bedrijfsuitjesfoto'
	&& !((self.innerHeight == 0) && (self.innerWidth == 0)))
  	    { top.location.replace('beeldhouwen-individueel.htm');
}
}

function QV_familie (){
   if (window.name!='bedrijfsuitjesfoto'
	&& !((self.innerHeight == 0) && (self.innerWidth == 0)))
  	    { top.location.replace('familiedagen.htm');
}
}

function QV_mozaiek (){
   if (window.name!='bedrijfsuitjesfoto'
	&& !((self.innerHeight == 0) && (self.innerWidth == 0)))
  	    { top.location.replace('mozaiek-workshop.htm');
}
}

function QV_vrijgezel (){
   if (window.name!='bedrijfsuitjesfoto'
	&& !((self.innerHeight == 0) && (self.innerWidth == 0)))
  	    { top.location.replace('vrijgezellenfeest.htm');
}
}

