function showWindows(){
	//setTimeout(function(){location.href=("/train.cgi?"+document.getElementById("url").value)},1000)
	
	var url=document.getElementById("url").value
	if(!url.match(/^http:\/\//)){
		url = "http://" + url;
	}       
        

        //if (!url.match(/^https?:\/\/[a-z0-9-]+(\.[a-z0-9-]+)+/i)){
/*        if (!url.match(/^[A-Za-z]+://[A-Za-z0-9-_]+\.[A-Za-z0-9-_%&\?\/.=]+$/)){
            alert("Url doesn`t match")
        } else {
*/
//  /^http:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?$/i
        //if (url.match(/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/)){
	if(url.match(/^https?:\/\/([\w\-]+\.)+[\w\-]+(\/[\w\- .\/?%&=]*)?$/i)){
		try{
			location.href=escape("/surf/"+url)
		} catch (e){ throw e }
	}
}

function gE(id){
	return document.getElementById(id)
}

function rollOver(){
	gE("roller").scrollAmount=0
	this.style.backgroundColor="#e0e0e0"
}

function rollOut(){
	gE("roller").scrollAmount=2
	this.style.backgroundColor="transparent"
}

function rollClick(){
	location.href=this.alt
}

/*window.onload=function(){
	var ia=document.images
	for(var i=0;i<ia.length;i++){
		ia[i].onmouseover=rollOver
		ia[i].onmouseout=rollOut
		ia[i].onclick=rollClick
	}
}*/

window.onresize=function(){
	var w=document.body.offsetWidth//gE("top").offsetWidth
	,downloads=gE("downloads")
	,right=gE("right")
	,enter=gE("enter")
	//window.status=w+":"+(new Date).getTime()
	if(w<1100){
		right.style.left="65%"
		right.style.width="32%"
		downloads.style.width="177px"
		//enter.style.marginLeft="30px"
	} else {
		right.style.left="60%"
		right.style.width="38%"
		downloads.style.width="400px"		
		//enter.style.marginLeft="0px"
	}
}

window.onload=function(){
	gE("url").value=""
	window.onresize()
}

function getMovie(movieName){
	if (navigator.appName.indexOf("Microsoft") != -1) {
		return window[movieName]
	} else {
	        return document[movieName]
	}	
}

function flashOver(){
	try{getMovie("roller").showBar()}catch(e){}
}

function flashOut(){
	try{getMovie("roller").hideBar()}catch(e){}
}
