function TrixTG_lineheightchange(id,start,end)
{
	var tempheight = document.getElementById("TrixTG_"+id+"lineheight").value;
	tempheight = tempheight.replace(/[^0-9]/g,'');
	document.getElementById("TrixTG_"+id+"lineheight").value= tempheight;
	tempheight = (tempheight!='')?tempheight+"%":"";
	for(i=start;i<=end;i++)
	   document.getElementById("TrixTGP_"+id+TrixTG_count[i]).style.lineHeight = tempheight;	   
}
function TrixTG_letterspacingchange(id,start,end)
{
	var letterspacing = document.getElementById("TrixTG_"+id+"letterspacing").value;
	letterspacing = letterspacing.replace(/[^0-9]/g,'');
	document.getElementById("TrixTG_"+id+"letterspacing").value= letterspacing;
	letterspacing = (letterspacing!='')?letterspacing+"pt":"";
	for(i=start;i<=end;i++)
	   document.getElementById("TrixTGP_"+id+TrixTG_count[i]).style.letterSpacing = letterspacing;
}
function TrixTG_backlinkchange()
{
	var temp = document.getElementById("TrixTG_backlink").value;
	if(temp == "remove"){
	   alert("You can also use the hide option, which will not show the link explicitly"); temp = "none";}
	document.getElementById("TrixTGP_backlink").style.display = document.getElementById("TrixTG_backlink").value;
}
function TrixTG_navbarchange()
{
	document.getElementById("TrixTGP_navbar").style.display = document.getElementById("TrixTG_navbar").value;
}
function TrixTG_linkchange(id,start,end,opt)
{
	var temp = new Array("ulink","vlink","mlink"); var tempid,i,topt;var inc=1;var t1,t2,t3,t4,t5;
	var tempcolor = new Array();var tempbold = new Array();var tempitalic = new Array();var tempunderline = new Array();
	var tid = (opt <= 3)? "bodylink":((opt <= 5)?"posthead":((opt <= 7)?"sidebarhead":((opt<=9)?"crosshead":"timeandcomment")));
    if(opt==4 || opt==6 || opt==8 || opt==10)	{opt=1; inc=2;}
	else if(opt==5 || opt==7 || opt==9 || opt==11) {opt=3; inc=2;}
	var tcolor = document.getElementById("TrixTG_"+id+"textcolor").value;
	tcolor = tcolor.replace(/[\n\r\t\ ]/g,'');
	if(tcolor != '')
    {
	 tcolor=tcolor.replace(/[^0-9A-Fa-f]/g,'0');
	 tcolor=TrixTG_hexpat.substr(0,6-tcolor.length)+tcolor; 
    }
    document.getElementById("TrixTG_"+id+"textcolor").value = tcolor; 

	for(i=0;i<3;i=i+inc){	 
	   tempcolor[i]= document.getElementById("TrixTG_"+tid+temp[i]+"textcolor").value;
	   tempcolor[i]=(tempcolor[i]!='')?"#"+tempcolor[i]:'';
	   tempbold[i] = document.getElementById("TrixTG_"+tid+temp[i]+"textbold").value;
	   tempitalic[i] = document.getElementById("TrixTG_"+tid+temp[i]+"textitalic").value;
	   tempunderline[i] = document.getElementById("TrixTG_"+tid+temp[i]+"textunderline").value;}
	   
	for(i=start;i<=end;i++)
	{
		tempid = document.getElementById("TrixTGP_"+tid+TrixTG_count[i]);
		
		t1 = (tempcolor[2]!='')?"this.style.color='"+tempcolor[2]+"';":"";
		t2 = (tempunderline[2]!='')?"this.style.textDecoration='"+tempunderline[2]+"';":"";
		t3 = (tempbold[2]!='')?"this.style.fontWeight='"+tempbold[2]+"';":"";
		t4 = (tempitalic[2]!='')?"this.style.fontStyle='"+tempitalic[2]+"';":"";

		if(opt == 1 || opt == 2)
        {	
		    tempid.style.color = tempcolor[opt-1]; tempid.style.textDecoration = tempunderline[opt-1];
		    tempid.style.fontWeight = tempbold[opt-1]; tempid.style.fontStyle = tempitalic[opt-1];
		}

		tempid.setAttribute("onMouseOver",t1+t2+t3+t4);
		if(TrixTG_flashid == "TrixTG_flash_IE")
 		   tempid.onmouseover = new Function(tempid.onMouseOver);
		    
		
		 
	   topt = (i>4 && tid=="bodylink")?1:0;
	   tempid.setAttribute("onMouseOut","this.style.color=\""+tempcolor[topt]+"\";this.style.textDecoration =\""+tempunderline[topt]+"\";this.style.fontWeight =\""+tempbold[topt]+"\"; this.style.fontStyle =\""+tempitalic[topt]+"\";");
	   if(TrixTG_flashid == "TrixTG_flash_IE")
 		   tempid.onmouseout = new Function(tempid.onMouseOut);
	}   
}
function TrixTG_texttransformchange(id,start,end)
{ 
    var temp = document.getElementById("TrixTG_"+id+"texttransform").value;
	for(var i=start;i<=end;i++)
	    document.getElementById("TrixTGP_"+id+TrixTG_count[i]).style.textTransform = temp;
}
function TrixTG_menulinksettingschange(id)
{
  var i,tempid;
  var tempbg = TrixTG_returnmenubgvals("menulink");
  var tempbgm = TrixTG_returnmenubgvals("menulinkm");
  var tempborder = TrixTG_returnmenubordervals("menulink");
  var tempborderm = TrixTG_returnmenubordervals("menulinkm");
  var tempcolor = document.getElementById("TrixTG_menulinktextcolor").value;
  var tempcolorm = document.getElementById("TrixTG_menulinkmtextcolor").value;
  var tempborderradius = document.getElementById("TrixTG_menulinkborderradius").value+"px";
  
  tempcolorm = (tempcolorm=="")?"":"this.style.color='#"+tempcolorm+"'";  
  if(tempcolor!="")
  {
    for(i=1;i<=10;i++)
      document.getElementById("TrixTGP_menulink"+i).style.color = "#"+tempcolor;
    tempcolor = "this.style.color='#"+tempcolor+"'";
  }
  else 
  {
      for(i=1;i<=10;i++)
         document.getElementById("TrixTGP_menulink"+i).style.color = "";
	    tempcolor = "this.style.color=''";
  }

 
  if(id!="menulink")
    for(i=1;i<=10;i++)
	{
	  document.getElementById("TrixTGP_menulink"+i).setAttribute("onMouseOver",tempbgm+tempborderm+tempcolorm);
	   if(TrixTG_flashid == "TrixTG_flash_IE")
 		   document.getElementById("TrixTGP_menulink"+i).onmouseover = new Function(document.getElementById("TrixTGP_menulink"+i).onMouseOver);
	}
																 
  for(i=1;i<=10;i++)
  {
	tempid = document.getElementById("TrixTGP_menulink"+i);
	tempid.setAttribute("onMouseOut",tempbg+tempborder+tempcolor);
	if(TrixTG_flashid == "TrixTG_flash_IE")
 		   tempid.onmouseout = new Function(tempid.onMouseOut);
	tempid.style.MozBorderRadius= tempborderradius; 
	tempid.style.WebkitBorderRadius= tempborderradius;
  }     
}
function TrixTG_menuborderchange(id)
{
  var tempborderradius = document.getElementById("TrixTG_"+id+"borderradius").value;
  if(id=="menulink")
     document.getElementById("TrixTG_menulinkmborderradius").value = tempborderradius;
  else if(id=="menulinkm")
     document.getElementById("TrixTG_menulinkborderradius").value = tempborderradius;
}
function TrixTG_returnmenubgvals(id)
{
  var tempcolor = document.getElementById("TrixTG_"+id+"bgcolor").value;
  var tempimage = document.getElementById("TrixTG_"+id+"bgimage").value;
  var temprepeat = document.getElementById("TrixTG_"+id+"bgimagerepeat").value;
  var temppostoptype = document.getElementById("TrixTG_"+id+"bgimagepositiontoptype").value;
  var temppostop = document.getElementById("TrixTG_"+id+"bgimagepositiontop").value + ((temppostoptype=="pixel")?"px ":"% ");
  var tempposlefttype = document.getElementById("TrixTG_"+id+"bgimagepositionlefttype").value;
  var tempposleft = document.getElementById("TrixTG_"+id+"bgimagepositionleft").value+((tempposlefttype=="pixel")?"px ":"% ");
  var tempattachment = document.getElementById("TrixTG_"+id+"bgattachment").value;
  var temp='';
  var tcolor = (id=="menulink")?"transparent":"";
  tempcolor =(tempcolor=='')? tcolor:"#"+tempcolor;
  tempimage =(tempimage=='')?"":" url("+tempimage+") "+temprepeat+" "+tempposleft+temppostop+tempattachment;
  temp = tempcolor + tempimage;

  if(temp!='')
  {
    if(id=="menulink")
      for(i=1;i<=10;i++)
	    document.getElementById("TrixTGP_menulink"+i).style.background = temp;
    temp = "this.style.background ='"+temp+"';";
  }
  return (temp);
}
function TrixTG_returnmenubordervals(id)
{
  var temp1='',temp2='',temp3='',temp4='',tempid;
  if(document.getElementById("TrixTG_"+id+"borderselect").value == "no")
  {
	 if(id=="menulink")
		 	for(i=1;i<=10;i++)
	    	   document.getElementById("TrixTGP_menulink"+i).style.border = "none"; 
     return ("this.style.border='none';");
  }
  else
  {
	 if(TrixTG_bordervar[id][0][2]!=0)
	 {
		 temp1 = TrixTG_bordervar[id][0][2]+"px "+TrixTG_bordervar[id][0][1]+" #"+TrixTG_bordervar[id][0][0];
		 if(id=="menulink")
		 	for(i=1;i<=10;i++)
	    	   document.getElementById("TrixTGP_menulink"+i).style.border = temp1;
   	     return("this.style.border='"+temp1+"';");
	 }
     else if(TrixTG_bordervar[id][1][2]!=0 || TrixTG_bordervar[id][2][2]!=0 || TrixTG_bordervar[id][3][2]!=0 || TrixTG_bordervar[id][4][2]!=0)
	 {
		temp1=TrixTG_bordervar[id][1][2]+"px "+TrixTG_bordervar[id][1][1]+" #"+TrixTG_bordervar[id][1][0];
		temp2=TrixTG_bordervar[id][2][2]+"px "+TrixTG_bordervar[id][2][1]+" #"+TrixTG_bordervar[id][2][0];
		temp3=TrixTG_bordervar[id][3][2]+"px "+TrixTG_bordervar[id][3][1]+" #"+TrixTG_bordervar[id][3][0];
		temp4=TrixTG_bordervar[id][4][2]+"px "+TrixTG_bordervar[id][4][1]+" #"+TrixTG_bordervar[id][4][0];
		 if(id=="menulink")
		 	for(i=1;i<=10;i++)
			{
	    	   tempid=document.getElementById("TrixTGP_menulink"+i);
			   tempid.style.borderTop = temp1;
   		       tempid.style.borderRight = temp2;
			   tempid.style.borderBottom = temp3;			   
			   tempid.style.borderLeft = temp4;
			}
	     return ("this.style.borderTop='"+temp1+"';this.style.borderRight='"+temp2+"';this.style.borderBottom='"+temp3+"';this.style.borderLeft='"+temp4+"';");
	 }
	 else{
		 if(id=="menulink")
		 	for(i=1;i<=10;i++)
	    	   document.getElementById("TrixTGP_menulink"+i).style.border = "none";  
	    return ("this.style.border='none';");}
  }
}
function TrixTG_hideshowcolorselect()
{
 if(document.getElementById("TrixTG_colorselect").style.display == "block")
   document.getElementById("TrixTG_colorselect").style.display = "none";
 else if(document.getElementById("TrixTG_colorselect").style.display == "none")
   document.getElementById("TrixTG_colorselect").style.display = "block";
}
function TrixTG_imagenochange(id)
{
  var tempno = document.getElementById("TrixTG_"+id+"imageno").value;
  TrixTG_backgroundselvar[id]=tempno;
  document.getElementById("TrixTG_"+id+"bgimage").value =  TrixTG_backgroundvar[id][tempno][0];
  document.getElementById("TrixTG_"+id+"bgimagerepeat").value = TrixTG_backgroundvar[id][tempno][1];
  document.getElementById("TrixTG_"+id+"bgimagepositiontop").value = TrixTG_backgroundvar[id][tempno][2];
  document.getElementById("TrixTG_"+id+"bgimagepositiontoptype").value = TrixTG_backgroundvar[id][tempno][3];
  document.getElementById("TrixTG_"+id+"bgimagepositionleft").value = TrixTG_backgroundvar[id][tempno][4];
  document.getElementById("TrixTG_"+id+"bgimagepositionlefttype").value = TrixTG_backgroundvar[id][tempno][5];
  document.getElementById("TrixTG_"+id+"bgattachment").value = TrixTG_backgroundvar[id][tempno][6];  
}
function TrixTG_bgcolorchange(id,start,end)
{	
 var tempbgcolor =document.getElementById("TrixTG_"+id+"bgcolor").value;
 var i;
 if(tempbgcolor.replace(/[\n\r\t\ ]/g,'') == '')
 {
	document.getElementById("TrixTG_"+id+"bgcolor").value=''; 
	if(id != "menulink" && id != "menulinkm" )
	    for(i=start; i<=end; i++)
    	     document.getElementById("TrixTGP_"+id+TrixTG_count[i]).style.backgroundColor = 'transparent';
	else
	   TrixTG_menulinksettingschange(id);			 
 }
 else
 {	 
	 tempbgcolor=tempbgcolor.replace(/[^0-9A-Fa-f]/g,'0');
	 tempbgcolor=TrixTG_hexpat.substr(0,6-tempbgcolor.length)+tempbgcolor; 
	 document.getElementById("TrixTG_"+id+"bgcolor").value = tempbgcolor; 
	 if(id !="menulink" && id != "menulinkm")
	   for(i=start; i<=end; i++)
		  document.getElementById("TrixTGP_"+id+TrixTG_count[i]).style.backgroundColor="#"+tempbgcolor;
	 else
	   TrixTG_menulinksettingschange(id);
 }
}
function TrixTG_bgimagechange(id,start,end)
{	
   var tempno = parseInt(document.getElementById("TrixTG_"+id+"imageno").value);
   TrixTG_backgroundvar[id][tempno][0]=document.getElementById("TrixTG_"+id+"bgimage").value;
   if(id !="menulink" && id != "menulinkm" )
	  for(var i=start; i<=end; i++)
		document.getElementById("TrixTGP_"+id+TrixTG_count[i]+TrixTG_count2[tempno]).style.backgroundImage="url("+TrixTG_backgroundvar[id][tempno][0]+")";
   else
		TrixTG_menulinksettingschange(id);
}
function TrixTG_bgimagerepeatchange(id,start,end)
{
  var tempno = document.getElementById("TrixTG_"+id+"imageno").value;
  TrixTG_backgroundvar[id][tempno][1]=document.getElementById("TrixTG_"+id+"bgimagerepeat").value;
  if(id !="menulink" && id != "menulinkm" )
	for(var i=start; i<=end; i++) 
	  document.getElementById("TrixTGP_"+id+TrixTG_count[i]+TrixTG_count2[tempno]).style.backgroundRepeat=TrixTG_backgroundvar[id][tempno][1];
  else
	   TrixTG_menulinksettingschange(id);	  
}
function TrixTG_opacitychange(id,start,end)
{
  var temp = parseInt(document.getElementById("TrixTG_"+id+"opacity").value);
  if(isNaN(temp) || temp > 100) temp = 100;
  else if(temp < 0) temp = 0;
  document.getElementById("TrixTG_"+id+"opacity").value = temp;
  for(var i =start; i<=end; i++){
  document.getElementById("TrixTGP_"+id+TrixTG_count[i]).style.filter="alpha(opacity="+temp+")";
  document.getElementById("TrixTGP_"+id+TrixTG_count[i]).style.MozOpacity=temp/100;
  document.getElementById("TrixTGP_"+id+TrixTG_count[i]).style.opacity=temp/100;}
}
function TrixTG_bgattachmentchange(id,start,end)
{
  var tempno = document.getElementById("TrixTG_"+id+"imageno").value;
  TrixTG_backgroundvar[id][tempno][6]=document.getElementById("TrixTG_"+id+"bgattachment").value;
  if(id != "menulink" && id != "menulinkm")
	 for(var i=start; i<=end; i++)
	   document.getElementById("TrixTGP_"+id+TrixTG_count[i]+TrixTG_count2[tempno]).style.backgroundAttachment = TrixTG_backgroundvar[id][tempno][6];
  else
	   TrixTG_menulinksettingschange(id);
}

