function getCookieVal (offset) 
  {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
      endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
  }
function GetCookie (name) 
  {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) 
      {
      var j = i + alen;
      if (document.cookie.substring(i, j) == arg)
        return getCookieVal (j);
      i = document.cookie.indexOf(" ", i) + 1;
      if (i == 0) 
        break; 
      }
  return null;
  }
function SetCookie (name, value) 
  {
  var argv = SetCookie.arguments;
  var argc = SetCookie.arguments.length;
  var expires = (2 < argc) ? argv[2] : null;
  var path = (3 < argc) ? argv[3] : null;
  var domain = (4 < argc) ? argv[4] : null;
  var secure = (5 < argc) ? argv[5] : false;
  document.cookie = name + "=" + escape (value) +
    ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
    ((path == null) ? "" : ("; path=" + path)) +
    ((domain == null) ? "" : ("; domain=" + domain)) +
    ((secure == true) ? "; secure" : "");
  }
  
  function deleteCookie (name, path, domain) {
if (getCookie(name))
exp = new Date();
exp.setTime(exp.getTime() - 60 * 60 * 24);
document.cookie = name + "=" + "; expires=Thu, 01-Jan-70 00:00:01 GMT" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "");
}



function get_id ($id) {
		if (document.all && document.getElementById) {
			return document.all($id);
		} else if (!document.all && document.getElementById) {
			return document.getElementById($id);
		} else {
			return false;
		}
	}
	
function hidediv (id,img) {
	if (($id = get_id(id))) {
		if ($id.style.display == 'none') {
			$id.style.visibility = 'visible';
			$id.style.display = 'block';
			$img = get_id(img);
			$img.src = "img/minus.gif";
		} else {
			$id.style.visibility = 'hidden';
			$id.style.display = 'none';
			$img = get_id(img);
			$img.src = "img/plus.gif";
		}
	}
}

function showDiv(id,tot){

for(i=1;i<tot+1;i++){
$id = get_id("tab" + i);
$id.style.visibility = 'hidden';
$id.style.display = 'none';
id2 = get_id("tab" + i +"nav");
id2.style.borderBottom = "1px solid #000";			
}
if(($id = get_id(id))){
			$id.style.visibility = 'visible';
			$id.style.display = 'block';
			id2 = get_id(id + "nav");
			id2.style.borderBottom = "1px solid #FFF";			
			id2.color = "#FFFFFF";			


			
}
}

function toggleDiv(id,img){

	if(($id = get_id(id))){
		if($id.style.display=="none"){
			$id.style.display = 'block';
						img = get_id(img);			
			img.src = "../../admin/icons/rminus.gif";
		}else{
			$id.style.display = 'none';
			$img = get_id(img);
			$img.src = "../../admin/icons/rplus.gif";
		}
	}
}

function toggleDivRel(id,img){

	if(($id = get_id(id))){
		if($id.style.display=="none"){
			$id.style.display = 'block';
						img = get_id(img);			
			img.src = "../../../admin/icons/rminus.gif";
		}else{
			$id.style.display = 'none';
			$img = get_id(img);
			$img.src = "../../../admin/icons/rplus.gif";
		}
	}
}


function xshowDiv(id){
$id = get_id("tab1");
$id.style.visibility = 'hidden';
$id.style.display = 'none';
id2 = get_id("tab1nav");
id2.style.borderBottom = "1px solid #000";			
$id = get_id("tab2");
$id.style.visibility = 'hidden';
$id.style.display = 'none';
id2 = get_id("tab2nav");
id2.style.borderBottom = "1px solid #000";			
$id = get_id("tab3");
$id.style.visibility = 'hidden';
$id.style.display = 'none';
id2 = get_id("tab3nav");
id2.style.borderBottom = "1px solid #000";			
$id = get_id("tab4");
$id.style.visibility = 'hidden';
$id.style.display = 'none';
id2 = get_id("tab4nav");
id2.style.borderBottom = "1px solid #000";			
$id = get_id("tab5");
$id.style.visibility = 'hidden';
$id.style.display = 'none';
id2 = get_id("tab5nav");
id2.style.borderBottom = "1px solid #000";			
$id = get_id("tab6");
$id.style.visibility = 'hidden';
$id.style.display = 'none';
id2 = get_id("tab6nav");
$id = get_id("tab7");
$id.style.visibility = 'hidden';
$id.style.display = 'none';
id2 = get_id("tab7nav");
id2.style.borderBottom = "1px solid #000";			
if(($id = get_id(id))){
			$id.style.visibility = 'visible';
			$id.style.display = 'block';
			id2 = get_id(id + "nav");
			id2.style.borderBottom = "1px solid #FFF";			
			id2.color = "#FFFFFF";			


			
}
}

