function opensyn(url)
{
var synergie=window.open(url,"synergie","resizable=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,fullscreen=no,width=800,height=600,left=10,top=10");
if (synergie.closed){
//alert("1");
}else{
//alert("2");
synergie.focus();
}
return false;
}

function getCookie(customer_id)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(customer_id + "=");
  if (c_start!=-1)
    { 
    c_start=c_start + customer_id.length+1; 
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    } 
  }
return "";
}

function checkCookie()
{
cus=getCookie('customer_id');
role=getCookie('role');

if (cus!=null && cus!="" && role=="PRO")
  {
document.write("<link href='template_css/template_styles_t2.css' rel='stylesheet' />")
  }
else
{
}
}

function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
var path="/";
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString()) + 
( ( path ) ? ";path=" + path : "" ) ;
}

function deleteCookie(name){ 
    if(getCookie(name)){ 
        setCookie(name, '', -30); 
    } 
} 

function controleFr(textalert)
{
count=getCookie('order_count');
if (count!=null && count!="" && count!="0")
  {
alert(textalert);
return false;
  }
else
{
return true;
}
return false;
}

function testmenu2()
{
if (document.getElementById('menu2').className =="current" && document.getElementById('menu_link2').innerHTML =="Commander") 
{ 
document.write("<link href='template_css/template_styles_t4.css' rel='stylesheet' />"); 
} 
}

function testmenu2de()
{
if (document.getElementById('menu2').className =="current" && document.getElementById('menu_link2').innerHTML =="Bestellen") 
{ 
document.write("<link href='template_css/template_styles_t4.css' rel='stylesheet' />"); 
} 
}

<!--
function expandCollapse(elem, changeImage)
{
  if (document.getElementById) {
    echide = document.getElementById("hide");
    ecshow = document.getElementById("show");
    ecBlock = document.getElementById(elem);
    if (ecBlock != undefined && ecBlock != null) {
      if (changeImage) {
        //gets the image associated
        elemImage = document.getElementById(elem + "Image");
      }
      //make sure elemImage is good
      if (!changeImage || (elemImage != undefined && elemImage != null)) {
        if (ecBlock.style.display == "none" || ecBlock.style.display == null || ecBlock.style.display == "") {
          //shows the info.
          ecBlock.style.display = "block";
          if (changeImage) {
            //Just got in expanded mode. Thus, change image to "collapse"
           elemImage.src = "images/sce/up.png";
	//text show/hide
	ecshow.style.display = "none";
	echide.style.display = "block";
          }
        }
        else if (ecBlock.style.display == "block") {
          //hide info
          ecBlock.style.display = "none";
          if (changeImage) {
            //Just got in collapsed mode. Thus, change image to "expand"
            elemImage.src = "images/sce/down.png";
	//text show/hide
	echide.style.display = "none";
	ecshow.style.display = "block";
          }
        }
        else {
          //catch any weird circumstances.
          ecBlock.style.display = "block";
          if (changeImage) {
            elemImage.src = "images/sce/up.png";
          }
        }
      }
      //end check elemImage
    }
    //end check ecBlock
  }
  //end getElemById
}
//end expandCollapse function



function defil (texte)
{
document.write("<marquee id=\"defil-texte\" scrollamount=\"2\" class=\"roto\" loop=\"-1\" height=\"100%\" width=\"100%\" scrolldelay=\"1\" behavior=\"alternate\" onmouseover=\"this.stop()\" onmouseout=\"this.start()\"  >");
document.write (texte);
document.write("</marquee>");
}

function checkloadprod()
{
var intra=getCookie('intra');
if (intra=="oui")
{
document.write("<link href='template_css/template_styles_t4.css' rel='stylesheet' />"); 
var  menu= document.getElementById('menu2');
//alert(menu.className);
menu.className = "current";
color="#78b6ff";;
document.getElementById('menu_link2').style.background=color;
//alert(menu.className);
window.scrollBy(0,600);
setCookie('intra',"non",null);
}
}

function member()
{
cus=getCookie('customer_id');
role=getCookie('role');
if (cus!=null && cus!="" && role=="GP")
  {
   document.write("<link href='/template_css/gp.css' rel='stylesheet' />")
  }
if (cus!=null && cus!="" && role=="PRO")
  {
   document.write("<link href='/template_css/pro.css' rel='stylesheet' />")
  }
}


