/* Check if function fName exists, TH 2011-12-12 */
function function_exists(fName, pObj) {
  if(!pObj) pObj = window;
  return (typeof pObj[fName] == 'function') ? true : false;
}

/* ################################# */
/* ######### CSS Functions ######### */
/* ################################# */

/* Check CSS class, FH 2007-06-28 */
function rs_addClass (o, c) {
    var rv = true;

    if (rs_checkClass (o, c)) {
        rv = false;
    } else {
        o.className = o.className + " " + c;
        rv = true;
    }
    o.className.replace(/^\s+|\s+$/g,"");
    return rv;
}

/* Remove CSS class, FH 2007-06-28 */
function rs_removeClass (o, c) {
    var rv = true;
    if (rs_checkClass (o, c)) {
        var c2 = o.className.split(" ");
        var c3 = "";
        for (var i = 0; i < c2.length; ++i) {
            o.className = o.className + " " + c;
            if (c2[i] != c)
            c3 = c3 + " " + c2[i];
        }
        o.className = c3;
        rv = true;
    } else {
        rv = false;
    }
    o.className = o.className.replace(/^\s+|\s+$/g,"");
    return rv;
}

/* Check CSS class, FH 2007-06-28 */
function rs_checkClass (o, c) {
    var rv = false;
    if (typeof o.className == "string")
    {
        var c2 = o.className.split(" ");
        for (var i = 0; i < c.length; ++i) {
            if (c2[i] == c) {
                rv = true;
            }
        }
    }
    return rv;
}


/* ################################# */
/* ########### Multipage ########### */
/* ################################# */

/* Multipage Init, FH 2008-06-09 */
function rs_multipage_init ( container_id )
{
    container = document.getElementById( container_id );
    rs_addClass(container, "multipage");
    current_page = 0;

    var navigation = document.createElement("ul");
    rs_addClass(navigation, "nav");

    pages = [];
    var page_counter = -1;
    var body_counter = 0;
    for (var i=0;i<container.childNodes.length;i++)
    {
        if (rs_checkClass(container.childNodes[i], "multipage-title"))
        {
            page_counter++;
            pages[page_counter] = [];

            pages[page_counter]['id'] = container.childNodes[i].id;
            if (window.location.hash == "#" + pages[page_counter]['id'])
            {
                current_page = page_counter;
            }

            pages[page_counter]['title'] = container.childNodes[i];
            pages[page_counter]['title'].style.display = "none";

            pages[page_counter]['nav_link'] = document.createElement ("a");
            pages[page_counter]['nav_link'].innerHTML = pages[page_counter]['title'].innerHTML;
            pages[page_counter]['nav_link'].href = "#" + pages[page_counter]['id'];
            pages[page_counter]['nav_link'].nr = page_counter;
            pages[page_counter]['nav_link'].onclick = function () {
                rs_multipage_show (this.nr);
                if (pages[this.nr]['id'] != "")
                {
                    window.location.hash = pages[this.nr]['id'];
                }
                return false;
            }

            pages[page_counter]['nav_list_item'] = document.createElement ("li");
            pages[page_counter]['nav_list_item'].appendChild ( pages[page_counter]['nav_link'] );

            navigation.appendChild ( pages[page_counter]['nav_list_item'] );

            pages[page_counter]['pages'] = [];
            body_counter = 0;
        }
        if (rs_checkClass(container.childNodes[i], "multipage-body"))
        {
            pages[page_counter]['pages'][body_counter] = container.childNodes[i];
            pages[page_counter]['pages'][body_counter].style.display = "none";
            rs_addClass(pages[page_counter]['pages'][body_counter], "body");
            body_counter++;
        }
    }

    container.insertBefore ( navigation , container.firstChild );
    rs_addClass ( container , "multipages-" + pages.length );

    rs_multipage_show(current_page);
}

/* Multipage Show, FH 2008-06-09 */
function rs_multipage_show ( page_nr )
{
    for (var i=0;i<pages.length;i++)
    {
        if (i==page_nr)
        {
            rs_addClass(pages[i]['nav_list_item'], "current")
        }
        else
        {
            rs_removeClass(pages[i]['nav_list_item'], "current");
        }
        for (var j=0;j<pages[i]['pages'].length;j++)
        {
            pages[i]['pages'][j].style.display = (i==page_nr?"":"none");
        }
    }
}

/* Old Multipage */
document.multipage=new Array;