function get_mouse(e){

}




function getDialog(p,field){

	mouseX=function(evt){
	   return(evt?(evt.pageX?evt.pageX:evt.clientX):(window.event.pageX?window.event.pageX:window.event.clientX))+(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft)
	}
	mouseY=function(evt){
	   return(evt?(evt.pageY?evt.pageY:evt.clientY):(window.event.pageY?window.event.pageY:window.event.clientY))+(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop)
    }
var x=mouseX + document.body.scrollLeft + 20;
var y=mouseY + document.body.scrollTop+  40;
	window.open(p + "includes/datedialog.php?f=" + field ,"test","left=" + x + ", top=" + y + " , toolbars=no,location=no,status=no,scrollbars=no,width=150, height=137");
}

function getDialogCalendar(p,field){
var x=event.x+document.body.scrollLeft + 20;
var y=event.y+document.body.scrollTop + 40;
	window.open(p + "includes/datedialog.php?f=" + field ,"test","left=" + x + ", top=" + y + " , toolbars=no,location=no,status=no,scrollbars=no,width=150, height=137");
}

function wordcounter(path, id){
//alert(path);
window.open("./includes/wordcount.php?path=" + path + "&id=" + id,"test","left=400, top=400 , toolbars=no,location=no,status=no,scrollbars=yes,width=450, height=450");

}


function SetUrl(field, url){
document.getElementById(field).value = url;
}

function OpenServerBrowser( type, url, width, height )
{


	sActualBrowser = type ;

	var iLeft = (screen.width  - width) / 2 ;
	var iTop  = (screen.height - height) / 2 ;

	var sOptions = "toolbar=no,status=no,resizable=yes,dependent=yes" ;
	sOptions += ",width=" + width ;
	sOptions += ",height=" + height ;
	sOptions += ",left=" + iLeft ;
	sOptions += ",top=" + iTop ;

	var oWindow = window.open( url, "FCKBrowseWindow", sOptions ) ;
}

function getImageDialog(rel,field){
var x=event.x+document.body.scrollLeft + 20;
var y=event.y+document.body.scrollTop + 40;

var type ="Image";
var url =rel +"FCKeditor/editor/filemanager/browser/default/browser_light.html?Type=Image&Connector=connectors/php/connector.php&field="+ field;
OpenServerBrowser( type, url, 700, 700 )
//	window.open("fckeditor/editor/dialog/fck_image_light.html?f=" + field ,"test","left=" + x + ", top=" + y + " , toolbars=no,location=no,status=no,scrollbars=no,width=450, height=150");
}

function getContractDialog(rel,field){
var x=event.x+document.body.scrollLeft + 20;
var y=event.y+document.body.scrollTop + 40;

var type ="Image";
var url =rel +"FCKeditor/editor/filemanager/browser/default/browser_light.html?Type=&Connector=connectors/php/connector_contract.php&field="+ field;
OpenServerBrowser( type, url, 700, 700 )
//	window.open("fckeditor/editor/dialog/fck_image_light.html?f=" + field ,"test","left=" + x + ", top=" + y + " , toolbars=no,location=no,status=no,scrollbars=no,width=450, height=150");
}


