

function getSize() {

  var myWidth = 0, myHeight = 0;

  if( typeof( window.innerWidth ) == 'number' ) {

    //Non-IE

    myWidth = window.innerWidth;

    myHeight = window.innerHeight;

  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {

    //IE 6+ in 'standards compliant mode'

    myWidth = document.documentElement.clientWidth;

    myHeight = document.documentElement.clientHeight;

  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {

    //IE 4 compatible

    myWidth = document.body.clientWidth;

    myHeight = document.body.clientHeight;

  }

  return [ myWidth, myHeight ]

}



function getScrollXY() {

  var scrOfX = 0, scrOfY = 0;

  if( typeof( window.pageYOffset ) == 'number' ) {

    //Netscape compliant

    scrOfY = window.pageYOffset;

    scrOfX = window.pageXOffset;

  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {

    //DOM compliant

    scrOfY = document.body.scrollTop;

    scrOfX = document.body.scrollLeft;

  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {

    //IE6 standards compliant mode

    scrOfY = document.documentElement.scrollTop;

    scrOfX = document.documentElement.scrollLeft;

  }

  return [ scrOfX, scrOfY ];

}



function lib_bwcheck(){ //Browsercheck (needed)

	this.ver=navigator.appVersion; this.agent=navigator.userAgent;

	this.dom=document.getElementById?1:0;

	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;

	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;

	this.ie7=(this.ver.indexOf("MSIE 7")>-1 && this.dom)?1:0;

	this.ie4=(document.all && !this.dom)?1:0;

	this.ie=this.ie4||this.ie5||this.ie6||this.ie7;

	this.mac=this.agent.indexOf("Mac")>-1;

	this.opera5=this.agent.indexOf("Opera 5")>-1;

	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;

	this.ns4=(document.layers && !this.dom)?1:0;

	this.ns=this.ns4||this.ns6;

	this.bw=(this.ie7 ||this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5 || this.dom);

	return this;

}

var bw=new lib_bwcheck();



function popw(url){	

	var sz = getSize();
	
	var scrol = getScrollXY();
	var wnd = document.getElementById('datadiv');
	
	var iex = 0;
	if ( bw.ie ) { iex = 300; }
	
	//wnd.style.left = (sz[0] - 828 ) / 2 + iex + 'px';
	//wnd.style.left =  parseInt( ((sz[0])/2) - (img_width/ 2) )  + 'px';
	
	
	wnd.style.visibility = "visible";
	
	wnd.innerHTML="<table align='center' style='border:1px solid #5a9afa;' cellpadding='0' cellspacing='0' bgcolor='#ffffff'><tr><td height='23' class='pop_title' align='left'>IMTour.bg</td><td class='close' align='right'><a href='javascript:void(0)' onclick='return au();' style='margin-right:5px;'>close</a></td><td class='close' width='12' align='right'><a href='javascript:void(0)' onclick='return au();'><img align='bottom' src='images/close.gif' border='0' alt='close'></a></td></tr><tr><td colspan='3'><img src='"+url+"' border=0 alt='Inner1'></td></tr></table>";
	//wnd.style.top = (sz[1] ) / 4 + scrol[1] + 'px';
	wnd.style.top =  scrol[1] + 50 + 'px';
	
}

	

	

function au(){

	document.getElementById('datadiv').style.visibility = "hidden";

	document.getElementById('datadiv').innerHTML="";

	return true;

	

}