/* Show multipage, FH 2007-06-28 */
function multipage_show (multipage_id,page_id) {
    hide (document.multipage[multipage_id]);
    rs_removeClass(document.getElementById(document.multipage[multipage_id] + "_link"), "current");
    for(i=1;i<=10;i++) {
        if (rs_checkClass(document.getElementById(document.multipage[multipage_id] + "_link"), "nav_" + i + "_current")) {
            rs_removeClass(document.getElementById(document.multipage[multipage_id] + "_link"), "nav_" + i + "_current");
        }
    }
    document.multipage[multipage_id] = multipage_id + "_" + page_id;
    show (document.multipage[multipage_id]);
    rs_addClass(document.getElementById(multipage_id + "_" + page_id + "_link"), "current");
    for(i=1;i<=10;i++) {
        if (rs_checkClass(document.getElementById(multipage_id + "_" + page_id + "_link"), "nav_" + i)) {
            rs_addClass(document.getElementById(multipage_id + "_" + page_id + "_link"), "nav_" + i + "_current");
        }
    }
}


/* ################################# */
/* ######## Collapsing Area ######## */
/* ################################# */

function collapsing_area_collapse(areaid) {
    document.getElementById(areaid + "_link").className = 'collapsing_area-plus';
    document.getElementById(areaid).style.display = 'none';
}

function collapsing_area_expand(areaid) {
    document.getElementById(areaid + "_link").className = 'collapsing_area-minus';
    document.getElementById(areaid).style.display = '';
}
function collapsing_area(areaid) {
    if (document.getElementById(areaid + "_link").className != 'collapsing_area-plus') {
        collapsing_area_collapse(areaid);
    } else {
        collapsing_area_expand(areaid);
    }
}


function show (id) {
    document.getElementById(id).style.display = '';
}

function hide (id) {
    document.getElementById(id).style.display = 'none';
}

function ie_hover(obj,hov,tag) {
    if (obj) {
        if (hov == 1)
            obj.className+=" "+tag;
        else
            obj.className=obj.className.replace(tag,"");
    }
}

function loadRSFrameset (docNav,docURL,docWebsite) {
}

function rs_scrolling(idprefix, count) {
    document.scrolling = document.scrolling + count;
    if (document.scrolling > document.scrolling_count-3) {
        document.scrolling = document.scrolling_count-3;
    }
    if (document.scrolling < 0) {
        document.scrolling = 0;
    }

    if (document.scrolling <= 0) {
        rs_addClass(document.getElementById(idprefix + "_scrolling_prev"),"menu-prev-disable");
    } else {
        rs_removeClass(document.getElementById(idprefix + "_scrolling_prev"),"menu-prev-disable");
    }

    if (document.scrolling >= document.scrolling_count-3) {
        rs_addClass(document.getElementById(idprefix + "_scrolling_next"),"menu-next-disable");
    } else {
        rs_removeClass(document.getElementById(idprefix + "_scrolling_next"),"menu-next-disable");
    }

    for (i=0;i<document.scrolling_count;i++) {
        if ((i < document.scrolling) || (i > document.scrolling + 2)) {
            hide (idprefix + "_id" + i + "_link");
        }
        if ((i >= document.scrolling) && (i <= document.scrolling + 2)) {
            document.getElementById(idprefix + "_id" + i + "_link").style.display = "inline";
        }
    }
}

function rs_highlight_initialize(idprefix, count) {
    document.scrolling = 0;
    document.scrolling_count = count;

    document.multipage[idprefix] = idprefix + '_id0';
    multipage_show (idprefix,'id0');
    show (idprefix + '_nav');

    if (document.scrolling_count > 1) {
        for (i=1;i<document.scrolling_count;i++) {
            hide (idprefix + '_id' + i);
        }
    }
    if (document.scrolling_count > 3) {
        for (i=3;i<document.scrolling_count;i++) {
            hide (idprefix + '_id' + i + '_link');
        }
    }

    rs_addClass(document.getElementById(idprefix + "_scrolling_prev"),"menu-prev-disable");

}

/* ################################# */
/* ########### Old RSLIB ########### */
/* ################################# */