function getDirectories(){
var x=event.x+document.body.scrollLeft + 20;
var y=event.y+document.body.scrollTop + 40;

var url =rel +"includes/image/dir_list.php";
OpenWindow( type, url, 700, 700 )
//	window.open("fckeditor/editor/dialog/fck_image_light.html?f=" + field ,"test","left=" + x + ", top=" + y + " , toolbars=no,location=no,status=no,scrollbars=no,width=450, height=150");
}


function getArtistDirectories(){
var x=event.x+document.body.scrollLeft + 20;
var y=event.y+document.body.scrollTop + 40;
var type ="Image";
var url ="../includes/image/dir_list.php";
window.open(url,'test','left=550, top=400, width=' + 350 + ', height=' + 300 + ',scrollbars=yes');
//	window.open("fckeditor/editor/dialog/fck_image_light.html?f=" + field ,"test","left=" + x + ", top=" + y + " , toolbars=no,location=no,status=no,scrollbars=no,width=450, height=150");
}

function getFlashDialog(rel,field){
var x=event.x+document.body.scrollLeft + 20;
var y=event.y+document.body.scrollTop + 40;

var type ="Flash";
var url =rel +"FCKeditor/editor/filemanager/browser/default/browser_light.html?Type=Flash&Connector=connectors/php/connector.php&field="+ field;
OpenServerBrowser( type, url, 700, 700 )
//	window.open("fckeditor/editor/dialog/fck_image_light.html?f=" + field ,"test","left=" + x + ", top=" + y + " , toolbars=no,location=no,status=no,scrollbars=no,width=450, height=150");
}



function getFileDialog(rel,field){
var x=event.x+document.body.scrollLeft + 20;
var y=event.y+document.body.scrollTop + 40;

var type ="File";
var url =rel +"FCKeditor/editor/filemanager/browser/default/browser_light.html?Type=File&Connector=connectors/php/connector.php&field="+ field;
OpenServerBrowser( type, url, 700, 700 )
//	window.open("fckeditor/editor/dialog/fck_image_light.html?f=" + field ,"test","left=" + x + ", top=" + y + " , toolbars=no,location=no,status=no,scrollbars=no,width=450, height=150");
}

function getMediaDialog(rel,field){
var x=event.x+document.body.scrollLeft + 20;
var y=event.y+document.body.scrollTop + 40;

var type ="Media";
var url =rel +"FCKeditor/editor/filemanager/browser/default/browser_light.html?Type=Media&Connector=connectors/php/connector.php&field="+ field;
OpenServerBrowser( type, url, 700, 700 )
//	window.open("fckeditor/editor/dialog/fck_image_light.html?f=" + field ,"test","left=" + x + ", top=" + y + " , toolbars=no,location=no,status=no,scrollbars=no,width=450, height=150");
}

function getAltPageDialog(rel,field){
var x=event.x+document.body.scrollLeft + 20;
var y=event.y+document.body.scrollTop + 40;

var url ="includes/site_tree_list.php";
window.open(url,'test','left=550, top=400, width=' + 350 + ', height=' + 300 + ',scrollbars=yes');
}



function getRelPageDialog(rel,field){
var x=event.x+document.body.scrollLeft + 20;
var y=event.y+document.body.scrollTop + 40;

var url ="includes/site_tree_list_rel.php";
window.open(url,'test','left=550, top=400, width=' + 350 + ', height=' + 300 + ',scrollbars=yes');
}

function getWWWDialog(rel,field){
var x=event.x+document.body.scrollLeft + 20;
var y=event.y+document.body.scrollTop + 40;

var url ="includes/www_dlg.php";
window.open(url,'test','left=550, top=300, width=' + 350 + ', height=' + 100 + ',scrollbars=yes');
}


function openWindow(win,w,h,field){
window.open(win + '?fieldref=' + field,'test','width=' + w + ', height=' + h + ',scrollbars=yes');
}

function getDirectories(){
var x=event.x+document.body.scrollLeft + 20;
var y=event.y+document.body.scrollTop + 40;

var url ="includes/image/dir_list.php";
window.open(url,'test','left=550, top=400, width=' + 350 + ', height=' + 300 + ',scrollbars=yes');
}

