
var isDOM = (document.getElementById ? true : false);
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);
var isNS = navigator.appName == "Netscape";
function getRef(id) {
 if (isDOM) return document.getElementById(id);
 if (isIE4) return document.all[id];
 if (isNS4) return document.layers[id];
}


function b_show_menu()
{ 
  if(active<-1) active=-1;
  if(active>m_l) active=m_l;
for(var i=1; i<=m_l; i++) 
   { 
	if((getRef(i).className == "menuHover")&&!(i==active))
	{
     getRef(i).className = "menuNormal"; 
     getRef("sm"+i).className = "menuNormal"; 
	}
	if(!(i==active))
	{
	   if(i==1) {getRef("m_border_right").className="m_right_on"}
	   if(i==m_l) {getRef("m_border_left").className="m_left_on"}

	}

	if((i==active)&&!(active==-1))
	 { 
   	   getRef(i).className = "menuHover"; 
       getRef("sm"+i).className = "menuHover"; 
       if(active==1) {getRef("m_border_right").className="m_right_off"}
       if(active==m_l) {getRef("m_border_left").className="m_left_off"}

	} 
	
  if(!(s_active==-1)) {   getRef("sml"+active+s_active).className = "menuitemactive"; }

  }

}



function b_expand(s)
{

 curent=s.id;
  if(active<-1) active=-1;
  if(active>m_l) active=m_l;
for(var i=1; i<=m_l; i++) 
   { 
	if((getRef(i).className == "menuHover")&&!(i==curent)&&!(i==active))
	{
     getRef(i).className = "menuNormal"; 
     getRef("sm"+i).className = "menuNormal"; 
	}
	if(!(i==active)&&!(i==curent))
	{
	   if(i==1) {getRef("m_border_right").className="m_right_on"}
	   if(i==m_l) {getRef("m_border_left").className="m_left_on"}

		}
	if(i==curent)
	 {
	  if(!(active==-1)) {getRef("sm"+active).className = "menuNormal";}
	  getRef(i).className = "menuHover"; 
	  getRef("sm"+i).className = "menuHover"; 
	   if(curent==1) {getRef("m_border_right").className="m_right_off"}
	   if(curent==m_l) {getRef("m_border_left").className="m_left_off"}
	} 

	if((i==active)&&!(active==-1))
	 { 
   	   getRef(i).className = "menuHover"; 
	   if(active==1) {getRef("m_border_right").className="m_right_off"}
	   if(active==m_l) {getRef("m_border_left").className="m_left_off"}
	} 
  }
}

function b_collapse()
{ 
	for(var i=1; i<=m_l; i++) 
	{
	   if((getRef(i).className == "menuHover")&&!(i==active))
		{
		 getRef(i).className = "menuNormal"; 
		 getRef("sm"+i).className = "menuNormal"; 

		   if(i==1) {getRef("m_border_right").className="m_right_on"}
		   if(i==m_l) {getRef("m_border_left").className="m_left_on"}
		}
		
       if((i==active)&&!(active==-1))
		 { 
		  getRef(i).className = "menuHover"; 
		  getRef("sm"+i).className = "menuHover"; 
		   if(i==1) {getRef("m_border_right").className="m_right_off"}
		   if(i==m_l) {getRef("m_border_left").className="m_left_off"}
		} 
  	}
}


var pred_country_id=null;
var qpred_country_id=null;

function ShowPhone(country_id) {

	if (pred_country_id) {
		elements= getRef(pred_country_id);	
		if (elements) elements.className='hide_table';
	}
	pred_country_id=country_id;
	
	elements= getRef(country_id);
	if (elements) elements.className='showtable';
}

function ShowCountry(country_id) 
{

	if (pred_country_id) {
		elements= getRef("row_"+pred_country_id);	
		if (elements) elements.className='hide_table';
	}
	pred_country_id=country_id;
	
	elements= getRef("row_"+country_id);
	if (elements) elements.className='show_table_roaming';
}

function qShowCountry(country_id) 
{

	if (qpred_country_id) {
		elements= getRef("row_"+qpred_country_id);	
		if (elements) elements.className='hide_table';
	}
	qpred_country_id=country_id;
	
	elements= getRef("row_"+country_id);
	if (elements) elements.className='show_table_roaming';
}


function detalii(d_id)
{ 
 if(getRef(d_id).className=='hide_table')
 getRef(d_id).className='showtable'; else getRef(d_id).className='hide_table';
   
}


function wopen(id)
{
	window.open("?c="+id+"&sc=-1","_self"); 
} 
function b_wopen(id)
{
	window.open("?p=2&c="+id+"&sc=-1","_self"); 
} 

function show_phone(id)
{
	getRef(id).className="showtable";	
}

function f_submit(name)
{	getRef(name).submit();
}
var promo_first=0;
var nr=0;
var t;

function promo_change(banners)
{ 	if(nr==0) nr=banners;

	 for(var i=1; i<=nr; i++)
	 {
		if(i<nr)
		{
			if(getRef("promo_"+i).className=='showtable')
			{
				if(getRef("promo_"+i)) getRef("promo_"+i).className='hide_table';
				if(getRef("promo_"+(i+1))) getRef("promo_"+(i+1)).className='showtable';
		
				getRef("nav"+i).src='images/nav.gif';
				getRef("nav"+(i+1)).src='images/nav_active.gif';
				break;
			}
		} else if(i==nr)
		{
			if(getRef("promo_"+i).className=='showtable')
			{
				if(getRef("promo_"+i)) getRef("promo_"+i).className='hide_table';
				if(getRef("promo_"+1)) getRef("promo_"+1).className='showtable';
		
				getRef("nav"+i).src='images/nav.gif';
				getRef("nav"+1).src='images/nav_active.gif';
				break;
			}
		}
	 }

	if(promo_first==0)
		{
			if(getRef("promo_1")) getRef("promo_1").className='showtable';
			getRef("nav1").src='images/nav_active.gif';
			promo_first=1;
		}
 
	 
}

function promo_change_back(banners)
{ 	if(nr==0) nr=banners;

	 for(var i=1; i<=nr; i++)
	 {
		if(i>1)
		{
			if(getRef("promo_"+i).className=='showtable')
			{
				if(getRef("promo_"+i)) getRef("promo_"+i).className='hide_table';
				if(getRef("promo_"+(i-1))) getRef("promo_"+(i-1)).className='showtable';
		
				getRef("nav"+i).src='images/nav.gif';
				getRef("nav"+(i-1)).src='images/nav_active.gif';
				break;
			}
		} else if(i==1)
		{
			if(getRef("promo_"+i).className=='showtable')
			{
				if(getRef("promo_"+i)) getRef("promo_"+i).className='hide_table';
				if(getRef("promo_"+nr)) getRef("promo_"+nr).className='showtable';
		
				getRef("nav"+i).src='images/nav.gif';
				getRef("nav"+nr).src='images/nav_active.gif';
				break;
			}
		}
	 }

 
}



function timedCount(banners)
{

promo_change(banners);

t=setTimeout("timedCount()",15000);

}


function autofitIframe(id){
if (getRef(id)&&isNS)
parent.getRef(id).style.height=this.document.body.scrollHeight+"px";
else if (getRef(id)) parent.getRef(id).style.height=this.document.body.offsetHeight+"px";
}

function xmas_change()
{
	getRef("xmas").className='hide_table';
	getRef("noxmas").className='showtable';
	}