function OpenWindow(link){
	window.open(link,"mywindow","status=0,toolbar=1,width=980,height=650");
}


function tab(id,page_id,n) {
	if(document.getElementById('my_pageid'))
		document.getElementById('my_pageid').innerHTML = id+'_'+page_id; 
	if(document.getElementById('my_path'))
		document.getElementById('my_path').innerHTML = id+'|'+page_id+'|'+n;
	
	var tab;
	for(var i=1; i; i++) {
		tab = document.getElementById("tab_"+i);
		if(!tab)
			break;
		if(i==n)
			tab.style.display="block";
		else
			tab.style.display="none";
	}
}



function hide_image_gallery(gid) {
	document.getElementById("gallery").style.display="none";
}

function show_image_gallery(gid,n,up) {
	var images = document.getElementById(gid).innerHTML.split("|-|");
	var htmlcode = "";
	var buttons = "";
	var imgonclick = "";
	imagedata = images[n-1].split("^");
	
	
	
	
	if(n>1) {
		buttons += "<img src=\""+DirParent+"system/images/btn_back.gif\" onclick=\"show_image_gallery('"+gid+"','"+(n-1)+"')\"></td>";
	}
	buttons += "</td><td align=\"center\">"+imagedata[1]+"\u00a0</td>";
	if(n<images.length-1) {
		buttons += "<td align=\"right\" width=\"53\"><img src=\""+DirParent+"system/images/btn_stop.gif\" onclick=\"hide_image_gallery()\" style=\"margin-right:3px;\"><img src=\""+DirParent+"system/images/btn_next.gif\" onclick=\"show_image_gallery('"+gid+"','"+(n-(-1))+"')\">";
		imgonclick = "show_image_gallery('"+gid+"', '"+(n-(-1))+"')";
	}
	else {
		buttons += "<td align=\"right\" width=\"30\"><img src=\""+DirParent+"system/images/btn_stop.gif\" onclick=\"hide_image_gallery('"+gid+"')\"> ";
		"hide_image_gallery('"+gid+"')";
		imgonclick = "hide_image_gallery('"+gid+"')";
	}
	
	
	htmlcode = "<div style=\"cursor:move; background-color:white;\"><div style=\"padding:10px 10px 5px 10px;\"><img id=\"galleryimg\" onclick=\""+imgonclick+"\" src=\""+imagedata[0]+"\">"+
				"<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%;\" style=\"margin-top:5px;\"><tr>"+
				"<td align=\"left\" width=\"30\">"+buttons+"</td></tr></table></div></div>";
	
	
	
	var scroll = getScrollXY();
	var div = document.getElementById("gallery");
	div.innerHTML = '<table cellpadding="0" cellspacing="0"><tr><td class="r_ul"><img src="'+DirParent+'system/images/spacer.gif" style="width:13px; height:13px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+DirParent+'system/images/rohul.png\', sizingMethod=\'scale\');"></td><td class="r_u"><img src="'+DirParent+'system/images/spacer.gif" style="width:100%; height:13px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+DirParent+'system/images/rohu.png\', sizingMethod=\'scale\');"></td><td class="r_ur"><img src="'+DirParent+'system/images/spacer.gif" style="width:13px; height:13px;filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+DirParent+'system/images/rohur.png\', sizingMethod=\'scale\');"></td></tr><tr><td class="r_l"><img src="content/images/spacer.gif" style="height:100%; width:13px;filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'content/images/rohl.png\', sizingMethod=\'scale\');"></td><td align="center" class="loadbg" width="300" height="300" id="div_hidden_content">'+htmlcode+'</td><td class="r_r"><img src="content/images/spacer.gif" style="height:100%; width:13px;filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'content/images/rohr.png\', sizingMethod=\'scale\');"></td></tr><tr><td class="r_dl"><img src="content/images/spacer.gif" style="width:13px; height:13px;filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'content/images/rohdl.png\', sizingMethod=\'scale\');"></td><td class="r_d"><img src="content/images/spacer.gif" style="width:100%; height:13px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'content/images/rohd.png\', sizingMethod=\'scale\');"></td><td class="r_dr"><img src="content/images/spacer.gif" style="width:13px; height:13px;filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'content/images/rohdr.png\', sizingMethod=\'scale\');"></td></tr></table>';
	
//	div.innerHTML = htmlcode;
	
	div.style.top = (Math.round((getClientHeight()-imagedata[3])/2)-50-(-scroll[1]))+"px";
	div.style.left = (Math.round((getClientWidth()-imagedata[2])/2)-(-scroll[0]))+"px";
	div.style.display="block";
	
	Drag.init(div);
}

function getClientWidth() {
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
}

function getClientHeight() {
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
}


function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return [ scrOfX, scrOfY ];
}


var min_hint_width = 300;