function openRollBack(id){
var x=event.x+document.body.scrollLeft + 20;
var y=event.y+document.body.scrollTop + 40;
              
window.open("admin/gtw_roll_back-form.php?id=" + id ,"test","left=" + x + ", top=" + y + " , toolbars=no,location=no,status=no,scrollbars=yes,width=700, height=500");
}

function openColorPicker(rel,id){
var x=event.x+document.body.scrollLeft + 20;
var y=event.y+document.body.scrollTop + 40;
              
window.open("lib/colorpicker/index.php?id=" + id ,"test","left=" + x + ", top=" + y + " , toolbars=no,location=no,status=no,scrollbars=yes,width=240, height=205");
}

//alert('ImageView.js loaded');
var dom = (document.getElementById) ? true : false;
var ns5 = ((navigator.userAgent.indexOf("Gecko")>-1) && dom) ? true: false;
var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
var ns4 = (document.layers && !dom) ? true : false;
var ie4 = (document.all && !dom) ? true : false;
var nodyn = (!ns5 && !ns4 && !ie4 && !ie5) ? true : false;

// resize fix for ns4
var origWidth, origHeight;
if (ns4) {
	origWidth = window.innerWidth; origHeight = window.innerHeight;
	window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}
// avoid error of passing event object in older browsers
if (nodyn) { event = "nope" }

///////////////////////  CUSTOMIZE HERE   ////////////////////
// settings for tooltip 
// Do you want tip to move when mouse moves over link?
var tipFollowMouse= true;	
// Be sure to set tipWidth wide enough for widest image
var tipWidth= 1;
var offX= 20;	// how far from mouse to show tip
var offY= 20; 
var tipFontFamily= "Verdana, arial, helvetica, sans-serif";
var tipFontSize= "8pt";
// set default text color and background color for tooltip here
// individual tooltips can have their own (set in messages arrays)
// but don't have to
var tipFontColor= "#000000";
var tipBgColor= "#DDECFF"; 
var tipBorderColor= "#000080";
var tipBorderWidth= 1;
var tipBorderStyle= "ridge";
var tipPadding= 4;
// tooltip content goes here (image, description, optional bgColor, optional textcolor)

// multi-dimensional arrays containing: 
// image and text for tooltip
// optional: bgColor and color to be sent to tooltip

////////////////////  END OF CUSTOMIZATION AREA  ///////////////////

// to layout image and text, 2-row table, image centered in top cell
// these go in var tip in doTooltip function
// startStr goes before image, midStr goes between image and text
var startStr = '<table width="' + tipWidth + '"><tr><td align="center" width="100%"><img src="';
var midStr = '" border="0"></td></tr><tr><td valign="top">';
var endStr = '</td></tr></table>';

////////////////////////////////////////////////////////////
//  initTip	- initialization for tooltip.
//		Global variables for tooltip. 
//		Set styles for all but ns4. 
//		Set up mousemove capture if tipFollowMouse set true.
////////////////////////////////////////////////////////////
var tooltip, tipcss;
function initTip() {
//alert('inittip');
	if (nodyn) return;
	tooltip = (ns4)? document.tipDiv.document: (ie4)? document.all['tipDiv']: (ie5||ns5)? document.getElementById('tipDiv'): null;
	tipcss = (ns4)? document.tipDiv: tooltip.style;
	if (ie4||ie5||ns5) {	// ns4 would lose all this on rewrites
		tipcss.width = tipWidth+"px";
		tipcss.fontFamily = tipFontFamily;
		tipcss.fontSize = tipFontSize;
		tipcss.color = tipFontColor;
		tipcss.backgroundColor = tipBgColor;
		tipcss.borderColor = tipBorderColor;
		tipcss.borderWidth = tipBorderWidth+"px";
		tipcss.padding = tipPadding+"px";
		tipcss.borderStyle = tipBorderStyle;
	}
	if (tooltip&&tipFollowMouse) {
		if (ns4) document.captureEvents(Event.MOUSEMOVE);
		document.onmousemove = trackMouse;
	}
}

//window.onload = initTip

