var wapwindow;
var wapwindowericsson320;

var nokia = true;
var targetX = 50;
var targetY = 70;
var isIE = (navigator.appVersion.indexOf("MSIE")!=-1 && navigator.appVersion.indexOf("MSIE 5.5")==-1);

function wapalize(url){
	if(isIE){
		v = window.open('http://www.gelon.net/ericsson/ewindow.html?'+url,'ewindow','width=710,height=223');
	}
	else{
		v = window.open('http://www.gelon.net/cgi-bin/wapalizeericssonr320.cgi?url='+url,'ewindow','width=200,height=490,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0');
	}
}

function goURL(id){
//	var width = 200; // default = ericsson R320
//	var height = 490;
//	var model = 'r320';
	var width = 480;
	var height = 510;
	var model = '6210large';
	if(document.layers || document.all || navigator.userAgent.indexOf("Mozilla/5")!=-1){
		if(document.all && navigator.appVersion.indexOf('MSIE 5.5')==-1){
//			model = 'r380';
//			width = 950;
//			height = 223;
		}
		var script = 'http://www.gelon.net/cgi-bin/go.cgi?model='+model+'&go='+id;
		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>Connecting to service...</title>');
		wapwindow.document.write('</head>');
		wapwindow.document.write('<body bgcolor="#FFFFFF"><font face="Arial" size="2">Connecting to service...<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;
		}
		else{
			wapwindow.document.location.replace(script);
		}
	}
	else{
		alert('Sorry!\nUnknown browser...\nCan\'t view the WAP sites.');
	}
}


function wap(linken){
	if(document.layers || document.all || navigator.userAgent.indexOf("Mozilla/5")!=-1){
		var width = 200;
//		var height = 418;
		var height = 436;
		var ref = location.href;
		var script = 'http://www.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>Connecting to service...</title>');
		wapwindow.document.write('</head>');
		wapwindow.document.write('<body bgcolor="#FFFFFF"><font face="Arial" size="2">Connecting to service...<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 wapnokia6210large(linken){
	if(document.layers || document.all || navigator.userAgent.indexOf("Mozilla/5")!=-1){
		var width = 480;
		var height = 510;
		var script = '/cgi-bin/6210_large.cgi';
		wapwindowericsson320 = window.open('','nokia6210','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">Connecting to service...<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 wapnokia6210(linken){
	if(document.layers || document.all || navigator.userAgent.indexOf("Mozilla/5")!=-1){
		var width = 200;
		var height = 502;
		var script = '/cgi-bin/wapalizenokia6210.cgi';
		wapwindowericsson320 = window.open('','nokia6210','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">Connecting to service...<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 wapericssonr320(linken){
	if(document.layers || document.all || navigator.userAgent.indexOf("Mozilla/5")!=-1){
		var width = 200;
		var height = 490;
		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 wapmotorola_a6188(linken){
	if(document.layers || document.all || navigator.userAgent.indexOf("Mozilla/5")!=-1){
		var width = 200;
		var height = 564;
		var script = 'http://gelon.net/cgi-bin/motorola_a6188.cgi';
		wapwindowa6188 = window.open('','vindua6188','width='+width+',height='+height+',toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0');
		wapwindowa6188.document.writeln('<html><head><title>Connecting to service...</title>');
		wapwindowa6188.document.writeln('</head>');
		wapwindowa6188.document.write('<body bgcolor="#FFFFFF"><font face="Arial" size="2">Connecting to service...<br><p>');
		wapwindowa6188.document.write('</font>');
		wapwindowa6188.document.write('</body></html>');
//		wapwindowericsson320.document.write('<img src="/7110.jpg" width="200" height="692">');
		wapwindowa6188.document.close();
		wapwindowa6188.document.location.replace(script+'?url='+linken);
	}
	else{
		alert('Sorry!\nUnknown browser...\nCan\'t view the WAP sites.');
	}
}

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

function validateForm(){
	var field;
	if(document.wapalizerform){
		field = document.wapalizerform.url.value;
	}
	else{
		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{
		
	}
}