// Browsererkennung
{
    var old,skn;
    var agt=navigator.userAgent.toLowerCase();
    var win = ((agt.indexOf("win")!=-1) || (agt.indexOf("32bit")!=-1));
    var mac = (agt.indexOf("mac")!=-1);
    var ns  = (navigator.appName.indexOf("Netscape") != -1);
    var ns4 = document.layers;
    var ns6 = document.getElementById&&!document.all;
    var ie4 = document.all;
    var exclude=true;
    var ie=false;
    var ie4=false;
    var ie5=false;
    var op5=false;
    var konqi=false;
    if (document.all&&(agt.indexOf('msie')!=-1))
    {
        ie=true;
        ie4=true;
        exclude=false;
        if (agt.indexOf('msie 4')==-1)
        {
            ie5=true;
            ie4=false;
        }
        if (agt.indexOf('opera')!=-1)
        {
            ie=false;
            ie4=false;
            ie5=false;
            op5=true;
        }
    }
    var ns6=false;
    var mz7=false;
    if (document.getElementById&&!ie)
    {
        ns6=true;
        exclude=false;
        if (agt.indexOf('netscape6')==-1)
        {
            ns6=false;
            mz7=true;
        }
        if (window.opera)
        {
            mz7=false;
            op5=true;
        }
        else if (agt.indexOf('gecko')==-1)
        {
            mz7=false;
            exclude=true;
        }
    }
    if (agt.indexOf('opera 4')!=-1)
    {
        op5=false;
        mz7=false;
        exclude=true;
    }
    var ns4=false;
    if ((agt.indexOf('mozilla')!=-1)&&(parseInt(navigator.appVersion)>=4)&&!ie&&!op5&&!ns6&&!mz7)
    {
        ns4=true;
        exclude=false;
    }
    if (agt.indexOf('webtv')!=-1)
    {
        ie=false;
        ie4=false;
        exclude=true;
    }

    win=true;
    mac=false;
    if (agt.indexOf('mac')!=-1)
    {
        win=false;
        mac=true;
    }
    // code to find Konqueror
    if (navigator.vendor)
    {
        if (navigator.vendor =="KDE")
        {
            ie=false;
            ie4=false;
            ie5=false;
            konqi = true;
            ns6=true;
            ns4 = false;
            exclude = false;
            // exclude earlier than kde2.2
            var thisKDE=agt;
            var splitKDE=thisKDE.split("konqueror/");
            var aKDE=splitKDE[1].split("; ");
            var KDEn=parseFloat(aKDE[0]);
            var oldKde=false;
            if(KDEn<2.2)
            {
                oldKde=true;exclude=true;ns6=false;konqi=false;
            }
        }
    }
    // differentiate between opera 5 and 6
    var op6=false;
    if(op5)
    {
        if((agt.indexOf("opera 6")!=-1)||(agt.indexOf("opera/6")!=-1))
        {
            op6=true;
            op5=false;
        }
    }
    var iex = ie;
}

// cell rollover functions
function mover(cell, bgColor) {
if (!cell.contains(event.fromElement)) {
cell.style.cursor = 'hand';
if (bgColor == null) {
cell.bgColor = 'CC9900';
} else {
cell.bgColor = bgColor;
}
}
}

// cell rollover mouseout functions
function mout(cell, bgColor) {
if (!cell.contains(event.toElement)) {
cell.style.cursor = 'default';
if (bgColor == null) {
cell.bgColor = 'FCE698';
} else {
cell.bgColor = bgColor;
}
}
}

// cell rollover onClick functions
function mclick(cell) {
if(event.srcElement.tagName=='TD') {
cell.children.tags('A')[0].click();
}
}

// open a new window
function openWindow(url, wname, attrib) {
var f1 = null ;
if (attrib==null) attrib="width=500,height=480,dependent=true,titlebar=no,menubar=no,locationbar=no,resizable=yes,status=no";
f1 = window.open(url, wname, attrib);
}

// open a new window with variable size
function openSizedWindow(url, wname, width, height) {
var f1 = null ;
 f1 = window.open(url, wname, "width=" + width + ",height=" + height + ",dependent=true,titlebar=no,menubar=no,locationbar=no,resizable=yes,status=no");
}

function openExtraSizedWindow(u,t,w,h,x,y) {
var f1 = null ;

if (u != null) {
if (t == null) t = document.title;
if (w == null) w = 500;
if (h == null) h = 515;
if (x == null) x = ""; else x = ",left=" + x;
if (y == null) y = ""; else y = ",top=" + y;

f1 = window.open(u, t, 'width=' + w + ',height=' + h + x + y + ',dependent=true,titlebar=no,menubar=no,locationbar=no,resizable=yes,status=no');
}
}

// create readable URL
function translate_url(string) {
while (string.search("&") > 0) {
string=string.replace("&","_AND_");
}
while (string.search("=") > 0) {
string=string.replace("=","_IS_");
}
return string;
}