/////////////////////////////////////////////////
//  doTooltip function
//			Assembles content for tooltip and writes 
//			it to tipDiv
/////////////////////////////////////////////////
var t1,t2;	// for setTimeouts
var tipOn = false;	// check if over tooltip link
function doTooltip(evt,num) {
//alert('doToolTip');
var start = initTip();
//alert(num);
	if (!tooltip) return;
	if (t1) clearTimeout(t1);	if (t2) clearTimeout(t2);
	tipOn = true;
	// set colors if included in messages array
//	if (num[2])	var curBgColor = num[2];
//	else curBgColor = tipBgColor;
	curBgColor = tipBgColor;
//	if (num[3])	var curFontColor = num[3];
//	else curFontColor = tipFontColor;
	curFontColor = tipFontColor;
	if (ns4) {
		var tip = '<table bgcolor="' + tipBorderColor + '" width="' + tipWidth + '" cellspacing="0" cellpadding="' + tipBorderWidth + '" border="0"><tr><td><table bgcolor="' + curBgColor + '" width="100%" cellspacing="0" cellpadding="' + tipPadding + '" border="0"><tr><td>'+ startStr + num + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + num + '</span>' + endStr + '</td></tr></table></td></tr></table>';
		tooltip.write(tip);
		tooltip.close();
	} else if (ie4||ie5||ns5) {

		var tip = startStr + num + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + '</span>' + endStr;
		tipcss.backgroundColor = curBgColor;
	 	tooltip.innerHTML = tip;
	}
	if (!tipFollowMouse) positionTip(evt);
	else t1=setTimeout("tipcss.visibility='visible'",100);

}



var mouseX, mouseY;
function trackMouse(evt) {
	mouseX = (ns4||ns5)? evt.pageX: window.event.clientX + document.body.scrollLeft;
	mouseY = (ns4||ns5)? evt.pageY: window.event.clientY + document.body.scrollTop;
	if (tipOn) positionTip(evt);
}

/////////////////////////////////////////////////////////////
//  positionTip function
//		If tipFollowMouse set false, so trackMouse function
//		not being used, get position of mouseover event.
//		Calculations use mouseover event position, 
//		offset amounts and tooltip width to position
//		tooltip within window.
/////////////////////////////////////////////////////////////
function positionTip(evt) {
//alert('positionTip');
	if (!tipFollowMouse) {
		mouseX = (ns4||ns5)? evt.pageX: window.event.clientX + document.body.scrollLeft;
		mouseY = (ns4||ns5)? evt.pageY: window.event.clientY + document.body.scrollTop;
	}
	// tooltip width and height
	var tpWd = (ns4)? tooltip.width: (ie4||ie5)? tooltip.clientWidth: tooltip.offsetWidth;
	var tpHt = (ns4)? tooltip.height: (ie4||ie5)? tooltip.clientHeight: tooltip.offsetHeight;
	// document area in view (subtract scrollbar width for ns)
	var winWd = (ns4||ns5)? window.innerWidth-20+window.pageXOffset: document.body.clientWidth+document.body.scrollLeft;
	var winHt = (ns4||ns5)? window.innerHeight-20+window.pageYOffset: document.body.clientHeight+document.body.scrollTop;
	// check mouse position against tip and window dimensions
	// and position the tooltip 

	 tipcss.left = (ns4)? mouseX+offX: mouseX+offX+"px";
	if ((mouseY+offY+tpHt)>winHt) 
		tipcss.top = (ns4)? winHt-(tpHt+offY): winHt-(tpHt+offY)+"px";
	else tipcss.top = (ns4)? mouseY+offY: mouseY+offY+"px";
	if (!tipFollowMouse) t1=setTimeout("tipcss.visibility='visible'",100);
}

function hideTip() {
//alert('hideTip');
	if (!tooltip) return;
	t2=setTimeout("tipcss.visibility='hidden'",100);
	tipOn = false;
}

function getPDFDialog(){
var x=event.x+document.body.scrollLeft + 20;
var y=event.y+document.body.scrollTop + 40;

var url ="../abbo/includes/creteMasterPDF.php";
window.open(url,'test','left=550, top=400, width=' + 350 + ', height=' + 230 + ',scrollbars=yes');
}

