// JavaScript Document
function sitebookmark(url,title){
	if (document.all)
		window.external.AddFavorite(url, title);
	else if (window.sidebar)
		window.sidebar.addPanel(title, url, "")
}

function setAsHomePage(){
		this.style.behavior='url(#default#homepage)';
		this.setHomePage('http://mytech.bg');
}

function disableForm(element_id){
	var thebutton = document.getElementById(element_id);
	thebutton.disabled = true;
	thebutton.value = "loading ... ";
	return true;
}

var all_messages = Array();

function spin( obj )
{
  close_all(obj);
  var spinner_content = document.getElementById( obj+"_body" );

  if ( spinner_content.style.visibility == 'visible' )
  {
		spinner_content.style.visibility = 'hidden';
		spinner_content.style.display = 'none';
		spinner_content.style.height = '0px';
		spinner_content.style.margin = '0px';
  }
  else
  {
		spinner_content.style.display = 'block';
		spinner_content.style.visibility = 'visible';
		spinner_content.style.height = 'auto';
  }
}

function close_all(element)
{
		for(i=0; i < all_messages.length; i++)
		{
				if(element != all_messages[i])
				{
						var spinner_content = document.getElementById( all_messages[i]+"_body" );
						spinner_content.style.visibility = 'hidden';
						spinner_content.style.display = 'none';
						spinner_content.style.height = '0px';
						spinner_content.style.margin = '0px';
				}
		}
}

/* used for comment and send to friend */
function add_message(message_id)
{
		all_messages.push(message_id);
}

function makeHower(id, color_wish){
	document.getElementById(id+"_1").style.backgroundColor= color_wish;
	document.getElementById(id+"_2").style.backgroundColor= color_wish;
	document.getElementById(id+"_3").style.backgroundColor= color_wish;
	document.getElementById(id+"_5").style.backgroundColor= color_wish;
}

function makeHower_main(id, color_wish){
	document.getElementById(id+"_1").style.backgroundColor= color_wish;
	document.getElementById(id+"_2").style.backgroundColor= color_wish;
	document.getElementById(id+"_3").style.backgroundColor= color_wish;
	document.getElementById(id+"_4").style.backgroundColor= color_wish;
}

function makeOneHower(id, color_wish){
	document.getElementById(id).style.backgroundColor= color_wish;
}

function showvipblock(sel_e){
	var vblock7 = document.getElementById( "vipblock7" );
	var vblock14 = document.getElementById( "vipblock14" );
	
	vblock7.style.visibility = 'hidden';
	vblock7.style.display = 'none';
	vblock7.style.height = '0px';
	vblock7.style.margin = '0px';
	vblock14.style.visibility = 'hidden';
	vblock14.style.display = 'none';
	vblock14.style.height = '0px';
	vblock14.style.margin = '0px';
	
	if(sel_e == 'p7'){
		vblock7.style.display = 'block';
		vblock7.style.visibility = 'visible';
		vblock7.style.height = 'auto';
	}
	
	if(sel_e == 'p14'){
		vblock14.style.display = 'block';
		vblock14.style.visibility = 'visible';
		vblock14.style.height = 'auto';
	}
}

function o_load()
{
	init();
}