function hint(title,description) {


    document.getElementById('hint_title').innerHTML = title;
    document.getElementById('hint_text').innerHTML = description;
    if(document.getElementById('hint').style.display=="block") {
	    document.getElementById('hint').style.display = "none";  
    }
    else{
    	document.getElementById('hint').style.display = "block";  
    	if(!title){document.getElementById('hint_title').style.display="none";}
    }
    
    if(xMousePos>document.body.offsetWidth-min_hint_width)
        xMousePos=document.body.offsetWidth-min_hint_width-10;
    
    document.getElementById('hint').style.left = (xMousePos-10)+"px";
    document.getElementById('hint').style.top = (yMousePos+5)+"px";
    
    hide = false;
}
function hintHide() {
	document.getElementById('hint').style.display = "none";
}

var xMousePos=0;
var yMousePos=0;
var xMousePosMax=0;
var yMousePosMax=0;


if (document.layers) { // Netscape
    document.captureEvents(Event.MOUSEMOVE);
	document.onmousedown = captureMousePosition;
} else if (document.all) { // Internet Explorer
	document.onmousedown = captureMousePosition;
} else if (document.getElementById) { // Netscape 6
	document.onmousedown = captureMousePosition;
}

function captureMousePosition(e) {
    if (document.layers) {
        xMousePos = e.pageX;
        yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset;
        yMousePosMax = window.innerHeight+window.pageYOffset;
    } else if (document.all) {
        xMousePos = window.event.x+document.body.scrollLeft;
        yMousePos = window.event.y+document.body.scrollTop;
        xMousePosMax = document.body.clientWidth+document.body.scrollLeft;
        yMousePosMax = document.body.clientHeight+document.body.scrollTop;
    } else if (document.getElementById) {
        xMousePos = e.pageX;
        yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset;
        yMousePosMax = window.innerHeight+window.pageYOffset;
    }
		
	xMousePos = document.all ? window.event.clientX : e.pageX;
	yMousePos = document.all ? window.event.clientY : e.pageY;
		
}


/**************************************************
 * dom-drag.js
 * 09.25.2001
 * www.youngpup.net
 * Script featured on Dynamic Drive (http://www.dynamicdrive.com) 12.08.2005
 **************************************************
 * 10.28.2001 - fixed minor bug where events
 * sometimes fired off the handle, not the root.
 **************************************************/