function changeLanguage(id,path,prefix) 
  {
   lang=id.value;
  var expdate = new Date();
  expdate.setTime(expdate.getTime() +  (24 * 60 * 60 * 1000 * 365)); 
  location.href=prefix +"includes/cookie.php?type=set&cookie=CMSLang&value=" +lang+"&path="+path;

  }

  function CleanWord( html )
{

	html = html.replace(/<o:p>\s*<\/o:p>/g, "") ;
	html = html.replace(/<o:p>.*?<\/o:p>/g, "&nbsp;") ;
	
	// Remove mso-xxx styles.
	html = html.replace( /\s*mso-[^:]+:[^;"]+;?/gi, "" ) ;

	// Remove margin styles.
	html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*;/gi, "" ) ;
	html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*"/gi, "\"" ) ;

	html = html.replace( /\s*TEXT-INDENT: 0cm\s*;/gi, "" ) ;
	html = html.replace( /\s*TEXT-INDENT: 0cm\s*"/gi, "\"" ) ;

	html = html.replace( /\s*TEXT-ALIGN: [^\s;]+;?"/gi, "\"" ) ;

	html = html.replace( /\s*PAGE-BREAK-BEFORE: [^\s;]+;?"/gi, "\"" ) ;

	html = html.replace( /\s*FONT-VARIANT: [^\s;]+;?"/gi, "\"" ) ;

	html = html.replace( /\s*tab-stops:[^;"]*;?/gi, "" ) ;
	html = html.replace( /\s*tab-stops:[^"]*/gi, "" ) ;

	// Remove FONT face attributes.
	
		html = html.replace( /\s*face="[^"]*"/gi, "" ) ;
		html = html.replace( /\s*face=[^ >]*/gi, "" ) ;

		html = html.replace( /\s*FONT-FAMILY:[^;"]*;?/gi, "" ) ;
	
	// Remove Class attributes
	html = html.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3") ;

	// Remove styles.
		html = html.replace( /<(\w[^>]*) style="([^\"]*)"([^>]*)/gi, "<$1$3" ) ;

	// Remove empty styles.
	html =  html.replace( /\s*style="\s*"/gi, '' ) ;
	
	html = html.replace( /<SPAN\s*[^>]*>\s*&nbsp;\s*<\/SPAN>/gi, '&nbsp;' ) ;
	
	html = html.replace( /<SPAN\s*[^>]*><\/SPAN>/gi, '' ) ;
	
	// Remove Lang attributes
	html = html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ;
	
	html = html.replace( /<SPAN\s*>(.*?)<\/SPAN>/gi, '$1' ) ;
	
	html = html.replace( /<FONT\s*>(.*?)<\/FONT>/gi, '$1' ) ;

	// Remove XML elements and declarations
	html = html.replace(/<\\?\?xml[^>]*>/gi, "") ;
	
	// Remove Tags with XML namespace declarations: <o:p></o:p>
	html = html.replace(/<\/?\w+:[^>]*>/gi, "") ;
	
	html = html.replace( /<H\d>\s*<\/H\d>/gi, '' ) ;

	html = html.replace( /<H1([^>]*)>/gi, '<div$1><b><font size="6">' ) ;
	html = html.replace( /<H2([^>]*)>/gi, '<div$1><b><font size="5">' ) ;
	html = html.replace( /<H3([^>]*)>/gi, '<div$1><b><font size="4">' ) ;
	html = html.replace( /<H4([^>]*)>/gi, '<div$1><b><font size="3">' ) ;
	html = html.replace( /<H5([^>]*)>/gi, '<div$1><b><font size="2">' ) ;
	html = html.replace( /<H6([^>]*)>/gi, '<div$1><b><font size="1">' ) ;

	html = html.replace( /<\/H\d>/gi, '</font></b></div>' ) ;
	
	html = html.replace( /<(U|I|STRIKE)>&nbsp;<\/\1>/g, '&nbsp;' ) ;

	// Remove empty tags (three times, just to be sure).
	html = html.replace( /<([^\s>]+)[^>]*>\s*<\/\1>/g, '' ) ;
	html = html.replace( /<([^\s>]+)[^>]*>\s*<\/\1>/g, '' ) ;
	html = html.replace( /<([^\s>]+)[^>]*>\s*<\/\1>/g, '' ) ;

	// Transform <P> to <DIV>
	var re = new RegExp("(<P)([^>]*>.*?)(<\/P>)","gi") ;	// Different because of a IE 5.0 error
	html = html.replace( re, "<div$2</div>" ) ;

	return html ;
}

/* gm funktioner*/
function showComp(id){

if(id=="2"){

	document.getElementById('fnavn').style.visibility="hidden";
	document.getElementById('fnavn').style.display="none";
	document.getElementById('fnavntd').style.display="none";
	document.getElementById('fnavntd2').style.display="none";
	document.getElementById('lnavn').style.visibility="hidden";
	document.getElementById('lnavn').style.display="none";
	document.getElementById('lnavntd').style.display="none";
	document.getElementById('lnavntd2').style.display="none";
	document.getElementById('birthtd').style.display="none";
	document.getElementById('birthtd2').style.display="none";
	document.getElementById('bdate').style.visibility="hidden";
	document.getElementById('bdate').style.display="none";
	document.getElementById('tlftd').style.display="none";
	document.getElementById('tlftd2').style.display="none";
	document.getElementById('emailtd').style.display="none";
	document.getElementById('emailtd2').style.display="none";
	document.getElementById('mobiltd').style.display="none";
	document.getElementById('mobiltd2').style.display="none";


	document.getElementById('compnavntd').style.display="inline";
	document.getElementById('compnavntd2').style.display="inline";
	document.getElementById('dirnavntd').style.display="inline";
	document.getElementById('dirnavntd2').style.display="inline";
	document.getElementById('dirbirthtd').style.display="inline";
	document.getElementById('dirbirthtd2').style.display="inline";
	document.getElementById('comptlftd').style.display="inline";
	document.getElementById('comptlftd2').style.display="inline";
	document.getElementById('compemailtd').style.display="inline";
	document.getElementById('compemailtd2').style.display="inline";
	document.getElementById('compmobiltd').style.display="inline";
	document.getElementById('compmobiltd2').style.display="inline";

}else{
	document.getElementById('fnavn').style.visibility="visible";
	document.getElementById('fnavn').style.display="inline";
	document.getElementById('fnavntd').style.display="inline";
	document.getElementById('fnavntd2').style.display="inline";
	document.getElementById('lnavntd').style.display="inline";
	document.getElementById('lnavntd2').style.display="inline";
	document.getElementById('lnavn').style.visibility="visible";
	document.getElementById('lnavn').style.display="inline";
	document.getElementById('birthtd').style.display="inline";
	document.getElementById('birthtd2').style.display="inline";
	document.getElementById('bdate').style.visibility="visible";
	document.getElementById('bdate').style.display="inline";
	document.getElementById('tlftd').style.display="inline";
	document.getElementById('tlftd2').style.display="inline";
	document.getElementById('emailtd').style.display="inline";
	document.getElementById('emailtd2').style.display="inline";
	document.getElementById('mobiltd').style.display="inline";
	document.getElementById('mobiltd2').style.display="inline";


	document.getElementById('compnavntd').style.display="none";
	document.getElementById('compnavntd2').style.display="none";
	document.getElementById('dirnavntd').style.display="none";
	document.getElementById('dirnavntd2').style.display="none";
	document.getElementById('dirbirthtd').style.display="none";
	document.getElementById('dirbirthtd2').style.display="none";
	document.getElementById('comptlftd').style.display="none";
	document.getElementById('comptlftd2').style.display="none";
	document.getElementById('compemailtd').style.display="none";
	document.getElementById('compemailtd2').style.display="none";
	document.getElementById('compmobiltd').style.display="none";
	document.getElementById('compmobiltd2').style.display="none";

}

}
