var host = window.location.hostname;
document.write('<link href="http://www.variflight.com/embed/css/'+host+'.css" rel="stylesheet" type="text/css" />');
var WebService = new Object();

WebService.Browser = {
	ie: /msie/.test(window.navigator.userAgent.toLowerCase()),
	moz: /gecko/.test(window.navigator.userAgent.toLowerCase()),
	opera: /opera/.test(window.navigator.userAgent.toLowerCase())
};

WebService.$ = function(s)
{
	return (typeof s == 'object') ? s: document.getElementById(s);
};

WebService.JsLoader = {
	load: function(sUrl, fCallback)
	{
		var _script = document.createElement('script');
		_script.setAttribute('type', 'text/javascript');
		_script.setAttribute('src', sUrl);
		_script.setAttribute('charset','gb2312'); 
		document.getElementsByTagName('head')[0].appendChild(_script);

		if (WebService.Browser.ie)
		{
			_script.onreadystatechange = function()
			{
				if (this.readyState=='loaded' || this.readyState=='complete')
				{
					fCallback();
				}
			};
		}
		else if (WebService.Browser.moz)
		{
			_script.onload = function()
			{
				fCallback();
			};
		}
		else
		{
			fCallback();
		}
	}
};


WebService.Flights = {

	_print: function()
	{
		WebService.JsLoader.load("http://www.variflight.com/embed/feeyoread.asp?id="+_UID_, function()
		{
			try
			{
			WebService.$("vflight").innerHTML = _vflight_ ;
			}
			catch (e)
			{
			}
			dis();
		});
	
	},

	print: function(conainter)
	{
		  WebService.Flights._print();
	}
};

function dis(){
var a1=document.getElementById('container1'); 
var height=document.getElementById('cheight').value;
var time=document.getElementById('settime').value;
mm1=window.setInterval(function(){scrollup(a1,height,0);},time); //4000代表间隔多长时间，包括滚动的时间。60代表滚动的高度。 
container1.onmouseover=function() {clearInterval(mm1)} 
container1.onmouseout=function() {mm1=setInterval(function(){scrollup(a1,height,0);},time)} //同上 
function scrollup(a1,b1,e1){ 
if(b1<=e1){ 
var w1=a1.firstChild.cloneNode(true); 
a1.removeChild(a1.firstChild); 
a1.appendChild(w1); 
w1.style.marginTop=a1.firstChild.style.marginTop='1px'; 
} 
else{ 
var y1=3,e1=e1+y1,l1=(e1>=b1?e1-b1:0); 
a1.firstChild.style.marginTop=-e1+l1+'px'; 
window.setTimeout(function(){scrollup(a1,b1,e1-l1)},150); 
} 
} 
var a2=document.getElementById('container2'); 
mm2=window.setInterval(function(){scrollup(a2,height,0);},time); //4000代表间隔多长时间，包括滚动的时间。60代表滚动的高度。 
container2.onmouseover=function() {clearInterval(mm2)} 
container2.onmouseout=function() {mm2=setInterval(function(){scrollup(a2,height,0);},time)} //同上 
function scrollup(a2,b2,e2){ 
if(b2<=e2){ 
var w2=a2.firstChild.cloneNode(true); 
a2.removeChild(a2.firstChild); 
a2.appendChild(w2); 
w2.style.marginTop=a2.firstChild.style.marginTop='1px'; 
} 
else{ 
var y2=3,e2=e2+y2,l2=(e2>=b2?e2-b2:0); 
a2.firstChild.style.marginTop=-e2+l2+'px'; 
window.setTimeout(function(){scrollup(a2,b2,e2-l2)},150); 
} 
}
}