/*******************************
*   20061008_2pages
*   template functions
********************************/

var menu_top_prev = null;
function menu_top_over(obj)
{
	menu_top_prev = obj.className;
	obj.className = "menu_top_selected";
}

function menu_top_out(obj)
{
	obj.className = menu_top_prev;
}

var menu_top2_prev = null;
function menu_top2_over(obj)
{
	menu_top2_prev = obj.className;
	obj.className = "menu_top2_selected";
}
function menu_top2(obj)
{
	obj.className = menu_top2_prev;
}
function menu_top2_out(obj)
{
	obj.className = menu_top2_prev;
}
/**/
function menu_top_over_p(id)
{
	//menu_top_prev_p = obj.className;
	var obj = document.getElementById('menu_td' + id );
	obj.className = "menu_top_p_2_selected";
}
function menu_top2_out_p(id)
{
	var obj = document.getElementById('menu_td' + id );
	obj.className = "menu_top_p_2";
}
function menu_top2_over_p(id)
{
	//menu_top2_prev_p = obj.className;
	var obj = document.getElementById('menu_td' + id );
	obj.className = "menu_top_p_2_selected";
}
function menu_top2_p(id)
{
	var obj = document.getElementById('menu_td' + id );
	obj.className = "menu_top_p_2";
}
/**/

function ImgZoom(url,imgname,w,h){

  w=w+20;

  h=h+40;

  var features='left=0,top=0,resizable=1,menubar=0,location=0,status=0,toolbar=0';

  wm=window.screen.width-10;hm=window.screen.height-60;

  if(w>wm || h>hm){features=features+',scrollbars=1';}else{features=features+',scrollbars=0';}

  if(w>wm){features=features+',width='+wm;}else{features=features+',width='+w;}

  if(h>hm){features=features+',height='+hm;}else{features=features+',height='+h;}

  window.open(url,imgname,features,true);

}



// ??? ?????? ??? popunder
/*
function delaybanner(){

	if (timerID) clearTimeout(timerID);

	self.focus();

}



function pup(Url,width,height){

	if (width!=''){

		test_width=parseInt(width);

		if (isNaN(test_width)) width=240;

	}else{

		width=240;

	}

	if (height!=''){

		test_height=parseInt(height);

		if (isNaN(test_height)) height=400;

	}else{

		height=400;

	}



	if (self.screen) {

        width = screen.width-10;

        height = screen.height-60;

	}

	open(Url, 'popup', 'titlebar=no,height='+height+',width='+width+',scrollbars=no');

	timerID=setTimeout('delaybanner()',3000);

}

// ??? ?????? ??? popunder    :END

 */


/*
function ShowHideElement(name, sender)

{

	var obj = document.getElementById(name);

	if(obj.style.display == "none")

		obj.style.display = "block";

	else

		obj.style.display = "none";

}

*/

// Change object size

// cmd (1 - Increase, 2 - Decrease)

// direction (1 - width, 2 - height, 3 - both)

// pref - preffix for the cookies

// obj - object

/*
function FrmChangeSize(cmd, direction, pref, obj, step, minw, maxw, minh, maxh)

{

	if(!(cmd==1 || cmd==2)) return false;

	if(!(direction==1 || direction==2 || direction==3) ) return false;

	if(!step) step=50;

	if(!minh || !minw || !maxh || !maxw) return false;

	var obj = document.getElementById(obj);

	if(!obj) return false;

	if(!pref) pref = "pref_";



	var w=parseInt(obj.style.width);

	var h=parseInt(obj.style.height);



	if(cmd==1)

	{

		if( (direction == 1) || (direction == 3) )

		{

			if( (w + step) <= maxw ) w = w + step;

		}

		if( (direction == 2) || (direction == 3) )

		{

			if( (h + step) <= maxh ) h = h + step;

		}

	}

	if(cmd==2)

	{

		if( (direction == 1) || (direction == 3) )

		{

			if( (w - step) >= minw ) w = w - step;

		}

		if( (direction == 2) || (direction == 3) )

		{

			if( (h - step) >= minh ) h = h - step;

		}

	}



	obj.style.width = w+'px';

	obj.style.height = h+'px';

	var expDate = new Date;

	expDate.setTime (expDate.getTime() + (600*24*60*60*1000));

	SetCookie(pref + "w", w, expDate, "/");

	SetCookie(pref + "h", h, expDate, "/");

}

*/


/*
function SetCookie(name,value,expires,path,domain,secure) {

	document.cookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : "");

}  */

