	/*if(parent.s2dframe!=1)
	{
		self.location.href="/s2dmain.html?"+self.location.href
	}*/

window.defaultStatus="(c) Avengo! 2004-2009";

function c3(tabName){
 tabName.style.backgroundColor = '#dddddd';
}
function c4(tabName){
 tabName.style.backgroundColor = '';
}


function c1(tabName){
 tabName.bgColor='#dddddd';
}
function c2(tabName){
 tabName.bgColor='';
}




function ga(o,e) {
	if (document.getElementById) {
		a=o.id.substring(1);
		p = "";
		r = "";
		t = "";
		g = e.target;
		if (g) {
			t = g.id;
			f = g.parentNode;
			if (f) {
				p = f.id;
				h = f.parentNode;
				if (h)r = h.id;
			}
		} else {
			//h = e.srcElement;
			//f = h.parentNode;
			//if (f)p = f.id;
			//t = h.id;
		}
		if (t==a || p==a || r==a)
			return true;
			top.location.href=document.getElementById(a).href;
	}
};


function popUp2(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=540,height=570,left = 475,top = 345');");
}

function popUp(URL) {
	day = new Date();
	id = day.getTime();
	ok = window.open(URL, id , 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=710,height=490,left = 300,top = 150');
	//return false;
	//if (ok) return false;
  //else return true;

}


function popUpWithMenu(URL,width,height) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=1,width="+width+",height="+height+",left = 20,top = 20');");
}

function popUpSize(URL,width,height) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width="+width+",height="+height+",left = 20,top = 20');");
}



function welcome(location){
	document.write("<iframe name=\"welcome\" width=100% height=95 frameborder=0 src=\"http://www.avengo.de/tools/shopwelcome.pl?what="+location+"\" marginwidth=\"0\" marginheight=\"0\" vspace=\"0\" hspace=\"0\" allowtransparency=\"true\" scrolling=\"no\"></iframe>");
}

function checkMinMax() {

	try {
	    var min = document.productdata.minimumorder.value;
    	var max = document.productdata.maximumorder.value;
	    var pices = document.productdata.pices.value;



    	if ((min.length()>0) && (max.length()>0)){
	        if ((pices >= min) && (pices <= max)){
    	        return(true);
        	}else{
	            alert("Stückzahl muss zwischen:"+String(min)+" und "+String(max)+" liegen");
    	        return(false);
        	}
	    }
	} catch (e) {
		;	
	}
}

function readCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function createCookie(name,value,days)
{
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/; domain=avengo.de";
}

function eraseCookie(name)
{
	createCookie(name,"",-1);
}


    function showDiv(id) {
        wmtt = document.getElementById(id);
        wmtt.style.display = "block"
    }
    function hideDiv(id) {
        wmtt = document.getElementById(id);
        wmtt.style.display = "none"
    }


    function setWidth (id,value) {
        document.getElementById(id).style.width = value+'%';
        return false;
    }
    function getWidth (id) {
        return document.getElementById(id).style.width;
    }


    // *************** AJAX *******************************
    function xmlhttpPost(strURL,data) {
        var xmlHttpReq = false;
        var self = this;
        // Mozilla/Safari
        if (window.XMLHttpRequest) {
            self.xmlHttpReq = new XMLHttpRequest();
        }
        // IE
        else if (window.ActiveXObject) {
            self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
        }
        self.xmlHttpReq.open('POST', strURL, true);
        self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        self.xmlHttpReq.onreadystatechange = function() {
            if (self.xmlHttpReq.readyState == 4) {
                updatepage(self.xmlHttpReq.responseText);
            }
        }
        self.xmlHttpReq.send('w=' + escape(data));
    }


    function updatepage(str){
        //document.getElementById("result").innerHTML = str;
		//alert(str);
    }

    // *************** AJAX *******************************


