function openchat_1(chaturl)
{
	window.open(chaturl+"&from_page=menu","","width=500,height=380,location=0,menubar=0,hotkeys=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,left="+(screen.width/2-350)+",top="+(screen.height/2-250)+",ScreenX=100,ScreenY=30");
}

function popupWindow(url)
{
	window.open(url,'Big_Picture','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,innerWidth=640,innerHeight=480,screenX=150,screenY=150,top=150,left=150')
}

function Is ()
{
	var agt = navigator.userAgent.toLowerCase();

	this.created = true;

	this.major = parseInt(navigator.appVersion);
	this.minor = parseFloat(navigator.appVersion);

	this.nav = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1)));
	this.nav2 = (this.nav && (this.major == 2));
	this.nav3 = (this.nav && (this.major == 3));
	this.nav4 = (this.nav && (this.major == 4));

	//Netscape 6
	this.nav5 = (this.nav && (this.major == 5));
	this.nav6 = (this.nav && (this.major == 5));
	this.gecko = (this.nav && (this.major >= 5));

	this.ie	= (agt.indexOf('msie') != -1);
	this.ie3 = (this.ie && (this.major == 3));
	this.ie4 = (this.ie && (this.major == 4));
	this.ie5 = (this.ie && (this.major == 5));

	this.opera = (agt.indexOf('opera') != -1);

	this.nav4up = this.nav && (this.major >= 4);
	this.ie4up = this.ie  && (this.major >= 4);
}
var is = new Is();

var loaded = 1;

function showpic(lay)
{
	if(loaded == 0)return false;

	if(is.ie4up) document.all(lay).style.visibility = 'visible';

	else if(is.gecko || is.opera) document.getElementById(lay).style.visibility = 'visible';

	// else document.layers[lay].visibility='show';

	return true;
}

function hidepic(lay)
{
	if(loaded==0)return false;

	if(is.ie4up) document.all(lay).style.visibility = 'hidden';

	else if(is.gecko || is.opera) document.getElementById(lay).style.visibility = 'hidden';

	// else document.layers[lay].visibility='hide';

	return true;
}

function visibility_switch(id) {	if(is.ie4up){		if (document.all(id).style.visibility == 'visible') {hidepic(id);}
		else {showpic(id);}
	} else if(is.gecko || is.opera) {		if (document.getElementById(id).style.visibility == 'visible') {hidepic(id);}
		else {showpic(id);}
	}
}


function bookmark(q,w, a)
{
//	if (window.sidebar)	{ window.sidebar.addPanel("- IBuy.com.ua", "http://ibuy.com.ua",""); }
//	else if (document.all) { window.external.AddFavorite("http://ibuy.com.ua", "- IBuy.com.ua"); }
	if(is.ie4up){
		window.external.AddFavorite(q, w);
	} else if (is.gecko) {
		window.sidebar.addPanel(w, q,"");
	} else if (is.opera){		a.href = q; a.rel = "sidebar"; a.title = w; return true;
	} else {alert('Пожалуйста, используйте комбинацию Ctrl+D');}
}

function show(element,owner)
{
	var obj = document.getElementById(element);
	var obj2 = document.getElementById(owner);

	if (navigator.appName == "Microsoft Internet Explorer")
	{
		if (navigator.appVersion.indexOf('MSIE 7.0') == -1)
		{
			obj.style.top = obj2.offsetTop + 104 + "px";
		}
		else
		{
			obj.style.top = obj2.offsetTop + 101 + "px";
		}
	}
	else
	{
		obj.style.top = obj2.offsetTop + 24 + "px";
	}

	obj.style.visibility = 'visible';
}

function hide(element)
{
	var obj = document.getElementById(element);
	obj.style.visibility = 'hidden';
}

function operator(id)
{
	window.open("http://ibuy.com.ua/statistic/call_operator.php?id="+id+"","ICQ_консультант","menubar=no,width=400,height=160,left=100,top=100,toolbar=no");
}

function image_change(name) {
	document.getElementById('mage_150_main').src='/picture/300/'+name;
	
}