function MM_swapImgRestore() {
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() {
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_findObj(n, d) {
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() {
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

// Plugin-Detection
function plugin_detect(theplugin) {
var pluginlist;
function detectIE(ClassID,name) {
result = false;
document.write('<SCRIPT LANGUAGE=VBScript>\n on error resume next \n result = IsObject(CreateObject("' + ClassID + '"))</SCR'+'IPT>\n');
if (result) return name+','; else return '';
}
function detectNS(ClassID,name) {
n = "";
if (nse.indexOf(ClassID) != -1) if (navigator.mimeTypes[ClassID].enabledPlugin != null) n = name+","; return n;
}
if (ie && win) {
pluginlist = detectIE("Adobe.SVGCtl","SVG Viewer") + detectIE("SWCtl.SWCtl.1","Shockwave Director") + detectIE("ShockwaveFlash.ShockwaveFlash.1","Shockwave Flash") + detectIE("rmocx.RealPlayer G2 Control.1","RealPlayer") + detectIE("QuickTimeCheckObject.QuickTimeCheck.1","QuickTime") + detectIE("MediaPlayer.MediaPlayer.1","Windows Media Player") + detectIE("PDF.PdfCtrl.5","Acrobat Reader");
}
if (ns || !win) {
nse = ""; for (var i=0;i<navigator.mimeTypes.length;i++) nse += navigator.mimeTypes[i].type.toLowerCase();
pluginlist = detectNS("image/svg-xml","SVG Viewer") + detectNS("application/x-director","Shockwave Director") + detectNS("application/x-shockwave-flash","Shockwave Flash") + detectNS("audio/x-pn-realaudio-plugin","RealPlayer") + detectNS("video/quicktime","QuickTime") + detectNS("application/x-mplayer2","Windows Media Player") + detectNS("application/pdf","Acrobat Reader");
}
pluginlist += navigator.javaEnabled() ? "Java," : "";
if (pluginlist.length > 0) pluginlist = pluginlist.substring(0,pluginlist.length-1);
return (pluginlist.indexOf(theplugin)!=-1);
}

function loadpopupvars() {
  Xoffset=-60;    // modify these values to ...
  Yoffset= 20;    // change the popup position.
  yyy=-1000;
  if (ns4) {
    skn=document.dek;
  } else if (ns6) {
    skn=document.getElementById("dek").style;
  } else if (ie4) {
    skn=document.all.dek.style;
  }
  if(ns4) {
    document.captureEvents(Event.MOUSEMOVE);
  } else {
    skn.visibility="visible"
    skn.display="none"
  }
  document.onmousemove=get_mouse;
}
function popup(msg,bak,mywidth){
  if (!mywidth) mywidth = 200;
  if (!skn) loadpopupvars();
  if (ns4) {
    if (bak) {
      otherbg = " bgcolor=\"" + bak + "\"";
    } else {
      otherbg = "";
    }
    var content="<table width=\"" + mywidth + "\" border=\"1\" bordercolor=\"#003399\" cellpadding=\"1\" cellspacing=\"0\"><td" + otherbg + "><font face=\"Arial,Verdana,Helvetica\">"+msg+"</font></td></table>";
  } else {
    if (bak) {
      otherbg = " style=\"background: " + bak + ";\"";
    } else {
      otherbg = "";
    }
    var content="<table width=\"" + mywidth + "\" border=\"1\" bordercolor=\"#003399\" cellpadding=\"1\" cellspacing=\"0\"><td class=\"tablecontent\"" + otherbg + ">"+msg+"</td></table>";
  }
  yyy=Yoffset;
  if(ns4){skn.document.write(content);skn.document.close();skn.visibility="visible"}
  if(ns6){document.getElementById("dek").innerHTML=content;skn.display=''}
  if(ie4){document.all("dek").innerHTML=content;skn.display=''}
}
function get_mouse(e){
  var x=(ns4||ns6)?e.pageX:event.x+document.body.scrollLeft;
  skn.left=x+Xoffset;
  var y=(ns4||ns6)?e.pageY:event.y+document.body.scrollTop;
  skn.top=y+yyy;
}
function kill(){
  yyy=-1000;
  if(ns4) {
    skn.visibility="hidden";
  } else if (ns6||ie4) {
    skn.display="none";
  }
}
function jump_product(product,section,value)
{
var valuelist = value.options[value.selectedIndex].value;
var valueitem = valuelist.split("|");
if (value.selectedIndex > 0) {
if (valueitem.length == 1) {
if (parent.producthead.location.href != valueitem[0]) {
parent.productcontent.location.href = valueitem[0];
}
} else if (valueitem.length == 2) {
newURL = "/www/dev_center.nsf/productframeset?Openagent&product=" + product + "&quickbar1=" + escape(valuelist) + "&quickbar1submit=GO";
parent.location.href = newURL;
} else if (newtarget.length ==3) {
parent.location.href = newtarget[0];
}
}
//value.selectedIndex=0;
}
function openFBForm(t,p) {
var f1 = null ;

if (t == null) t = document.title;
if (p == null) p = ""; else p = "&product=" + p;

f1 = window.open("http://www.rohde-schwarz.com/www/response.nsf/productcontactForm?OpenForm&title=" + t + p + "&url=" + location.href + "&target=window", "FormWindow", 'width=700,height=515,dependent=true,titlebar=no,menubar=no,locationbar=no,resizable=yes,status=no,scrollbars=yes');
}
function mark_all(string,query,starttag,endtag) {
  string_final = "";
  string_work = string;
  var RegExpQuery = eval("/" + query + "/i");
  while (string_work.search(RegExpQuery) > -1) {
    string_left = "<>" + string_final + string_work.substr(0,string_work.search(RegExpQuery))
    if (string_left.lastIndexOf(">") > string_left.lastIndexOf("<")) {
      string_final = string_final + string_work.substr(0,string_work.search(RegExpQuery)) + starttag + string_work.substr(string_work.search(RegExpQuery),query.length) + endtag;
      string_work = string_work.substring(string_work.search(RegExpQuery) + query.length,string_work.length);
    } else {
      string_final = string_final + string_work.substr(0,string_work.search(RegExpQuery)) + string_work.substr(string_work.search(RegExpQuery),query.length);
      string_work = string_work.substring(string_work.search(RegExpQuery) + query.length,string_work.length);
    }
  }
  string_final = string_final + string_work;
  return string_final;
}
function markquery(queryvalue) {
  new_content = original_content;
  new_content = mark_all(new_content,queryvalue,"<span class=\"foundtext\">","</span>");
  document.all.pagecontent.innerHTML = new_content;
}
function highlight_query(query_string) {
  query=unescape(query_string);
  query=query.substr(1, query.length-1)
  paare=query.split("&")
  sitesearch = "";
  for (i = 0; i < paare.length; i++) {
    paar=paare[i].split("=");
    if (paar[0] == "Highlight") {
      highlight=paar[1].split(",");
      sitesearch = highlight[1];
    }
  }
  if (document.all && (sitesearch != "")) {
    original_content = document.all.pagecontent.innerHTML;
    markquery(sitesearch);
  }
  if ((docNavig != "") && (sitesearch != "")) {
    parent.frames["navig"].location.href = docNavig + "?OpenDocument&noredirect=no";
  }
}


// variable with cookie name for shop
var shopcn = "RSShop";
var shopvisible = true;
var configuratorcn = "RSConfigurator";
var configuratorvisible = true;


// get cookie value
function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
// set a cookie
function SetCookie(name,value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}
// get cookie
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 DeleteCookie(name) {
var expdate = new Date();
expdate.setTime(expdate.getTime() - 1);
var cookieval = GetCookie(name);
if (cookieval != null) {
SetCookie(name,"1",expdate);
}
}
// open the shop window
function openShopWindow(item) {
var wn = "RSShop";
var loadApplet = false;
var cw = GetCookie(shopcn);
if (cw == null) {
loadApplet = true;
} else {
var w = window.open("",wn);
if ((w.document.title == "Rohde & Schwarz Shop") && (w.document.RSShopApplet)) {
w.document.RSShopApplet.onHTMLEvent("/Sachnummern = " + item);
} else {
w.close();
loadApplet = true;
}
}
if (loadApplet) {
var expDays = 1;
var expdate = new Date();
expdate.setTime(expdate.getTime() + (expDays*24*60*60*1000));
SetCookie(shopcn,"1",expdate,"/");
var w = openExtraSizedWindow("http://www2.rohde-schwarz.com/live/rs/product/product_list/shop/wb.php?prodid=" + item,wn,620,200,Math.floor((screen.width-600)/2),Math.floor((screen.height-200)/2));
}
}
function load_product(product) {
location.href = "/product/" + product;
}
function openConfiguratorWindow(item) {
var wn = "RSConfigurator";
var loadApplet = false;
var cw = GetCookie(configuratorcn);
if (cw == null) {
loadApplet = true;
} else {
var w = window.open("",wn);
if ((w.document.title == "Rohde & Schwarz Configurator") && (w.document.RSConfiguratorApplet)) {
// w.document.RSConfiguratorApplet.onHTMLEvent("/Sachnummern = " + item);
} else {
w.close();
loadApplet = true;
}
}
if (loadApplet) {
var expDays = 1;
var expdate = new Date();
expdate.setTime(expdate.getTime() + (expDays*24*60*60*1000));
SetCookie(configuratorcn,"1",expdate,"/");
var w = openExtraSizedWindow("/www/dev_center.nsf/configurator_" + item + ".html",wn,620,250,Math.floor((screen.width-600)/2),Math.floor((screen.height-200)/2));
}
}
function openSolutionFinderWindow(params) {
//var queryString = "?OpenForm";
var queryString = "?";
  //var urlBase = "/www/dev_center.nsf/product-configuration.html";
var urlBase = "http://www2.rohde-schwarz.com/live/rs/camos/configurator/product-configurator.php";
var j=0;
for ( var i=0; i < openSolutionFinderWindow.arguments.length; i++ ) {
j = i+1;
queryString = queryString + "&p" + j + "=" + openSolutionFinderWindow.arguments[i];
}
var wn = "RSConfigurator";
var loadApplet = false;
var cw = GetCookie(configuratorcn);
if (cw == null) {
loadApplet = true;
} else {
var w = window.open("",wn);
//if ((w.document.title == "Rohde & Schwarz Solution Finder") && (w.document.RSConfiguratorApplet)) {
//alert(typeof w);
if ( w != null ) {
if (w.document.RSConfiguratorApplet) {
// w.document.RSConfiguratorApplet.onHTMLEvent("/Sachnummern = " + item);
} else {
w.close();
loadApplet = true;
}
}
}
if (loadApplet) {
var expDays = 1;
var expdate = new Date();
expdate.setTime(expdate.getTime() + (expDays*24*60*60*1000));
SetCookie(configuratorcn,"1",expdate,"/");
var w = openExtraSizedWindow(urlBase + queryString ,wn,620,420,Math.floor((screen.width-600)/2),Math.floor((screen.height-200)/2));
} else {
//;
}
}
  function showhide_div(divid) {
  o_div = document.getElementById(divid);
  i_div = document.getElementById("img_" + divid);
  if (o_div.style.display == "") {
  o_div.style.display = "none";
if (i_div) i_div.src = "/images/expand.gif";
  } else {
  o_div.style.display = "";
if (i_div) i_div.src = "/images/collapse.gif";
  }
  }

/*
    Die neuen Seiten sollen nicht innerhalb eines Framesets angezeigt werden
*/
if (!ie) {
    if(window.name=='content') {
        document.write ("<link type=\"text/css\" rel=\"stylesheet\" href=\"/live/rs/internet/styles/framed.css\" media=\"screen\" />");
    }
}

function discontinued_products() {
    if (document.getElementById("discontinued_products_title").className != 'plus') {
        document.getElementById("discontinued_products_title").className = 'plus';
        document.getElementById("discontinued_products_content").style.display = 'none';
    } else {
        document.getElementById("discontinued_products_title").className = 'minus';
        document.getElementById("discontinued_products_content").style.display = 'block';
    }
}

function report_a_bug() {
    // popup
    BugReportWindow = window.open("/live/rs/internet/clickdummy/report_a_bug.html", "report_a_bug", "width=480,height=540,dependent=true,titlebar=no,menubar=no,locationbar=no,resizable=yes,status=yes");
    BugReportWindow.focus();
}

/************/
/* Tool Tip */
/************/

objToolTip = null;

document.onmousemove = updateToolTip;

function updateToolTip(e) {
    if (!e) e = window.event;
    if (document.getElementById("page"))
    {
        x = e.clientX - document.getElementById("page").offsetLeft;
        y = e.clientY;
        if (objToolTip != null) {
            objToolTip.style.left = (x + 15) + "px";
            objToolTip.style.top 	= (y + 15) + "px";
        }
    }
}

function showToolTip(id) {
    objToolTip = document.getElementById(id);
    objToolTip.style.display = "block"
}

function hideToolTip() {
    objToolTip.style.display = "none";
}

function switchTab (mp,c)
{
    $(mp).getChildren().each(function(el){
        if (el.tagName == "TBODY")
        {
            if (el.id == c)
            {
                el.style.display = "";
                $('tab-' + el.id).className = "tab-current";
            }
            else
            {
                el.style.display = "none";
                $('tab-' + el.id).className = "tab";
            }
        }
    });
}

function hover (o,h)
{
    if (h)
    {
        $(o).addClass('hover');
    } else {
        $(o).removeClass('hover');
    }
}

function gup( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}

function rsContactLink (l, d)
{
    if (!d) d = 'rohde-schwazr.com';
    var m = l + '&#64;' + d;
    document.write('<a href="mai' + 'lto:' + m + '">' + m + '</a>');
}

/* SWFObject v2.1 <http://code.google.com/p/swfobject/>
    Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis
    This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return }f(H);if(h.ie&&h.win){try{K.write("<script id=__ie_ondomload defer=true src=//:><\/script>");J=C("__ie_ondomload");if(J){I(J,"onreadystatechange",S)}}catch(q){}}if(h.webkit&&typeof K.readyState!=b){Z=setInterval(function(){if(/loaded|complete/.test(K.readyState)){E()}},10)}if(typeof K.addEventListener!=b){K.addEventListener("DOMContentLoaded",E,null)}R(E)}();function S(){if(J.readyState=="complete"){J.parentNode.removeChild(J);E()}}function E(){if(e){return }if(h.ie&&h.win){var v=a("span");try{var u=K.getElementsByTagName("body")[0].appendChild(v);u.parentNode.removeChild(u)}catch(w){return }}e=true;if(Z){clearInterval(Z);Z=null}var q=o.length;for(var r=0;r<q;r++){o[r]()}}function f(q){if(e){q()}else{o[o.length]=q}}function R(r){if(typeof j.addEventListener!=b){j.addEventListener("load",r,false)}else{if(typeof K.addEventListener!=b){K.addEventListener("load",r,false)}else{if(typeof j.attachEvent!=b){I(j,"onload",r)}else{if(typeof j.onload=="function"){var q=j.onload;j.onload=function(){q();r()}}else{j.onload=r}}}}}function H(){var t=N.length;for(var q=0;q<t;q++){var u=N[q].id;if(h.pv[0]>0){var r=C(u);if(r){N[q].width=r.getAttribute("width")?r.getAttribute("width"):"0";N[q].height=r.getAttribute("height")?r.getAttribute("height"):"0";if(c(N[q].swfVersion)){if(h.webkit&&h.webkit<312){Y(r)}W(u,true)}else{if(N[q].expressInstall&&!A&&c("6.0.65")&&(h.win||h.mac)){k(N[q])}else{O(r)}}}}else{W(u,true)}}}function Y(t){var q=t.getElementsByTagName(Q)[0];if(q){var w=a("embed"),y=q.attributes;if(y){var v=y.length;for(var u=0;u<v;u++){if(y[u].nodeName=="DATA"){w.setAttribute("src",y[u].nodeValue)}else{w.setAttribute(y[u].nodeName,y[u].nodeValue)}}}var x=q.childNodes;if(x){var z=x.length;for(var r=0;r<z;r++){if(x[r].nodeType==1&&x[r].nodeName=="PARAM"){w.setAttribute(x[r].getAttribute("name"),x[r].getAttribute("value"))}}}t.parentNode.replaceChild(w,t)}}function k(w){A=true;var u=C(w.id);if(u){if(w.altContentId){var y=C(w.altContentId);if(y){M=y;l=w.altContentId}}else{M=G(u)}if(!(/%$/.test(w.width))&&parseInt(w.width,10)<310){w.width="310"}if(!(/%$/.test(w.height))&&parseInt(w.height,10)<137){w.height="137"}K.title=K.title.slice(0,47)+" - Flash Player Installation";var z=h.ie&&h.win?"ActiveX":"PlugIn",q=K.title,r="MMredirectURL="+j.location+"&MMplayerType="+z+"&MMdoctitle="+q,x=w.id;if(h.ie&&h.win&&u.readyState!=4){var t=a("div");x+="SWFObjectNew";t.setAttribute("id",x);u.parentNode.insertBefore(t,u);u.style.display="none";var v=function(){u.parentNode.removeChild(u)};I(j,"onload",v)}U({data:w.expressInstall,id:m,width:w.width,height:w.height},{flashvars:r},x)}}function O(t){if(h.ie&&h.win&&t.readyState!=4){var r=a("div");t.parentNode.insertBefore(r,t);r.parentNode.replaceChild(G(t),r);t.style.display="none";var q=function(){t.parentNode.removeChild(t)};I(j,"onload",q)}else{t.parentNode.replaceChild(G(t),t)}}function G(v){var u=a("div");if(h.win&&h.ie){u.innerHTML=v.innerHTML}else{var r=v.getElementsByTagName(Q)[0];if(r){var w=r.childNodes;if(w){var q=w.length;for(var t=0;t<q;t++){if(!(w[t].nodeType==1&&w[t].nodeName=="PARAM")&&!(w[t].nodeType==8)){u.appendChild(w[t].cloneNode(true))}}}}}return u}function U(AG,AE,t){var q,v=C(t);if(v){if(typeof AG.id==b){AG.id=t}if(h.ie&&h.win){var AF="";for(var AB in AG){if(AG[AB]!=Object.prototype[AB]){if(AB.toLowerCase()=="data"){AE.movie=AG[AB]}else{if(AB.toLowerCase()=="styleclass"){AF+=' class="'+AG[AB]+'"'}else{if(AB.toLowerCase()!="classid"){AF+=" "+AB+'="'+AG[AB]+'"'}}}}}var AD="";for(var AA in AE){if(AE[AA]!=Object.prototype[AA]){AD+='<param name="'+AA+'" value="'+AE[AA]+'" />'}}v.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AF+">"+AD+"</object>";i[i.length]=AG.id;q=C(AG.id)}else{if(h.webkit&&h.webkit<312){var AC=a("embed");AC.setAttribute("type",P);for(var z in AG){if(AG[z]!=Object.prototype[z]){if(z.toLowerCase()=="data"){AC.setAttribute("src",AG[z])}else{if(z.toLowerCase()=="styleclass"){AC.setAttribute("class",AG[z])}else{if(z.toLowerCase()!="classid"){AC.setAttribute(z,AG[z])}}}}}for(var y in AE){if(AE[y]!=Object.prototype[y]){if(y.toLowerCase()!="movie"){AC.setAttribute(y,AE[y])}}}v.parentNode.replaceChild(AC,v);q=AC}else{var u=a(Q);u.setAttribute("type",P);for(var x in AG){if(AG[x]!=Object.prototype[x]){if(x.toLowerCase()=="styleclass"){u.setAttribute("class",AG[x])}else{if(x.toLowerCase()!="classid"){u.setAttribute(x,AG[x])}}}}for(var w in AE){if(AE[w]!=Object.prototype[w]&&w.toLowerCase()!="movie"){F(u,w,AE[w])}}v.parentNode.replaceChild(u,v);q=u}}}return q}function F(t,q,r){var u=a("param");u.setAttribute("name",q);u.setAttribute("value",r);t.appendChild(u)}function X(r){var q=C(r);if(q&&(q.nodeName=="OBJECT"||q.nodeName=="EMBED")){if(h.ie&&h.win){if(q.readyState==4){B(r)}else{j.attachEvent("onload",function(){B(r)})}}else{q.parentNode.removeChild(q)}}}function B(t){var r=C(t);if(r){for(var q in r){if(typeof r[q]=="function"){r[q]=null}}r.parentNode.removeChild(r)}}function C(t){var q=null;try{q=K.getElementById(t)}catch(r){}return q}function a(q){return K.createElement(q)}function I(t,q,r){t.attachEvent(q,r);d[d.length]=[t,q,r]}function c(t){var r=h.pv,q=t.split(".");q[0]=parseInt(q[0],10);q[1]=parseInt(q[1],10)||0;q[2]=parseInt(q[2],10)||0;return(r[0]>q[0]||(r[0]==q[0]&&r[1]>q[1])||(r[0]==q[0]&&r[1]==q[1]&&r[2]>=q[2]))?true:false}function V(v,r){if(h.ie&&h.mac){return }var u=K.getElementsByTagName("head")[0],t=a("style");t.setAttribute("type","text/css");t.setAttribute("media","screen");if(!(h.ie&&h.win)&&typeof K.createTextNode!=b){t.appendChild(K.createTextNode(v+" {"+r+"}"))}u.appendChild(t);if(h.ie&&h.win&&typeof K.styleSheets!=b&&K.styleSheets.length>0){var q=K.styleSheets[K.styleSheets.length-1];if(typeof q.addRule==Q){q.addRule(v,r)}}}function W(t,q){var r=q?"visible":"hidden";if(e&&C(t)){C(t).style.visibility=r}else{V("#"+t,"visibility:"+r)}}function g(s){var r=/[\\\"<>\.;]/;var q=r.exec(s)!=null;return q?encodeURIComponent(s):s}var D=function(){if(h.ie&&h.win){window.attachEvent("onunload",function(){var w=d.length;for(var v=0;v<w;v++){d[v][0].detachEvent(d[v][1],d[v][2])}var t=i.length;for(var u=0;u<t;u++){X(i[u])}for(var r in h){h[r]=null}h=null;for(var q in swfobject){swfobject[q]=null}swfobject=null})}}();return{registerObject:function(u,q,t){if(!h.w3cdom||!u||!q){return }var r={};r.id=u;r.swfVersion=q;r.expressInstall=t?t:false;N[N.length]=r;W(u,false)},getObjectById:function(v){var q=null;if(h.w3cdom){var t=C(v);if(t){var u=t.getElementsByTagName(Q)[0];if(!u||(u&&typeof t.SetVariable!=b)){q=t}else{if(typeof u.SetVariable!=b){q=u}}}}return q},embedSWF:function(x,AE,AB,AD,q,w,r,z,AC){if(!h.w3cdom||!x||!AE||!AB||!AD||!q){return }AB+="";AD+="";if(c(q)){W(AE,false);var AA={};if(AC&&typeof AC===Q){for(var v in AC){if(AC[v]!=Object.prototype[v]){AA[v]=AC[v]}}}AA.data=x;AA.width=AB;AA.height=AD;var y={};if(z&&typeof z===Q){for(var u in z){if(z[u]!=Object.prototype[u]){y[u]=z[u]}}}if(r&&typeof r===Q){for(var t in r){if(r[t]!=Object.prototype[t]){if(typeof y.flashvars!=b){y.flashvars+="&"+t+"="+r[t]}else{y.flashvars=t+"="+r[t]}}}}f(function(){U(AA,y,AE);if(AA.id==AE){W(AE,true)}})}else{if(w&&!A&&c("6.0.65")&&(h.win||h.mac)){A=true;W(AE,false);f(function(){var AF={};AF.id=AF.altContentId=AE;AF.width=AB;AF.height=AD;AF.expressInstall=w;k(AF)})}}},getFlashPlayerVersion:function(){return{major:h.pv[0],minor:h.pv[1],release:h.pv[2]}},hasFlashPlayerVersion:c,createSWF:function(t,r,q){if(h.w3cdom){return U(t,r,q)}else{return undefined}},removeSWF:function(q){if(h.w3cdom){X(q)}},createCSS:function(r,q){if(h.w3cdom){V(r,q)}},addDomLoadEvent:f,addLoadEvent:R,getQueryParamValue:function(v){var u=K.location.search||K.location.hash;if(v==null){return g(u)}if(u){var t=u.substring(1).split("&");for(var r=0;r<t.length;r++){if(t[r].substring(0,t[r].indexOf("="))==v){return g(t[r].substring((t[r].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(A&&M){var q=C(m);if(q){q.parentNode.replaceChild(M,q);if(l){W(l,true);if(h.ie&&h.win){M.style.display="block"}}M=null;l=null;A=false}}}}}();

