var wapwindow;
var wapwindowericsson320;

var nokia = true;
var targetX = 50;
var targetY = 70;

function wap(linken){
	if(document.layers || document.all || navigator.userAgent.indexOf("Mozilla/5")!=-1){
		var width = 200;
		var height = 418;
		var script = 'http://gelon.net/cgi-bin/wapalize.cgi';
		wapwindow = window.open('','vindu','width='+width+',height='+height+',toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0');
		wapwindow.document.write('<html><head><title>Fetching site...</title>');
		wapwindow.document.write('</head>');
		wapwindow.document.write('<body bgcolor="#FFFFFF"><font face="Arial" size="2">Loading page...<br><p>');
		wapwindow.document.write('</font>');
		wapwindow.document.write('</body></html>');
//		wapwindow.document.write('<img src="/7110.jpg" width="200" height="692">');
		wapwindow.document.close();
		if(document.layers){
			wapwindow.document.location = script+'?url='+linken;
		}
		else{
			wapwindow.document.location.replace(script+'?url='+linken);
		}
	}
	else{
		alert('Sorry!\nUnknown browser...\nCan\'t view the WAP sites.');
	}
}

function wapericssonr320(linken){
	if(document.layers || document.all || navigator.userAgent.indexOf("Mozilla/5")!=-1){
		var width = 200;
		var height = 418;
		var script = 'http://gelon.net/cgi-bin/wapalizeericssonr320.cgi';
		wapwindowericsson320 = window.open('','vindu','width='+width+',height='+height+',toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0');
		wapwindowericsson320.document.writeln('<html><head><title>Fetching site...</title>');
		wapwindowericsson320.document.writeln('</head>');
		wapwindowericsson320.document.write('<body bgcolor="#FFFFFF"><font face="Arial" size="2">Loading page...<br><p>');
		wapwindowericsson320.document.write('</font>');
		wapwindowericsson320.document.write('</body></html>');
//		wapwindowericsson320.document.write('<img src="/7110.jpg" width="200" height="692">');
		wapwindowericsson320.document.close();
		wapwindowericsson320.document.location.replace(script+'?url='+linken);
	}
	else{
		alert('Sorry!\nUnknown browser...\nCan\'t view the WAP sites.');
	}
}

function validateForm(){
	var field = document.forms[0].url.value;
	var ret = true;
	if(field.indexOf('/',7)==-1){
		ret = confirm('Missing trailing slash in URL!\n\nDo you want to add a trailing slash at the end of this URL?\nClick OK to add a slash and change the URL to '+field +'/ or\nCancel to continue without changes.');
		if(ret)document.forms[0].url.value += '/';
	}
	return ret;
}

function loop(i){
	if(i>=0){
		if(document.all){
			document.all.it.style.visibility = "visible";
			document.all.it.style.pixelTop = targetY + (i*(i-(i/2))) - i;
			document.all.it.style.pixelLeft = targetX + i - (i * -19);
			i--;
			setTimeout("loop("+i+")", 10);
		}
		else if(document.layers){
			document.layers["it"].top = targetY + (i*(i-(i/2))) - i;
			document.layers["it"].left = targetX + i - (i * -14);
			if(document.layers["it"].visibility=="hide")document.layers["it"].visibility = "show";
			i--;
			setTimeout("loop("+i+")", 5);
		}
	}
	else{
		setTimeout("getOut("+1+")",5000);
	}
}

function getOut(t){
	if(t<20){
		if(document.all){
			document.all.it.style.pixelLeft = targetX - (t*t);
			t++;
			setTimeout("getOut("+t+")", 20);
		}
		else if(document.layers){
			document.layers["it"].left = targetX - (t*t);
			t++;
			setTimeout("getOut("+t+")", 20);
		}
	}
	else{
		
	}
}




