// Functions


function removeElem(obj){
	document.getElementById(obj).name="hidden";
	document.getElementById(obj).style.visibility="hidden";
	document.getElementById(obj).style.display="none";
}


function dispHidden(){
	var myparent = document.getElementById("newsListItems");
	var myparentChilds = myparent.childNodes;
	for(var x = 0; x < myparentChilds.length; x++){
		if(myparentChilds[x].name=="hidden"){
			myparentChilds[x].style.visibility="visible";
			myparentChilds[x].style.display="block";
			myparentChilds[x].name="";
		}		
	}
}

function toggle( targetId ){
  if (document.getElementById){
		  target = document.getElementById( targetId );
			  if (target.className == 'nodisplay'){
				  target.className = '';
			  } else {
				  target.className = 'nodisplay';
			  }
	  }
}

function copyRight(){
  	var curdate = new Date();
	var year = curdate.getFullYear();
	var curdate = new Date();
	dstring = curdate.toGMTString(); //full day,month,year,time
	document.write("&copy;" + year + " Bayer Health Care. All Rights Reserved")	
}

function removeElement(obj)   {
   var elem = document.getElementById(obj);
   elem.parentNode.removeChild(elem);
}

function replaceElement(parent,type,id) {
	var elem = document.getElementById(parent);
	var newElem = document.createElement(type);
	var oldElem = document.getElementById(id);
	//elem.appendChild(newElem);
	oldElem.parentNode.replaceChild(newElem,oldElem);
	newElem = newElem.id=id;
}


function addElement(parent,type,id,value,inner) {
	var elem = document.getElementById(parent);
	var newElem = document.createElement(type);
	
	//var parElem = document.getElementById(id);
		elem.appendChild(newElem);
		
		/* Assign values, name, label, inner */
			newElem.id=id;
			newElem.setAttribute('value',value);
			newElem.setAttribute('name',value);
			newElem.innerHTML = inner;
}


//////////////////////////////////
// CREATE THE FLASH COMPONENTS //
/////////////////////////////////
function getFlash(url, width, height) {
	var flashout="";
	
	if(DetectFlashVer(8,0,0)) {
		flashout += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="100%" height="100%" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" id="bsp" >';
		flashout += '<param name="allowScriptAccess" value="sameDomain" />';
		flashout += '<param name="quality" value="high">';
		flashout += '<param name="movie" value="'+url+'" />';
		flashout += '<param name="wmode" value="transparent" />';
		flashout += '<param name="bgcolor" value="#ff0000" />';
		flashout += '<embed src="'+url+'" width="'+width+'" height="'+height+'"   quality="high" wmode="transparent" bgcolor="#ff0000" name="name" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>';
		flashout += '</object>';
	} else {
		// flashout += '<img src="/images/" alt="">';
		flashout += '';
	}
	
	document.getElementById('flvObj').innerHTML = flashout + "<i>output</i>";
}

function set_language(lang) {
	window.location = lang;	
}