<!--

function hide_text(lmnt,txt)
{
	if(lmnt.value == txt)
	{
		lmnt.value = "";
		lmnt.focus();
	}
}

function show_text(lmnt,txt)
{
	if(lmnt.value == "")
	{
		lmnt.value = txt;
	}
}

function gotoURL()
{
	if(document.tpcs.sel_topic[document.tpcs.sel_topic.selectedIndex].value != "")
	{
		window.location = document.tpcs.sel_topic[document.tpcs.sel_topic.selectedIndex].value;
	}
}

function gotoArticle()
{
	if(document.browse_articles.articles[document.browse_articles.articles.selectedIndex].value != "")
	{
		window.location = document.browse_articles.articles[document.browse_articles.articles.selectedIndex].value;
	}
}

function gotoTopic()
{
	if(document.select_topic.sel_topic[document.select_topic.sel_topic.selectedIndex].value != "")
	{
		window.location = document.select_topic.sel_topic[document.select_topic.sel_topic.selectedIndex].value;
	}
}

function insert_price()
{
	if(document.remoteadd.price[document.remoteadd.price.selectedIndex].value != "")
	{
		if(document.remoteadd.price[document.remoteadd.price.selectedIndex].text == "Preview")
		{
			document.getElementById('the_price').innerHTML = document.remoteadd.price[document.remoteadd.price.selectedIndex].value;
		}
		else
		{
			document.getElementById('the_price').innerHTML = "$" + document.remoteadd.price[document.remoteadd.price.selectedIndex].value;
			// document.order_prod.custom2.value = "( " + document.remoteadd.price[document.remoteadd.price.selectedIndex].text + " )";
		}
	}
	else
	{
		document.getElementById('the_price').innerHTML = "";
	}
}

// Form validator function

function form_validator(theForm)
{
	if (theForm.price[theForm.price.selectedIndex].value == "")
	{
		alert("Please choose pricing.");
		return (false);
	}
}

function openAnyWindow(url, name) {
  var l = openAnyWindow.arguments.length;
  var w = "";
  var h = "";
  var features = "";

  for (i=2; i<l; i++) {
    var param = openAnyWindow.arguments[i];
    if ( (parseInt(param) == 0) || (isNaN(parseInt(param))) ) {
      features += param + ',';
    } else {
      (w == "") ? w = "width=" + param + "," :
        h = "height=" + param;
    }
  }

  features += w + h;
  var code = "popupWin = window.open(url, name";
  if (l > 2) code += ", '" + features;
  code += "')";
  eval(code);
}

function hide_tabs(total)
{
	for(i = 1; i <= total; i++)
	{
		var lmnt = "tab" + i;
		document.getElementById(lmnt).style.display = 'none';
	}
}

function reset_style_tabs(total)
{
	for(i = 1; i <= total; i++)
	{
		var lmnt = "ltab" + i;
		document.getElementById(lmnt).style.fontWeight = 'normal';
		document.getElementById(lmnt).style.border = 'none';
		document.getElementById(lmnt).style.padding = '2px 5px';
	}
}

function show_tabs(lmnt,total)
{
	hide_tabs(total);
	reset_style_tabs(total);
	var lmnt2 = "l" + lmnt;
	document.getElementById(lmnt).style.display = 'block';
	document.getElementById(lmnt2).style.fontWeight = 'bold';
	document.getElementById(lmnt2).style.border = '1px solid #4e9a06';
	document.getElementById(lmnt2).style.padding = '2px 5px';
}

//Author: Krasimir Makaveev | kmakaveev@yahoo.com | 2003
//
//This script opens a new blank window in the center of the screen. First we must solve really important problem...
//
//For NN the position of the browser's window on the screen depends on "screenX" and "screenY" attributes.
//For IE the position of the browser's window on the screen depends on "top" and "left" attributes.
//Using a "browser-detection"-like function, we first detect the browser and then open the window with the appropriate for the browser attributes.
//So...

function winOpen(winname,w,h)
{
	var sw = screen.width;
	var sh = screen.height;
	
	//Simple mathematical transformations
	var sh_off = (sw - w)/2;
	var sw_off = (sh - h)/2;
	
	if(navigator.appName.indexOf("MSIE"))
	{
		ext_win = window.open("",winname,"toolbar=no,copyhistory=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizeable=no,top="+sw_off+",left="+sh_off+",width="+w+",height="+h+"");
		ext_win.focus();
	}
	else
	{
		ext_win = window.open("",winname,"toolbar=no,copyhistory=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizeable=no,screenX="+sw_off+",screenY="+sh_off+",width="+w+",height="+h+"");
		ext_win.focus();
	}
}

//-->