function checkknipper() {
	if (document.getElementById('theinput').value == '') {
		document.getElementById('knipper2').style.display = 'block';
	}
}
function checktheinput(way) {
	if (way == 'in') {
		if (document.getElementById('theinput').value == 'your input') {
			document.getElementById('theinput').value = '';	
		}
	} else if (way == 'out') {
		if (document.getElementById('theinput').value == '') {
			document.getElementById('theinput').value = 'your input';	
		}
	}
}
function checktheinput2(way) {
	if (way == 'in') {
		document.getElementById('theinput2').value = '';	
	} else if (way == 'out') {
		if (document.getElementById('theinput2').value == '') {
			document.getElementById('theinput2').value = document.getElementById('theinput2cont').value;	
		}
	}
}
function closeilove() {
	document.getElementById('knipper2').style.display = 'none';
	document.getElementById('ilove2punt0').style.display = 'none';
}

var intervalid = 0;
function movedefup() {
	thetop = document.getElementById('ilove2punt0defcont2').style.top;
	temptop = thetop.split('p');
	actualtop = temptop[0];
	
	if (actualtop <= 0) {
		actualtop = actualtop - 1;
		actualtop = actualtop + 3;
		newtop = actualtop+'px';
		document.getElementById('ilove2punt0defcont2').style.top = newtop;
		intervalid = setTimeout('movedefup()', 25);
	}
}
function movedefdown() {
	windowheight = 163;
	contheight = document.getElementById('ilove2punt0defcont2').offsetHeight;
	actualtopmax = windowheight - contheight;
	
	thetop = document.getElementById('ilove2punt0defcont2').style.top;
	temptop = thetop.split('p');
	actualtop = temptop[0];
	
	if (actualtop > actualtopmax) {	
		actualtop = actualtop - 2;
		newtop = actualtop+'px';
		document.getElementById('ilove2punt0defcont2').style.top = newtop;
		intervalid = setTimeout('movedefdown()', 25);
	}
}
function stopdef() {
	clearInterval(intervalid);
}


// --------------------------------------------------------------------------------------------------------------- //

function showall() {
	document.getElementById('loading').style.display = 'none';
	document.getElementById('loadingtext').style.display = 'none';
}

function ilove(nr,s) {
	if (nr == 1) {
		s = document.getElementById('theinput').value;
		if (s == '') {
			alert('you have to love something!');
			return false;
		}		
		document.getElementById('theinput2').value = s;		
		document.getElementById('theinput2cont').value = s;		
		s = s.replace(/ /g, '|');
		ll = s;
	} else if (nr == 2) {
		s = document.getElementById('theinput2').value;
		if (s == '') {
			alert('you have to love something!');
			return false;
		}
		document.getElementById('theinput2cont').value = s;
		s = s.replace(/ /g, '|');
		ll = s
	} else if (nr == 3) {
		ll = s;
		if (s == '') {
			alert('stop');
			return false;
		}
		t = s.replace(/\|/g, ' ');
		document.getElementById('theinput2').value = t;
		document.getElementById('theinput2cont').value = t;
	}
	
	document.getElementById('loading').style.display = 'block';
	document.getElementById('loadingtext').style.display = 'block';
	document.getElementById('ilove2punt0vid').innerHTML = '';
	document.getElementById('knipper2').style.display = 'none';
	document.getElementById('ilove2punt0').style.display = 'none';
	document.getElementById('scrollwelovediv').style.display = 'none';	
	document.getElementById('kop49').style.display = 'none';
	document.getElementById('hidethelogo').style.display = 'none';
	document.getElementById('num31').style.display = 'none';
	document.getElementById('num32').style.display = 'none';
	document.getElementById('num49').style.display = 'none';
	document.getElementById('num50').style.display = 'none';
	document.getElementById('num51').style.display = 'none';
	document.getElementById('num52').style.display = 'none';
	document.getElementById('num53').style.display = 'none';
	document.getElementById('num54').style.display = 'none';
	document.getElementById('num55').style.display = 'none';
	document.getElementById('num56').style.display = 'none';
	document.getElementById('num57').style.display = 'none';
	document.getElementById('num58').style.display = 'none';
	document.getElementById('num59').style.display = 'none';
	document.getElementById('num44').style.display = 'none';
	document.getElementById('num45').style.display = 'none';
	document.getElementById('num46').style.display = 'none';			
	
	anticache = Math.floor(Math.random() * 10000000000);
	theurl = 'http://www.artmiks.nl/www/include/ilove2punt0.php?s='+s+'&ac='+anticache;	
	
	var http_request = false;
	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/html');
		}
	} else if (window.ActiveXObject) { // IE
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
			   http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	
	http_request.onreadystatechange = function() {
		if (http_request.readyState == 4) {
			if (http_request.status == 200) {
				content = http_request.responseText;
				content = content.split('|');
				
				thegif = content[0];
				thejpg1 = content[1];
				thejpg2 = content[2];
				thejpg3 = content[3];
				thebg = content[4];
				thevid = content[5];
				thedef = content[6];
				thechange = content[7];
				thechangecont = content[8];
				thegiflogo = content[9];
				
				document.body.background = thebg;
				document.getElementById('kop191').style.display = 'block';
				document.getElementById('ilove2punt0takemeback').style.display = 'block';				
				document.getElementById('ilove2punt0foto1').innerHTML = '<img src="'+thejpg1+'" style="width:114px;height:80px;" />';
				document.getElementById('ilove2punt0foto2').innerHTML = '<img src="'+thejpg2+'" style="width:48px;height:33px;" />';
				document.getElementById('ilove2punt0foto3').innerHTML = '<img src="'+thejpg3+'" style="width:112px;height:80px;" />';
				document.getElementById('ilove2punt0gif1').innerHTML = '<img src="'+thegif+'" style="width:50px;" />';
				document.getElementById('ilove2punt0gif2').innerHTML = '<img src="'+thegif+'" style="width:50px;" />';
				document.getElementById('ilove2punt0gif3').innerHTML = '<img src="'+thegif+'" style="width:50px;" />';
				document.getElementById('ilove2punt0gif4').innerHTML = '<img src="'+thegif+'" style="width:50px;" />';
				document.getElementById('ilove2punt0gif5').innerHTML = '<img src="'+thegif+'" style="width:50px;" />';
				document.getElementById('ilove2punt0gif6').innerHTML = '<img src="'+thegif+'" style="width:50px;" />';
				document.getElementById('ilove2punt0defcont2').innerHTML = '<br />'+thedef;
				setTimeout("document.getElementById('ilove2punt0vid').innerHTML = '<object type=\"application/x-shockwave-flash\" style=\"width:116px; height:97px;\" data=\"http://www.youtube.com/v/'+thevid+'&rel=0&autoplay=1\"><param name=\"movie\" value=\"http://www.youtube.com/v/'+thevid+'&rel=0&autoplay=1\" /></object>';",1000);
				
				flashlogohtml = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="54" height="54" id="artmikslogo" align="middle">';
				flashlogohtml += '<param name="allowScriptAccess" value="sameDomain" />';
				flashlogohtml += '<param name="allowFullScreen" value="false" />';
				flashlogohtml += '<param name="movie" value="artmikslogo.swf?bg='+thegiflogo+'" />';
				flashlogohtml += '<param name="menu" value="false" />';
				flashlogohtml += '<param name="quality" value="best" />';
				flashlogohtml += '<param name="wmode" value="transparent" />';
				flashlogohtml += '<param name="bgcolor" value="#ffffff" />';
				flashlogohtml += '<embed src="artmikslogo.swf?bg='+thegiflogo+'" menu="false" quality="best" wmode="transparent" bgcolor="#ffffff" width="54" height="54" name="artmikslogo" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
				flashlogohtml += '</object>';
				setTimeout("document.getElementById('flashlogo').innerHTML = flashlogohtml;",1000);				
				
				youtubes = s.replace(/\|/g, '+');
				document.getElementById('kop45').innerHTML = '<a href="http://www.youtube.com/results?search_query='+youtubes+'&search=Search" style="text-decoration:none;" target="_blank">+ more videos</a>';
				
				document.getElementById('ilove2punt0close').style.left = '582px';
				document.getElementById('ilove2punt0more').style.display = 'block';
				document.getElementById('ilove2punt0linkslove').style.display = 'block';
				document.getElementById('ilove2punt0cont').style.display = 'block';					
				if (thechange == 1) {
					document.getElementById('theinput2').value = thechangecont;
					document.getElementById('theinput2cont').value = thechangecont;
				}
				document.getElementById('setthis').onclick = function(){linkslove(ll,thejpg2,thegif);};
				document.getElementById('theforward').onclick = function(){forwardilove(ll,thejpg1,thegif);};				
				setTimeout('showall();',1000);				
			}				
		}			
	}
	
	http_request.open('GET',theurl,true);
	http_request.send(null);
	
	return false;
}