function TrixTG_bgimagepositionchange(id,start,end)
{
  var tempno = document.getElementById("TrixTG_"+id+"imageno").value;
  var temptopvalue = parseInt(document.getElementById("TrixTG_"+id+"bgimagepositiontop").value);
  var templeftvalue = parseInt(document.getElementById("TrixTG_"+id+"bgimagepositionleft").value);
  TrixTG_backgroundvar[id][tempno][3] = document.getElementById("TrixTG_"+id+"bgimagepositiontoptype").value;
  TrixTG_backgroundvar[id][tempno][5] = document.getElementById("TrixTG_"+id+"bgimagepositionlefttype").value;
  if(isNaN(temptopvalue))  temptopvalue = 0;
  if(isNaN(templeftvalue))  templeftvalue = 0;
  document.getElementById("TrixTG_"+id+"bgimagepositiontop").value = temptopvalue;
  document.getElementById("TrixTG_"+id+"bgimagepositionleft").value = templeftvalue;
  TrixTG_backgroundvar[id][tempno][2] = temptopvalue;
  TrixTG_backgroundvar[id][tempno][4] = templeftvalue;
  if(id != "menulink" && id!="menulinkm")
  {
	  temptopvalue = temptopvalue + ((TrixTG_backgroundvar[id][tempno][3]=="percent")?"%":"px");
	  templeftvalue = templeftvalue + ((TrixTG_backgroundvar[id][tempno][5]=="percent")?"%":"px");
	  for(var i=start; i<=end; i++)
		 document.getElementById("TrixTGP_"+id+TrixTG_count[i]+TrixTG_count2[tempno]).style.backgroundPosition = templeftvalue +" "+temptopvalue; 
  }
  else
	   TrixTG_menulinksettingschange(id);
}

