// Created by E Karnitsch for TerraNetwork 2007-June-04

function prepareHiddenInformation() {
	if (!document.getElementById) return false;
      if($xCheck == false) return false; 	
	
	document.getElementById('descriptionDiv').style.display = "block"; 
	document.getElementById("xsellDiv").style.display = "none";  	
		
	var $navigation = document.createElement("ul");
	var $desc_nav = document.getElementById("desc_nav");
	$desc_nav.appendChild($navigation);
	
	var $dsc = document.createElement("li");
	$dsc.className='active'; 
	$navigation.appendChild($dsc);
	
	var $xsl = document.createElement("li");
	$xsl.className='inactive'; 
	$navigation.appendChild($xsl);
      
      
	var $dsc_link = document.createElement("a");
	      $dsc_link.setAttribute("href",'#');
		$dsc_link.onclick = function () {	// give the link an action when it is clicked. This action is as follows:
	                 	$dsc.className='active';
	                 	$xsl.className='inactive'; 
	                  document.getElementById('descriptionDiv').style.display = "block";  
                        document.getElementById('xsellDiv').style.display = "none"; 
                        return false; 			            
		}	

	
	var $xsl_link = document.createElement("a");
	      $xsl_link.setAttribute("href",'#');
		$xsl_link.onclick = function () {	// give the link an action when it is clicked. This action is as follows:
	                 $xsl.className='active';
	                 $dsc.className='inactive';  
	                 document.getElementById('xsellDiv').style.display = "block"; 
		           document.getElementById('descriptionDiv').style.display = "none";    
                       return false;                  	
		}      
      		
		
	$dsc.appendChild($dsc_link);		
	$xsl.appendChild($xsl_link);	
	
	$dsc_pad = $dsc_link.appendChild(document.createElement('span'));
	$dsc_pad.className='pad';
	
	$xsl_pad = $xsl_link.appendChild(document.createElement('span'));
	$xsl_pad.className='pad';	
	
	var $dsc_txt = document.createTextNode("Description");
	$dsc_pad.appendChild($dsc_txt);
	
	var $xsl_txt = document.createTextNode("Related Products");
	$xsl_pad.appendChild($xsl_txt);

}

function getCss() {
      if(document.getElementsByTagName) {
      // create link to js only stylesheet
      var $link_element = document.createElement("link");
      $link_element.setAttribute("rel","stylesheet");
      $link_element.setAttribute("href","styles/xsell.css");
      
      // Append stylesheet
      var $head_element = document.getElementsByTagName("head")[0];
      $head_element.appendChild($link_element);
      }
}

// Executes the prepareHiddenInformation function when page loads
window.onload = function() {
	prepareHiddenInformation();
	getCss();
}