var Drag = {

	obj : null,

	init : function(o, oRoot, minX, maxX, minY, maxY, bSwapHorzRef, bSwapVertRef, fXMapper, fYMapper)
	{
		o.onmousedown	= Drag.start;

		o.hmode			= bSwapHorzRef ? false : true ;
		o.vmode			= bSwapVertRef ? false : true ;

		o.root = oRoot && oRoot != null ? oRoot : o ;

		if (o.hmode  && isNaN(parseInt(o.root.style.left  ))) o.root.style.left   = "0px";
		if (o.vmode  && isNaN(parseInt(o.root.style.top   ))) o.root.style.top    = "0px";
		if (!o.hmode && isNaN(parseInt(o.root.style.right ))) o.root.style.right  = "0px";
		if (!o.vmode && isNaN(parseInt(o.root.style.bottom))) o.root.style.bottom = "0px";

		o.minX	= typeof minX != 'undefined' ? minX : null;
		o.minY	= typeof minY != 'undefined' ? minY : null;
		o.maxX	= typeof maxX != 'undefined' ? maxX : null;
		o.maxY	= typeof maxY != 'undefined' ? maxY : null;

		o.xMapper = fXMapper ? fXMapper : null;
		o.yMapper = fYMapper ? fYMapper : null;

		o.root.onDragStart	= new Function();
		o.root.onDragEnd	= new Function();
		o.root.onDrag		= new Function();
	},

	start : function(e)
	{
		var o = Drag.obj = this;
		e = Drag.fixE(e);
		var y = parseInt(o.vmode ? o.root.style.top  : o.root.style.bottom);
		var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right );
		o.root.onDragStart(x, y);

		o.lastMouseX	= e.clientX;
		o.lastMouseY	= e.clientY;

		if (o.hmode) {
			if (o.minX != null)	o.minMouseX	= e.clientX - x + o.minX;
			if (o.maxX != null)	o.maxMouseX	= o.minMouseX + o.maxX - o.minX;
		} else {
			if (o.minX != null) o.maxMouseX = -o.minX + e.clientX + x;
			if (o.maxX != null) o.minMouseX = -o.maxX + e.clientX + x;
		}

		if (o.vmode) {
			if (o.minY != null)	o.minMouseY	= e.clientY - y + o.minY;
			if (o.maxY != null)	o.maxMouseY	= o.minMouseY + o.maxY - o.minY;
		} else {
			if (o.minY != null) o.maxMouseY = -o.minY + e.clientY + y;
			if (o.maxY != null) o.minMouseY = -o.maxY + e.clientY + y;
		}

		document.onmousemove	= Drag.drag;
		document.onmouseup		= Drag.end;

		return false;
	},

	drag : function(e)
	{
		e = Drag.fixE(e);
		var o = Drag.obj;

		var ey	= e.clientY;
		var ex	= e.clientX;
		var y = parseInt(o.vmode ? o.root.style.top  : o.root.style.bottom);
		var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right );
		var nx, ny;

		if (o.minX != null) ex = o.hmode ? Math.max(ex, o.minMouseX) : Math.min(ex, o.maxMouseX);
		if (o.maxX != null) ex = o.hmode ? Math.min(ex, o.maxMouseX) : Math.max(ex, o.minMouseX);
		if (o.minY != null) ey = o.vmode ? Math.max(ey, o.minMouseY) : Math.min(ey, o.maxMouseY);
		if (o.maxY != null) ey = o.vmode ? Math.min(ey, o.maxMouseY) : Math.max(ey, o.minMouseY);

		nx = x + ((ex - o.lastMouseX) * (o.hmode ? 1 : -1));
		ny = y + ((ey - o.lastMouseY) * (o.vmode ? 1 : -1));

		if (o.xMapper)		nx = o.xMapper(y)
		else if (o.yMapper)	ny = o.yMapper(x)

		Drag.obj.root.style[o.hmode ? "left" : "right"] = nx + "px";
		Drag.obj.root.style[o.vmode ? "top" : "bottom"] = ny + "px";
		Drag.obj.lastMouseX	= ex;
		Drag.obj.lastMouseY	= ey;

		Drag.obj.root.onDrag(nx, ny);
		return false;
	},

	end : function()
	{
		document.onmousemove = null;
		document.onmouseup   = null;
		Drag.obj.root.onDragEnd(	parseInt(Drag.obj.root.style[Drag.obj.hmode ? "left" : "right"]), 
									parseInt(Drag.obj.root.style[Drag.obj.vmode ? "top" : "bottom"]));
		Drag.obj = null;
	},

	fixE : function(e)
	{
		if (typeof e == 'undefined') e = window.event;
		if (typeof e.layerX == 'undefined') e.layerX = e.offsetX;
		if (typeof e.layerY == 'undefined') e.layerY = e.offsetY;
		return e;
	}
};








		var growl_opac=0; var growl_over=0; var growl_ok = 0;
		
		function g_setOpacity(el, value) { el.style.opacity = value/10; el.style.filter = "alpha(opacity=" + value*10 + ")"; }
		function g_growlOK(text, title, icon) { g_growl_show(text, title, icon, 1); }
		function g_growl(text, title, icon) { g_growl_show(text, title, icon, 0); }
		function g_growl_show(text, title, icon, ok) {
			growl_ok = ok;
			var div_g_growl = document.getElementById("div_g_growl");
			var td_text = document.getElementById("td_text");
			var td_icon = document.getElementById("td_icon");
			
			td_text.innerHTML = text;
			td_icon.innerHTML = '<img src="'+icon+'">';

			  var myWidth = 0, myHeight = 0;
			  if( typeof( window.innerWidth ) == "number" ) {
			    myWidth = window.innerWidth;
			    myHeight = window.innerHeight;
			  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			
			    myWidth = document.documentElement.clientWidth;
			    myHeight = document.documentElement.clientHeight;
			  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			    myWidth = document.body.clientWidth;
			    myHeight = document.body.clientHeight;
			  }

			div_g_growl.style.left=((myWidth-350)/2)+"px";
			div_g_growl.style.top=((myHeight-80)/2)+"px";
		
			growl_opac = 10;
			g_setOpacity(div_g_growl, growl_opac);
			div_g_growl.style.display="block";
		
			setTimeout("g_growl_opacity()",2000);
		}
		
		function g_growl_opacity() {
			if(growl_ok==1) return;
			var div_g_growl = document.getElementById("div_g_growl");
			if(growl_over==1) return;
			if(growl_opac==0) {
				div_g_growl.style.display="none";
			}
			else {
				g_setOpacity(div_g_growl, growl_opac);
				setTimeout("g_growl_opacity()",50);
				growl_opac-=1;
			}
		}
		
		function g_growl_out() {
			if(div_g_growl.style.backgroundImage.indexOf("black_bg_square.png")>0)
				return;
			growl_over=0;
			setTimeout("g_growl_opacity()",50);
		}
		
		function g_growl_over() {
			if(div_g_growl.style.backgroundImage.indexOf("black_bg_square.png")>0)
				return;
			growl_over=1;
			growl_opac = 10;
			g_setOpacity(div_g_growl, growl_opac);
		}