<?xml version="1.0" encoding="UTF-8" ?> 
<Module>

  <ModulePrefs title="Fujitsu" 
	       height="400"
	       author_photo="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/fujitsu.png"
	       author_link="http://ts.fujitsu.com/"
	       scrolling="false"> 
         <Locale messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_ALL_ALL.xml"/>

         <Locale country="ch" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_ALL_ALL.xml"/>
         <Locale country="be" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_ALL_ALL.xml"/>
         <Locale country="es" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_es_es.xml"/>
         <Locale country="de" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_de_de.xml"/>
         <Locale country="uk" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_en_uk.xml"/>
         <Locale country="fr" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_fr_fr.xml"/>
         <Locale country="it" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_it_it.xml"/>
         <Locale country="at" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_de_at.xml"/>
         <Locale country="fi" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_fi_fi.xml"/>
         <Locale country="dk" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_da_dk.xml"/>
         <Locale country="se" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_sv_se.xml"/>
         <Locale country="no" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_no_no.xml"/>

         <Locale lang="fr" country="ch" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_ALL_ALL.xml"/>
         <Locale lang="it" country="ch" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_ALL_ALL.xml"/>
         <Locale lang="fr" country="be" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_ALL_ALL.xml"/>
         <Locale lang="es" country="es" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_es_es.xml"/>
         <Locale lang="de" country="de" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_de_de.xml"/>
         <Locale lang="en" country="uk" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_en_uk.xml"/>
         <Locale lang="fr" country="fr" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_fr_fr.xml"/>
         <Locale lang="it" country="it" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_it_it.xml"/>
         <Locale lang="de" country="ch" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_de_ch.xml"/>
         <Locale lang="de" country="at" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_de_at.xml"/>
         <Locale lang="nl" country="be" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_nl_be.xml"/>
         <Locale lang="fi" country="fi" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_fi_fi.xml"/>
         <Locale lang="da" country="dk" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_da_dk.xml"/>
         <Locale lang="sv" country="se" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_sv_se.xml"/>
         <Locale lang="no" country="no" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_no_no.xml"/>

         <Locale lang="en" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_ALL_ALL.xml"/>
         <Locale lang="es" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_es_es.xml"/>
         <Locale lang="de" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_de_de.xml"/>
         <Locale lang="fr" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_fr_fr.xml"/>
         <Locale lang="it" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_it_it.xml"/>
         <Locale lang="fi" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_fi_fi.xml"/>
         <Locale lang="da" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_da_dk.xml"/>
         <Locale lang="sv" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_sv_se.xml"/>
         <Locale lang="no" messages="http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/lang_no_no.xml"/>

    <Require feature="tabs" /> 
    <Require feature="dynamic-height" /> 
	<Require feature="setprefs" />
    <Require feature="com.google.gadgets.analytics" />         
  </ModulePrefs>
  <UserPref name="entries" display_name="Ansicht:" datatype="enum" default_value="gross">
                <EnumValue value="klein" />
                <EnumValue value="gross" />
  </UserPref>

  <Content type="html" view="home,canvas">
  <![CDATA[ 
    
<style>
img{border:0;}
.clear{clear:both;}

body {font-size:62.5%; font-family:Arial,Helvetica,sans-serif; color:#666; background:#dbdbdb url(http://hosting.gmodules.com/ig/gadgets/file/101085857469866421249/location-bg.gif) repeat-x top}


/* Navigation
-----------------------------------------------------------*/
.tablib_table__MODULE_ID__{
width:auto;
border-collapse:separate;
border-spacing:0px;
empty-cells:show;
font-size:0.8em;
font-weight:bold;
text-align:left;
margin-top:1px;

}
.tablib_emptyTab__MODULE_ID__,.tablib_selected__MODULE_ID__,.tablib_unselected__MODULE_ID__, .tablib_spacerTab__MODULE_ID__{
padding:0.3em 0.4em; 
border-color:none; 
border-style:none; 
border-width:0; 
color:#00329b; 
cursor:pointer; 
width:0.3em;
}

.tablib_selected__MODULE_ID__{
background-color:#fff;
border-left:2px solid #d9dbce;
border-right:2px solid #d9dbce;
border-top:1px solid #ccc;
font-weight:bold;
color:#000000;
cursor:default;
}
.tablib_unselected__MODULE_ID__{
padding:0px;
background-color:transparent;
border:none;
width:auto;
cursor:pointer;
}

/* Content
-----------------------------------------------------------*/
#content_bg_left{height:350px; background-color:#fff;}
#content_bg_right{}
#content_big{width:auto; height:349px; overflow:auto;}
#content_small{width:auto; height:160px; margin:0em 0.5em; padding-bottom:0.5em; overflow:auto;}

/* Link
-----------------------------------------------------------*/
a, a:hover, a:visited{text-decoration:none; color:#333333; font-size:1.2em;}
a:hover {text-decoration:underline}
a h1{font-size:1.8em; font-weight:normal; color:#00329b; line-height:0.8em; margin-bottom:0.3em; text-transform:uppercase;}
a h2{font-size:1em; font-weight:normal; color:#00329b; line-height:0.9em; margin-bottom:0.2em; text-transform:uppercase;}

/* Content - Box
-----------------------------------------------------------*/
.box{width:49%;float:left;margin-top:1em; text-align:center;}
.box_cont{width:14em;margin:0 auto;text-align:center;}
.box a{text-decoration:none;border:none;}
.box a img.topimage{width:11em;height:11em;display:block;}
.box a span{clear:both;color:#333333;text-align:left;float:left;}

/* Content - List
-----------------------------------------------------------*/
.list{ margin:0 1em; text-align:left; padding:0.5em 0; border-bottom:1px dotted #ccc;}
.list a{ display: block;}
.list a img {float:left}
.list a span{display:block;margin-left:130px;}
.list a span h1{}
.list a span h2{}

.box_cont{width:auto;margin:0 auto;text-align:center;}
.box a{text-decoration:none;border:none;}

.box a span{padding: 0.2em 1em; clear:both;color:#333333;text-align:left;float:left;}

/* Single
-----------------------------------------------------------*/
.single{margin:0 1em; text-align:left; padding:0.5em 0; text-align:center; }
.single img{}
.single span{text-align:left;}


/* Footer
-----------------------------------------------------------*/
#footer_bg{clear:both; position:absolute; width:100%; left:0; height:20px; background-color:#dbdbdb;border-top:1px solid #666}
#footer{margin-top:0em;padding-top:0.3em;font-size:0.8em;text-align:center;border-top:1px solid #cccccc}

.searchbox { 
  display:block;
  margin-left:130px;
  padding-top:8px;
}

</style>
<script type="text/javascript"> 

var ga = new _IG_GA("UA-8293268-1");
ga.reportPageview('/view/Gadget');
/**
 * Checks if needle is contained inside the array
 * @param {mixed} needle value for test if in array.
 * @return true/false
 * @type boolean
 */
Array.prototype.in_array = function(needle) {
    for(var i=0; i < this.length; i++) if(this[ i] === needle) return true;
    return false;
}
    
/**
 * Holds the tabs.
 */
var tabs = new _IG_Tabs(__MODULE_ID__); 

/**
 * Stores the preferences
 */
var prefs = new _IG_Prefs(__MODULE_ID__);

/**
 * Container for Feed content
 */
var specialList = new Array();

/**
 * Container for Feed content. Only used if random sequence is used.
 */
var specialListTmp = new Array();

/**
 * Status Array. Stores which Feed contents are already loaded.
 * Used only for random sequenced content. 
 */
var fetched = new Array();
//alert(_trim(prefs.getMsg("ned")));
var ned = _trim(prefs.getMsg("ned"));
var feeds = _trim(prefs.getMsg("feeds"));
feeds = feeds.split(',');
var f = new Array();
for(var count = 0; count<feeds.length; count++){
    if(feeds[count] != ''){
        f[count]=_trim(prefs.getMsg(feeds[count]));
		f[count]=f[count].split('||');
		specialList[count]=new Array();
		specialListTmp[count]=new Array();
    }
}


/**
 * initializes the tabs.
 * @see #callbackGenerator
 */
function init() {
	for(var count = 0; count<f.length; count++){
	    tabs.addDynamicTab(f[count][0], callbackGenerator(f[count][1],f[count][2],count));
	}
}

/**
 * compares two integers.
 * @param {int} a first comparison argument
 * @param {int} b second comparison argument
 * @return value <0 if a > b, =0 if a = b and >0 if a < b.
 * @type int
 * @see #randList
 */
function Numsort (a, b) {
    return a - b;
}

/**
 * generates random number in the intervall [0,max) => 0 <= number < max.
 * @param {int} max maximum number
 * @return {int} random number 
 * @see #randList
 */
function rand(max) {
    return Math.floor(Math.random()*max+1)-1;
}

/**
 * generates a random list of entries.
 * @param {int} max maximum entries allowed
 * @param {int} count entries available
 * @return {Array} random list of entries
 * @see #randList
 */
function randList(max,count){
    var RandArray = new Array();
    if(max-1<count) count=max;
    while (RandArray.length < count) {
	var RandNumber = rand(max);
	var ArrayInh = RandArray.join(",");
	if(!ArrayInh.match(RandNumber)) {
	    var temp = RandArray.push(RandNumber);
	}	
    }
    //RandArray.sort(Numsort);
    return RandArray;
}

/**
 * Generates the callback function.
 * @param {string} feedUrl Feed to be loaded
 * @param {int} random if 0 then always same sequence is shown. if 1 then sequence is random on every reload.
 * @param {int} number the feed that is loaded.
 * @return {function} callback function
 * @see #callbackTab
 */
function callbackGenerator(feedUrl,random, number) {
    return function(tabId) {
	callbackTab(tabId, feedUrl, random, number);
    }
}


/**
 * Fills the content for everytime a Tab is selected.
 * @param {string} tabId Tab id
 * @param {string} feedUrl Feed to bee loaded
 * @param {int} random if 0 then always same sequence is shown. if 1 then sequence is random on every reload.
 * @param {int} number the feed that is loaded.
 * @see #callbackGenerator
 * @see #init
 */
function callbackTab(tabId,feedUrl, random, number) {
    ga.reportPageview('/view/Gadget/'+ned+'/'+f[number][0]);
    var entries = prefs.getString("entries");
    /**
     * Sets the Gadget height.
     */
    if(entries == 'klein'){
	_IG_AdjustIFrameHeight(210);
    }else{
	_IG_AdjustIFrameHeight(400);
    }
    var container = _gel(tabId);
    container.innerHTML = '<div class="statusLabel">Loading...</div>';
    _IG_FetchXmlContent(feedUrl, function (response) {
	    if (response == null || typeof(response) != "object" ||
		response.firstChild == null) {
                container.innerHTML = "<i>Invalid data.</i><br>" + feedUrl;
                return;
            }
	    var itemList = response.getElementsByTagName("item");
	    var html = new Array;
	    html.push('<div id="content_bg_left">');
	    html.push('<div id="content_bg_right">');
	    if(entries == 'klein'){
		html.push('<div id="content_small">');
	    }else{
		html.push('<div id="content_big">');
	    }

            var feeds = 0;

            // Loop through all <item> nodes
	    if(!fetched.in_array(number)){
		for(var k = 0; k<itemList.length; k++){
		    specialList[number].push(k);
                }
		if(random == "1"){
		    if(entries == 'klein'){
			specialListTmp[number]=randList(itemList.length,9999);
		    }else{
			specialListTmp[number]=randList(itemList.length,9999);
		    }
		    fetched.push(number);
		}else{
		    specialListTmp[number]=specialList[number];
		    fetched.push(number);
		}
	    }

	    for(var i = 0; i<specialListTmp[number].length; i++){
                var image_flag=false;
                var nodeList = itemList.item(specialList[number][specialListTmp[number][i]]).childNodes;
                var show = false;
                for (var j = 0; j < nodeList.length; j++){
                    var node = nodeList.item(j);
                    if (node.nodeName == "image") {
                        var image = node.firstChild.nodeValue;
                        image_flag = true;
                    }
                    if (node.nodeName == "title") {
                        var title = node.firstChild.nodeValue;
                    }
                    if (node.nodeName == "link") {
                        var link = node.firstChild.nodeValue;
                    }
                    if (node.nodeName == "description") {
                        var description = node.firstChild.nodeValue;
                    }
                    if (node.nodeName == "content:encoded") {
                        var content = node.firstChild.nodeValue;
                    }
                    if (node.nodeName == "class") {
                        var design = node.firstChild.nodeValue;
                        if(i==0){
                            if(design=='list2'){
                                design='list1';
                            }
                            if(design=='search2'){
                                design='search';
                            }
                            
                        }else{
                            if(design=='list1'){
                                design='list2';
                            }
                            if(design=='search'){
                                design='search2';
                            }
                        }
                    }
                    if (node.nodeName == "width") {
                        var width = node.firstChild.nodeValue;
                    }
                    if (node.nodeName == "height") {
                        var height = node.firstChild.nodeValue;
                    }
                    if (node.nodeName == "track") {
                        var track = node.firstChild.nodeValue;
                    }
                    if (node.nodeName == "category") {
                        var category = node.firstChild.nodeValue;
			show = true;
                    }
                }
                if(show){
                    feeds++;i

				if(design == 'list1' || design == 'list2' || design == 'search' || design == 'search2') {
				    html.push('<div class="list">');
				    html.push('<div class="list_cont">');
				}else if (design == 'single'){
				    html.push('<div class="single">');
				    html.push('<div class="single_cont">');
				}else{
				    html.push('<div class="box">');
				    html.push('<div class="box_cont">');
				}

                    if(track != '' && typeof track != 'undefined'){
		      html.push('<a href="'+link+'" target="_blank" onclick="ga.reportPageview(\'/link/Gadget/'+ned+'/'+track+'\');">');
                    }else{
		      html.push('<a href="'+link+'" target="_blank">');
                    }
                    track=undefined;
		    html.push('<img src="'+image+'" style="background-color:#FFFFFF" alt="'+title+'">');
		    html.push('<span>');
		    if(design == 'list1' || design == 'single' || design == 'search') {
			html.push('<h1>'+title+'</h1>');
		    }
		    if(design == 'list2' || design == 'search2') {
			html.push('<h2>'+title+'</h2>');
		    }					
		    if(design == 'single'){
			html.push('<p>' + description + '</p>');
		    }else{
			html.push(description);
		    }
		    html.push('</span>');
		    html.push('</a>');
		    if(design == 'search' || design == 'search2') {
                        html.push('<span class="searchbox">');
			html.push('<form name="fscsearch" action="http://shop.de.ts.fujitsu.com/edealinv/servlet/ExecMacro" method="get" target="_blank">');
			html.push('<input type="hidden" name="nurl" value="control/BrowseCatalog.vm">');
			html.push('<input type="hidden" name="eurl" value="control/BrowseCatalog.vm">');
			html.push('<input type="hidden" name="rurl" value="control/BrowseCatalog.vm">');
			html.push('<input type="hidden" name="ctl_nbr" value="500000040">');
			html.push('<input type="hidden" name="path" value="">');
			html.push('<input type="hidden" name="offset" value="0">');
			html.push('<input type="hidden" name="hits" value="10">');
			html.push('<input type="hidden" name="sortby" value="">');
			html.push('<input type="hidden" name="catParentID" value="">');
			html.push('<input type="hidden" name="catLevel" value="">');
			html.push('<input type="text" name="query" value="">');
			html.push('<input type="submit" name="search" value="search">');
			html.push('</form>');
                        html.push('</span>');
		    }
		    html.push('</div><!-- end box_cont -->');
		    if(design == 'list1' || design == 'list2' || design == 'search' || design == 'search2') {
			html.push('<div class="clear"></div>');
		    }
		    html.push('</div><!-- end box -->');
		    if(feeds % 2 == 0){
			html.push('<div class="clear"></div>');
		    }


                }
                if(feeds==entries) break;
            }
            if(feeds==0){
                html.push('<span class="nothing_found">Nichts gefunden</span>');
            }



	    html.push('</div><!-- end content -->');
	    html.push('<div class="clear"/>');
	    html.push('</div>');
	    html.push('<div class="clear"/>');	
	    html.push('</div>');

	    html.push('<div id="footer_bg">');
	    html.push('<div id="footer">');
	    html.push(' &copy; 2009 Fujitsu Technology Solutions GmbH');
	    html.push('</div>');
	    html.push('</div>');

	    container.innerHTML = html.join('');
	},{ refreshInterval: 1 });
}

// Call init function to initialize and display tabs.
_IG_RegisterOnloadHandler(init);
</script>

  ]]>
  </Content>
</Module>