function focusontheinput() {
	if (document.getElementById('ilove2punt0').style.display == 'block') {
		document.getElementById('theinput').focus();
	}
}

function resizeloading() {
	winwidth = 0;
	winheight = 0;
	if (typeof(window.innerWidth) == 'number') {
		//Non-IE
		winwidth = window.innerWidth;
		winheight = window.innerHeight;
	} else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
		//IE 6+ in 'standards compliant mode'
		winwidth = document.documentElement.clientWidth;
		winheight = document.documentElement.clientHeight;
	} else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
		//IE 4 compatible
		winwidth = document.body.clientWidth;
		winheight = document.body.clientHeight;
	}
	if (navigator.appName == 'Netscape') {
		winwidth = winwidth - 16;
	}
	document.getElementById('loading').style.width = winwidth+'px';
	document.getElementById('loading').style.height = winheight+'px';
}

function morelove() {
	morelovewin = window.open('www/include/ilovemore.php','morelove','left=100,top=50,width=250,height=550,toolbar=0,location=0,status=0,menubar=0,resizable=0');	
	morelovewin.focus();
}

function linkslove(s,bg,gif) {
	linkslovewin = window.open('ilove_links.php?s='+s+'&b='+bg+'&g='+gif,'lovelinks','left=100,top=50,width=750,height=550,toolbar=0,location=0,status=0,menubar=0,resizable=0');	
	linkslovewin.focus();
}
function forwardilove(s,bg,gif) {
	forwardilovewin = window.open('forwardilove.php?s='+s+'&b='+bg+'&g='+gif,'forwardilove','left=100,top=50,width=750,height=550,toolbar=0,location=0,status=0,menubar=0,resizable=0');	
	forwardilovewin.focus();
}
function show20() {
	document.getElementById('ilove2punt0').style.display = 'block';
	focusontheinput();
}
function scrollwelove(nl,ml) {
	if (nl == undefined) {
		w = document.getElementById('scrollwelovedivcontent').offsetWidth;
		ml = 0 - w;
		nl = 42;
	}

	if (nl > ml) {
		nl--;
		document.getElementById('scrollwelovedivcontent').style.left = nl+'px';
		setTimeout('scrollwelove('+nl+','+ml+');',40);
	} else {
		nl = 42;
		scrollwelove(nl,ml);
	}
}