function shirtinator()
{
    window.open('shirtinator.html','','width=759,height=525');
}

// Funktion fuer nichtdragunddrop
function gotoSheet(sid) {
    window.open(DIRECTORY_INDEX+'/output_references.html?sheet_id='+sid,'','width=880,height=680');
}


var currentunav='';
function showUNav(nid) {
    if (currentunav && document.getElementById('unav'+currentunav)) {
        document.getElementById('unav'+currentunav).style.display='none';
        document.getElementById('tablenav'+currentunav).className='navigation_l2';
    }
    if (nid && nid!=currentunav && document.getElementById('unav'+nid)) {
        document.getElementById('unav'+nid).style.display='block';
        document.getElementById('tablenav'+nid).className='navigation_l2_ua';
    }
    if (nid && nid==currentunav) {
        currentunav='';
    } else {
        currentunav=nid;
    }
}

function underline(obj) {
    obj.childNodes[0].style.textDecoration='underline';
}

function unline(obj) {
    obj.childNodes[0].style.textDecoration='none';
}


// Popup Blocker Script
var _controller = false;
var control_time = 2000;
var global_url = "";

function openPopup(url,name,width,height) {
    global_url = url;

    var _width = 377;
    var _height = 513;
    var _left = 100;
    var _top = 100;

    if(width) _width = width;
    if(height) _height = height;

    var _parameter = "width="+_width+",height="+_height+",left="+_left+" ,top="+_top+", resizable=1";

    var winX = window.open(url,name,_parameter);

    if (!winX) {
        location.href = url;
    }
    //window.setTimeout("checkOpenPopup()", control_time);
}

// Popup Blocker Check
function checkOpenPopup()
{
    if (!_controller) {
        location.href = global_url;
    }
}



function highlightBox(obj) {
    obj.className='highlightBox';

}
function unlightBox(obj) {
    obj.className='unlightBox';
}




// Referenzen Drag&Drop

// Referenzen Drag&Drop - Variablen Deklaration
var aktiv;
var mask      = 750;                        // div mask width
var content   = 7200;                       // content width (img width, ...)
var limit_con = content - mask;             // content right limit
var limit_bar = 626;                        // scrollbar right limit
var relation  = limit_con / limit_bar;      // Verhältniss Content / Menue bar
var end       = mask - content;             // negatives content right limit
var d_status  = 0;
//window.setInterval("moveContent(0)",1000);
//moveContent(0);
// Referenzen Drag&Drop - function controls scrolling
function moveContent(dir)
{
    // left direction
    if (dir == 1) {
        aktiv = window.setInterval("moveDiv(+5)", 5);
    // right direction
    } else {
        aktiv = window.setInterval("moveDiv(-5)", 5);
    }
}

// Referenzen Drag&Drop - function clears interval (stop scrolling)
function stopContent()
{
    window.clearInterval(aktiv);
}

// Referenzen Drag&Drop - function drag div
function dragDiv(e)
{
    if(d_status) jumpContent(e);
}

// Referenzen Drag&Drop - function allow dragging
function dragStatus(val)
{
    d_status = val;
}

// Referenzen Drag&Drop - function jumps to a position
function jumpContent(e)
{
    var pos1 = showPosLeft('maske') - 30;
    var pos2 = e.clientX;
    var diff = pos2 - pos1 - 92;

    if(diff < 0) diff = 0;
    if(diff > 626) diff = 626;

    document.getElementById("scrollbar").style.left = diff;
    diff = parseInt(diff * relation * -1);

    document.getElementById("content").style.left = diff;
}

// Referenzen Drag&Drop - function scroll div
function moveDiv(val)
{
    var cpos    = document.getElementById("content").style.left; // div current left position e.g. 0px
    cpos        = cpos.split("px");  // split
    cpos        = parseInt(cpos[0]); // (int) position
    var newpos  = parseInt(cpos + val); // (int) new value == cpos + function value

    // end
    if (newpos <= end) {
        newpos = end; // stop right side
    }

    if (newpos >= 0) {
        newpos = 0;  // stop left side
    }

    moveScroll(newpos);

    // move div
    document.getElementById("content").style.left = newpos;
}

// Referenzen Drag&Drop - scroller bewegen
function moveScroll(newpos)
{
    newpos = newpos * -1;
    newpos = parseInt(newpos / relation);

    document.getElementById("scrollbar").style.left = newpos;
}







	function showPosLeft(elementname) {
		var left = 0;
        if (document.getElementById(elementname)) {
            var pos=document.getElementById(elementname);
		} else { // elementname ist Objekt
            var pos=elementname;
			left = left + pos.offsetLeft;
        }
        while (pos.offsetParent!=null) {
			pos=pos.offsetParent;
			left = left + pos.offsetLeft;
		}
		return left
	}

	function showPosTop(elementname) {

		var y = 0;
        if (document.getElementById(elementname)) {
            var pos=document.getElementById(elementname);
		} else { // elementname ist Objekt
            var pos=elementname;
            y= y + pos.offsetTop;
        }
        while (pos.offsetParent!=null) {
			pos=pos.offsetParent;
            y= y + pos.offsetTop;
		}
    	return y
	}


        // zB. nav-Mouseover
        function changeImage(id,src) {
            document.getElementById(id).src = src;
        }
        
        // zB. Teaserboxen
        function changeBackground(id,color) {
            document.getElementById(id).style.background = color;
        }
        


        function changeLocation(turl, ttarget) {
            switch (ttarget) {
                case '_self':
                    document.location.href=turl;
                break;
                default:
                    window.open(turl);
                break;
            }
        }

 
        function changeBgColor(id, color) {
        	document.getElementById(id).style.background = color;
        }


 

