function imprimir()
	{
	  var texto;
	  var textoImprimible;
	  var inicioImprimir;
	  var finImprimir;
	  texto = document.body.innerHTML;
	  inicioImprimir = texto.indexOf("<!-- Begin Print -->");
	  finImprimir = texto.indexOf("<!-- End Print -->");
	  textoImprimible = texto.substring(inicioImprimir, finImprimir);
	  window.getSource.txtImprimible.value = textoImprimible;
	  window.getSource.action="/imprimir.aspx";
	  window.getSource.submit();
	}
	
function pagInicio(urlInicio)
	{
  	  var texto;
	  var posBarra;

	  textoUrl = location.href;
	  textoUrl = textoUrl.replace("http://", "**");
	  posBarra = textoUrl.indexOf("/");
	  textoUrl = textoUrl.substring(0, posBarra)
	  textoUrl = textoUrl.replace("**", "http://");
	  urlInicio.style.behavior="url(#default#homepage)";
	  urlInicio.setHomePage(textoUrl);
	}
	
	function EnviarCorreo()
	{
	  texto = location.href;
	  window.open('send.aspx?SubjectMail='+ URLEncodeClient(SubjectMail) + '&texto=' + URLEncodeClient(texto),'Send_to_a_friend' ,'resizable=no,width=296,height=368,left=0, top=0');
	}

function showPics(picnum, ht) {
document.images['imgallery'].src = document.imgarray[picnum].scr;
document.images['imgallery'].height = ht;
}

function goDomain(domain, tld)
{
	if (domain.value != null & domain.value != "")
		location.href = 'domains.aspx?domain=' + domain.value + '&tld=' + tld.value;
		else
		{
		alert("Please specify domain name");
		domain.focus();
		}
}

shown=''
function OpenFile(url) 
{
	if( shown=='' || shown.closed) 
	{
		shown=window.open(url,'OpenFile','scrollbars=no,status=no, high,width=350,height=300');
	}
	else
	{ 
		shown.close();
		shown=window.open(url,'OpenFile','scrollbars=no,status=no, high,width=350,height=300');
	}
}

function getEmailAdd()
{
	var emailadd = window.prompt("What is your E-mail address", "");
	if (emailadd)
	{
		if (emailadd.lastIndexOf("@") < 1 || emailadd.lastIndexOf(".") < 1)
		{
			alert("not a valid email address");
			getEmailAdd();
		}
		else
		{
			document.all.HiddenEmailAdd.value = emailadd;
			document.all.HiddenLocation.value = location.href;
			alert(location.href);
			alert(document.all.HiddenEmailAdd.value);
			document.forms[0].submit();
		}
	}
}

function enabledisableorderaddress()
{
	document.all.TextBoxAddress1.disabled = document.all.CheckBox1.checked;
	document.all.TextBoxCity.disabled = document.all.CheckBox1.checked;
	document.all.TextBoxState.disabled = document.all.CheckBox1.checked;
	document.all.TextBoxPostCode.disabled = document.all.CheckBox1.checked;
	document.all.DropDownListCountry.disabled = document.all.CheckBox1.checked;
}

function popUp(targetname, height, width) 
{
	var mysql="";
	var pPage="";	
	var fullURL = document.location;
	var textURL = fullURL.toString();
	var URLlen = textURL.length;
	var lenMinusPage = textURL.lastIndexOf("/");
	lenMinusPage += 1;
	var fullPath = textURL.substring(0,lenMinusPage);
 
	pickWin = window.open('','pickWin','height='+height+',width='+width+',menubar=no,scrollbars=no,scrollbars=no,statusbar=no,toolbar=no');
	pickWin.location.href = fullPath + targetname;
	pickWin.focus();
}

function showPicture(picturepath)
{
	var pPage= "xxphoto.aspx";
	var picturename = picturepath
 
	pickWin = window.open('','pickWin','height=540,width=670,menubar=no,scrollbars=yes,scrollbars=yes,statusbar=no,toolbar=no');
	figDoc= pickWin.document;
	zhtm= '<HTML><HEAD><TITLE>Northeast ChronicleŽ' + picturename + '</TITLE>';
	zhtm += '</head>';
	zhtm += '<BODY>';
	zhtm += '<form name="pickForm" method="post" action="xxphoto.aspx">';
	zhtm += '<input type="hidden" name="newscode" value="' + document.all.HiddenNewsCode.value + '">';	
	zhtm += '<input type="hidden" name="picturename" value="' + picturename + '">';	
	zhtm += '<input type="hidden" name="newstitle" value="' + document.all.TDNewTitle.innerText + '">';	
	
	zhtm += '</form>';
	zhtm += '</BODY></HTML>';
	window.pickWin.document.write(zhtm);
	window.pickWin.document.close();
	pickWin.document.pickForm.submit();
	pickWin.focus();
}

function showPicture2(picturepath, width, height)
{
	var pPage= "xxphoto.aspx";
	var picturename = picturepath;
	pickWin = window.open('','pickWin','height='+ height + ',width=' + width + ',menubar=no,scrollbars=yes,scrollbars=yes,statusbar=no,toolbar=no');
	figDoc= pickWin.document;
	zhtm= '<HTML><HEAD><TITLE>Durubata Hosting OnlineŽ' + picturename + '</TITLE>';
	zhtm += '<LINK href="style.css" type="text/css" rel="stylesheet">';	
	zhtm += '</head>';
	zhtm += '<BODY>';
	zhtm += '<IMG src=' + picturepath + '>';
	zhtm += '</BODY></HTML>';
	window.pickWin.document.write(zhtm);
	window.pickWin.document.close();
	pickWin.focus();
}


function showHideOthers(sourceelement, targetelement)
{
	if (sourceelement.value == "Others")
		targetelement.style.visibility = 'visible';
	else
		targetelement.style.visibility = 'hidden';
}

function showHideControl(chk, tcontrol)
{
	if (chk.checked)
		tcontrol.style.visibility = 'visible';
	else
		tcontrol.style.visibility = 'hidden';
}

function setProduct(txt)
{
	alert("this is it");
	//alert(txt[txt.selectedIndex].text + " " + txt.value);
}

function enableDisableControl(chk, tcontrol)
{
	if (chk.checked)
		tcontrol.disabled = false;
	else
		tcontrol.disabled = true;
}

function showPicturePreview(file,txt)
{
	var filepath = file.value;
	var img = "";
	
	if (filepath.length < 4)
		img = "No picture selected";
	else
		img = "<img src='" + file.value + "'id='imgprv' width='175' name='imgprv'>";
	
	document.all.TDPicturePreview.innerHTML = img;
	
	if (txt == "")
		txt = "No caption specified";

	document.all.TDCaption.innerHTML = txt;
}


//macromedia scripts
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