function TrixTG_textfontchange(id,start,end)
{
  var tempfont = document.getElementById("TrixTG_"+id+"textfont").value;
  var tempfontfamily = document.getElementById("TrixTG_"+id+"textfontfamily").value;
  var temp = ',';
  if(tempfont == 'default'){
       tempfont = '';   temp = '';}
  if(tempfontfamily == 'default'){
       tempfontfamily = '';  temp = '';}
  for(var i=start; i<=end; i++)
     document.getElementById("TrixTGP_"+id+TrixTG_count[i]).style.fontFamily = tempfont+temp+tempfontfamily;
}

function TrixTG_textcolorchange(id,start,end)
{
 var temptextcolor =document.getElementById("TrixTG_"+id+"textcolor").value;
 var i;
 if(temptextcolor.replace(/[\n\r\t\ ]/g,'') == '')
 {
 	if(id != "menulink" && id != "menulinkm" )
	    for(i=start; i<=end; i++)
    	     document.getElementById("TrixTGP_"+id+TrixTG_count[i]).style.color = '';
	else
	   TrixTG_menulinksettingschange(id);			 
 }
 else
 {
	 temptextcolor=temptextcolor.replace(/[^0-9A-Fa-f]/g,'0');
	 temptextcolor=TrixTG_hexpat.substr(0,6-temptextcolor.length)+temptextcolor; 
	 document.getElementById("TrixTG_"+id+"textcolor").value = temptextcolor; 
	 if(id !="menulink" && id != "menulinkm")
	   for(i=start; i<=end; i++)
		  document.getElementById("TrixTGP_"+id+TrixTG_count[i]).style.color="#"+temptextcolor;
	 else
	   TrixTG_menulinksettingschange(id);
 }
}
function TrixTG_textsizechange(id,start,end)
{
  var tempsize = document.getElementById("TrixTG_"+id+"textsize").value;
  if(isNaN(tempsize) || tempsize <= 0){
        document.getElementById("TrixTG_"+id+"textsize").value= "";  tempsize = "";}
  else 
    tempsize = tempsize+"px";
  for(var i=start; i<=end; i++)
     document.getElementById("TrixTGP_"+id+TrixTG_count[i]).style.fontSize= tempsize; 
}
function TrixTG_textalignchange(id,start,end)
{
  var tempalign =  document.getElementById("TrixTG_"+id+"textalign").value;
  tempalign = (tempalign == 'inherit')?"":tempalign;
  for(var i=start; i<=end; i++)
     document.getElementById("TrixTGP_"+id+TrixTG_count[i]).style.textAlign = tempalign;
}
function TrixTG_textboldchange(id,start,end)
{
  var tempbold = document.getElementById("TrixTG_"+id+"textbold").value;
  tempbold = (tempbold == 'inherit')?"":tempbold;
  for(var i=start; i<=end; i++)
     document.getElementById("TrixTGP_"+id+TrixTG_count[i]).style.fontWeight = tempbold;
}
function TrixTG_textitalicchange(id,start,end)
{
  var tempitalic=document.getElementById("TrixTG_"+id+"textitalic").value;
  tempitalic = (tempitalic == 'inherit')?"":tempitalic;
  for(var i=start; i<=end; i++)
     document.getElementById("TrixTGP_"+id+TrixTG_count[i]).style.fontStyle = tempitalic;
}
function TrixTG_textunderlinechange(id,start,end)
{
  var tempunderline = document.getElementById("TrixTG_"+id+"textunderline").value;
  tempunderline = (tempunderline == 'inherit')?"":tempunderline;
  for(var i=start; i<=end; i++)
     document.getElementById("TrixTGP_"+id+TrixTG_count[i]).style.textDecoration = tempunderline;
}
function TrixTG_marginpaddingchange(id,styles,start,end)
{
  var temptopvalue = parseInt(document.getElementById("TrixTG_"+id+styles+"top").value);
  var temprightvalue = parseInt(document.getElementById("TrixTG_"+id+styles+"right").value);
  var tempbottomvalue = parseInt(document.getElementById("TrixTG_"+id+styles+"bottom").value);
  var templeftvalue = parseInt(document.getElementById("TrixTG_"+id+styles+"left").value);
  var temptoptype = document.getElementById("TrixTG_"+id+styles+"toptype").value;
  var temprighttype = document.getElementById("TrixTG_"+id+styles+"righttype").value;
  var tempbottomtype = document.getElementById("TrixTG_"+id+styles+"bottomtype").value;
  var templefttype = document.getElementById("TrixTG_"+id+styles+"lefttype").value;
  var i;
  if(isNaN(temptopvalue))   temptopvalue = 0;  
  if(isNaN(temprightvalue)) temprightvalue = 0;
  if(isNaN(tempbottomvalue)) tempbottomvalue = 0; 
  if(isNaN(templeftvalue)) templeftvalue = 0; 
	
  document.getElementById("TrixTG_"+id+styles+"top").value = temptopvalue;
  document.getElementById("TrixTG_"+id+styles+"right").value = temprightvalue; 
  document.getElementById("TrixTG_"+id+styles+"bottom").value = tempbottomvalue;
  document.getElementById("TrixTG_"+id+styles+"left").value = templeftvalue;
  
  if(temptoptype == "auto"){ 
     document.getElementById("TrixTG_"+id+styles+"top").disabled = true; temptopvalue = "auto"; }
  else { 
	 document.getElementById("TrixTG_"+id+styles+"top").disabled = false;
     temptopvalue = temptopvalue + ((temptoptype=="percent")?"%":"px"); }
	 
  if(temprighttype == "auto"){ 
     document.getElementById("TrixTG_"+id+styles+"right").disabled = true; temprightvalue = "auto"; }
  else { 
	 document.getElementById("TrixTG_"+id+styles+"right").disabled = false;
     temprightvalue = temprightvalue + ((temprighttype=="percent")?"%":"px"); }

  if(tempbottomtype == "auto"){ 
     document.getElementById("TrixTG_"+id+styles+"bottom").disabled = true; tempbottomvalue = "auto"; }
  else { 
	 document.getElementById("TrixTG_"+id+styles+"bottom").disabled = false;
     tempbottomvalue = tempbottomvalue + ((tempbottomtype=="percent")?"%":"px"); }
  
  if(templefttype == "auto"){ 
     document.getElementById("TrixTG_"+id+styles+"left").disabled = true; templeftvalue = "auto"; }
  else { 
	 document.getElementById("TrixTG_"+id+styles+"left").disabled = false;
       templeftvalue = templeftvalue + ((templefttype=="percent")?"%":"px"); }
 
  if(styles == "margin")
    for(i=start;i<=end;i++)
        document.getElementById("TrixTGP_"+id+TrixTG_count[i]).style.margin = temptopvalue+" "+temprightvalue+" "+tempbottomvalue +" "+templeftvalue; 
  else if(styles == "padding")
     for(i=start;i<=end;i++)
        document.getElementById("TrixTGP_"+id+TrixTG_count[i]).style.padding= temptopvalue+" "+temprightvalue+" "+tempbottomvalue +" "+templeftvalue; 
}
function TrixTG_borderselectchange(id,start,end)
{
  var i;
  if(document.getElementById("TrixTG_"+id+"borderselect").value == "no")
  {
    document.getElementById("TrixTG_"+id+"borderallstyles").style.display = "none";
	for(i=0;i<5;i++)
		TrixTG_bordervar[id][i][2]=0;
    if(id != "menulink" && id!="menulinkm")
	  for(i=start;i<=end;i++)
  	    document.getElementById("TrixTGP_"+id+TrixTG_count[i]).style.border = "none";
	else
	   TrixTG_menulinksettingschange(id);
  }
  else 
  {
    document.getElementById("TrixTG_"+id+"borderallstyles").style.display = "inline";
	TrixTG_bordersidechange(id)	
	TrixTG_borderchange(id,start,end);
  }
}
function TrixTG_borderchange(id,start,end)
{
 var temptype = document.getElementById("TrixTG_"+id+"bordersideselect").value;
 var tempbordercolor =document.getElementById("TrixTG_"+id+"bordercolor").value;
 var tempborderstyle =document.getElementById("TrixTG_"+id+"borderstyle").value;
 var tempborderwidth = parseInt(document.getElementById("TrixTG_"+id+"borderwidth").value);
 var tempborderradius = parseInt(document.getElementById("TrixTG_"+id+"borderradius").value);
 var tempid,i;
 tempbordercolor=tempbordercolor.replace(/[^0-9A-Fa-f]/g,'0');
 tempbordercolor=TrixTG_hexpat.substr(0,6-tempbordercolor.length)+tempbordercolor; 
 document.getElementById("TrixTG_"+id+"bordercolor").value = tempbordercolor; 	
 if (isNaN(tempborderwidth) || tempborderwidth<0) {
     tempborderwidth=0;  document.getElementById("TrixTG_"+id+"borderwidth").value = 0; }
 if (isNaN(tempborderradius) || tempborderradius<0) {
     tempborderradius=0;  document.getElementById("TrixTG_"+id+"borderradius").value = 0; }

 TrixTG_bordervar[id][temptype][0]= tempbordercolor;
 TrixTG_bordervar[id][temptype][1]= tempborderstyle;
 TrixTG_bordervar[id][temptype][2]= tempborderwidth;
 TrixTG_bordervar[id][temptype][3]= tempborderradius;
 for(i=0;i<5;i++)
	 TrixTG_bordervar[id][i][3] = tempborderradius;

 if(id != "menulink" && id!="menulinkm")
	for(i=start;i<=end;i++){
		document.getElementById("TrixTGP_"+id+TrixTG_count[i]).style.MozBorderRadius= tempborderradius+"px"; 
		document.getElementById("TrixTGP_"+id+TrixTG_count[i]).style.WebkitBorderRadius= tempborderradius+"px"; 
		document.getElementById("TrixTGP_"+id+TrixTG_count[i]).style.borderRadius= tempborderradius+"px"; 
 }
 else
    TrixTG_menuborderchange(id);
 if(temptype == "0")
 {
   for(i=1;i<5;i++)
     TrixTG_bordervar[id][i][2]=0;
   if(id != "menulink" && id!="menulinkm")
      for(i=start;i<=end;i++)
        document.getElementById("TrixTGP_"+id+TrixTG_count[i]).style.border=tempborderwidth+"px "+tempborderstyle+" "+"#"+tempbordercolor;
   else
	   TrixTG_menulinksettingschange(id);
 }	
 else
 {
   TrixTG_bordervar[id][0][2]=0;
   if(id != "menulink" && id!="menulinkm")
      for(i=start;i<=end;i++)
	   {
	  	 tempid = document.getElementById("TrixTGP_"+id+TrixTG_count[i]);
   	     tempid.style.border = '';
	
		 tempid.style.borderTop= TrixTG_bordervar[id][1][2]+"px "+TrixTG_bordervar[id][1][1]+" #"+TrixTG_bordervar[id][1][0];
		 tempid.style.borderRight=TrixTG_bordervar[id][2][2]+"px "+TrixTG_bordervar[id][2][1]+" #"+TrixTG_bordervar[id][2][0];
		 tempid.style.borderBottom=TrixTG_bordervar[id][3][2]+"px "+TrixTG_bordervar[id][3][1]+" #"+TrixTG_bordervar[id][3][0];
		 tempid.style.borderLeft=TrixTG_bordervar[id][4][2]+"px "+TrixTG_bordervar[id][4][1]+" #"+TrixTG_bordervar[id][4][0];
	   }
   else
	   TrixTG_menulinksettingschange(id);
 }
}
function TrixTG_bordersidechange(id)
{
	var temptype = document.getElementById("TrixTG_"+id+"bordersideselect").value;
	TrixTG_borderselvar[id]=temptype;
	document.getElementById("TrixTG_"+id+"bordercolor").value = TrixTG_bordervar[id][temptype][0];
	document.getElementById("TrixTG_"+id+"borderstyle").value = TrixTG_bordervar[id][temptype][1];
	document.getElementById("TrixTG_"+id+"borderwidth").value = TrixTG_bordervar[id][temptype][2];
    document.getElementById("TrixTG_"+id+"borderradius").value = TrixTG_bordervar[id][temptype][3];
}
function TrixTG_heightchange(id,start,end)
{
  var tempheight = parseInt(document.getElementById("TrixTG_"+id+"height").value);
  var i;
  if(isNaN(tempheight) || tempheight < 0 ){
    document.getElementById("TrixTG_"+id+"height").value = "";
	for(i=start; i<=end; i++)
     document.getElementById("TrixTGP_"+id+TrixTG_count[i]).style.height = "auto";}
  else{
    document.getElementById("TrixTG_"+id+"height").value = tempheight;
    for(i=start; i<=end; i++)
     document.getElementById("TrixTGP_"+id+TrixTG_count[i]).style.height = tempheight+"px";  }
}
function TrixTG_minwidthchange()
{
  var tempminwidth = parseInt(document.getElementById("TrixTG_bodyminwidth").value);
  if(isNaN(tempminwidth) || tempminwidth < 0){
     document.getElementById("TrixTG_bodyminwidth").value =""; 
     document.getElementById("TrixTGP_outerbody").style.minWidth = "";}
  else{
     document.getElementById("TrixTG_bodyminwidth").value=tempminwidth;
     document.getElementById("TrixTGP_outerbody").style.minWidth = tempminwidth +"px";   }
}
function TrixTG_widthchange(id,start,end)
{
  var tempwidth = parseInt(document.getElementById("TrixTG_"+id+"width").value); var i;
  var tempwidthtype = ((document.getElementById("TrixTG_"+id+"widthtype").value) == "pixel")?"px":"%";
  if(isNaN(tempwidth) || tempwidth < 0){
     document.getElementById("TrixTG_"+id+"width").value =""; 
	 for(i=start; i<=end; i++)
        document.getElementById("TrixTGP_"+id+TrixTG_count[i]).style.width = "auto";}
  else{
     document.getElementById("TrixTG_"+id+"width").value =tempwidth;
     for(i=start; i<=end; i++)
        document.getElementById("TrixTGP_"+id+TrixTG_count[i]).style.width = tempwidth + tempwidthtype;   }
}
/*function TrixTG_divpositionchange(id)
{
  temppostop = parseInt(document.getElementById("TrixTG_"+id+"positiontop").value);
  tempposleft = parseInt(document.getElementById("TrixTG_"+id+"positionleft").value);
  if(isNaN(temppostop)) temppostop = 0;
  else if(isNaN(tempposleft)) tempposleft = 0;
  document.getElementById("TrixTG_"+id+"positiontop").value = temppostop;
  document.getElementById("TrixTG_"+id+"positionleft").value= tempposleft;
  document.getElementById("TrixTGP_"+id).style.top = temppostop+"px";
  document.getElementById("TrixTGP_"+id).style.left = tempposleft+"px";
}*/
function TrixTG_linksnochange(id)
{
  var tempnumber = parseInt(document.getElementById("TrixTG_"+id+"linksno").value);
  if(isNaN(tempnumber) || tempnumber < 0) tempnumber = 0;
  else if(tempnumber > 10) tempnumber = 10;
  document.getElementById("TrixTG_"+id+"linksno").value = tempnumber;
  if(tempnumber == 0)
      document.getElementById("TrixTGP_hdrmen").style.display = "none";
  else
      document.getElementById("TrixTGP_hdrmen").style.display = "block";
	  
  for (var i=1; i<=10;i++)
    if(i <= tempnumber)
	  document.getElementById("TrixTGP_menulink"+i).style.display = "inline";
	else
	  document.getElementById("TrixTGP_menulink"+i).style.display = "none";
  TrixTG_linksmenunochange();  
}
function TrixTG_linksmenunochange()
{
	var temp = parseInt(document.getElementById("TrixTG_linksmenuno").value);
	if(temp>0 && temp<=10){
	TrixTG_linkselvar=temp;
	document.getElementById("TrixTG_menulinksrc").value = TrixTG_linkvar[temp][0];
	document.getElementById("TrixTG_menulinktext").value = TrixTG_linkvar[temp][1];}
	else{
	document.getElementById("TrixTG_menulinksrc").value = '';
	document.getElementById("TrixTG_menulinktext").value = '';}	
}
function TrixTG_menulinkchange()
{
	var temp = parseInt(document.getElementById("TrixTG_linksmenuno").value);
  	var temptext = document.getElementById("TrixTG_menulinktext").value;
	temptext = ((temptext.replace(/[\n\r\t\ ]/g,''))=='')?"Link"+temp:temptext;
	document.getElementById("TrixTG_menulinktext").value = temptext;
	TrixTG_linkvar[temp][0] = document.getElementById("TrixTG_menulinksrc").value;
	TrixTG_linkvar[temp][1] = temptext;	
	document.getElementById("TrixTGP_menulink"+temp).href=(TrixTG_linkvar[temp][0]!='')?TrixTG_linkvar[temp][0]:"javascript:void";
	
	if(TrixTG_flashid == "TrixTG_flash_IE")
		document.getElementById("TrixTGP_menulink"+temp).innerText=TrixTG_linkvar[temp][1];
	else
		document.getElementById("TrixTGP_menulink"+temp).textContent=TrixTG_linkvar[temp][1];
}
function TrixTG_titdeschange(id,set)
{
  var temp = document.getElementById("TrixTG_"+id+set+"text").value;
//  temp = temp.replace('  ',' ');
  temp = temp.replace(/[\|\&]/g,'');
  
  document.getElementById("TrixTG_"+id+set+"text").value = temp;
  if(set == 'tit' || set == 'des')
  {
    if(TrixTG_flashid == "TrixTG_flash_IE")
	 document.getElementById("TrixTGP_"+id+set).innerText = temp; 
	else
     document.getElementById("TrixTGP_"+id+set).textContent = temp;
	if(temp == '')
       document.getElementById("TrixTGP_"+id+set).style.display = "none"; 
    else
       document.getElementById("TrixTGP_"+id+set).style.display = "block";
  }
}
function TrixTG_gensetsidebar_no()
{
 TrixTG_sidebarno=document.getElementById("TrixTG_gensetsidebarno").value;
 if(TrixTG_sidebarno=="1")
 {
     document.getElementById("TrixTG_gensetsidebar1_order").style.display="block";
     document.getElementById("TrixTG_gensetsidebar2_order").style.display="none";
	 document.getElementById("TrixTG_gensetsidebar_2type").style.display="none";
	 document.getElementById("TrixTG_gensetsidebar_1type").style.display="block";
	 TrixTG_showsidemain('1');
 }
 else if(TrixTG_sidebarno=="2")
 {
     document.getElementById("TrixTG_gensetsidebar1_order").style.display="none";
     document.getElementById("TrixTG_gensetsidebar2_order").style.display="block";
	 document.getElementById("TrixTG_gensetsidebar_1type").style.display="none";
	 document.getElementById("TrixTG_gensetsidebar_2type").style.display="block";
	 TrixTG_showsidemain('2');
 }
}
function TrixTG_showsidemain(no)
{
	var temporder='',temptype,tempfloat="left",i;
	if(document.getElementById("TrixTG_selectblock7").checked == true)
    {
		if(no=='1')
		{
			temporder = document.getElementById("TrixTG_gensetsidebar_1order").value;
			temptype = parseInt(document.getElementById("TrixTG_gensetsidebar_1type").value);
			temptype = (temporder == '1')?temptype:(temptype+5);
		}
		else
			temptype = 11;
	}
	else
	    temptype = 0;
	if(temporder == "1" ) tempfloat="right";
	document.getElementById("TrixTGP_maingen").style.cssFloat = tempfloat;
	for(i=0;i<=13;i++)
	{
	   if(TrixTG_disp[temptype][i] == 1)  
  	      document.getElementById("TrixTGP_"+TrixTG_side[i]).style.display = "block"; 
	   else 
  	      document.getElementById("TrixTGP_"+TrixTG_side[i]).style.display = "none"; 
	}
}