

function MainTab(id, name, title, freeTitle, imgNormal, imgOver, buttonLabel) {
	this.id = id;
	this.name = name;
	this.title = title;
	this.freeTitle = freeTitle;
	this.imgNormal = imgNormal;
	this.imgOver = imgOver;
	this.buttonLabel = buttonLabel;
	this.state = 'd';
}

MainTab.prototype.getTitle = function() {
	return this.title; //isLogged ? this.title : this.freeTitle;
}



function hideMessage() {
	getelem('msg').style.display='none';
}

function toggleContacts(which) {
	var n = which + '_contacts';
	var e = getelem(n);
	if (e.style.visibility == 'hidden') {
		e.style.visibility = 'visible';
	}
	else {
		e.style.visibility = 'hidden';
	}
}

function selectContact(which,cphone,cname) {
	clearValues();
	toggleContacts(which);

	var f = document.forms['ff'];
	f[which].value = '+' + cphone;
	var e = $(which+'_name');
	if (e) {
		e.innerHTML = '<b>' + cname + '</b>';
	}
}

function mo(e,imgname) {
	$('myimg').src = 'templates/shop/images/' + imgname + '.jpg';
	e.className = 'hi';
}

function mx(e) {
	e.className = '';
}

function cfp() {
	var t1 = $('logoimg').src;
	var t2 = window.location.href;
	var s = $('logohref').innerHTML;
	var s1 = '=\"' + cmpbase;
	var s2 = '=\'' + cmpbase;

	if (t1.indexOf(cmpbase)!=0 || t2.indexOf(cmpbase)!=0 || (s.indexOf(s1) < 0 && s.indexOf(s2) < 0) ) {
//alert('t1='+t1+'\nt2='+t2+'\ncmpbase='+cmpbase);
		setTimeout('getout(\"'+cmpbase+'\")',2000);
		cmpbase=false;
	}
}

function getout(url) {
	var t = 'Please, go to ' + url + ' directly.\nThank you!';
	alert(t);
/*	var t = '<'; t+='bo'; t+='dy><pre>'+t;

	if (window.document.documentElement) {
		window.document.documentElement.innerHTML = t;
	}
	else if (window.document.body) {
		window.document.body.innerHTML = t;
	}
	else if (document.getElementsByTagName('html')[0]) {
		document.getElementsByTagName('html')[0] = t;
	}
*/
	window.location.href = url;
}
