// functions
function flashDefault() {
	document.write('<object id="clsid:D27CDB6E-AE6D-11cf-96B8-416553540000" width="790" height="440"><embed src="home2.swf" wmode="transparent" quality="high" bgcolor="#fff" width="790" height="440" name="homePageMovie" id="flashObject1" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
}
function flashOverview() {
	document.write('<object id="clsid:D27CDB6E-AE6D-11cf-96B8-416553540000" width="790" height="440"><embed src="home2.swf?initSceneNum=2" wmode="transparent" quality="high" bgcolor="#fff" width="790" height="440" name="homePageMovie" id="flashObject1" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
}
function flashDistribution() {
	document.write('<object id="clsid:D27CDB6E-AE6D-11cf-96B8-416553540000" width="790" height="440"><embed src="home2.swf?initSceneNum=3" wmode="transparent" quality="high" bgcolor="#fff" width="790" height="440" name="homePageMovie" id="flashObject1" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
}
function flashTransportation() {
	document.write('<object id="clsid:D27CDB6E-AE6D-11cf-96B8-416553540000" width="790" height="440"><embed src="home2.swf?initSceneNum=4" wmode="transparent" quality="high" bgcolor="#fff" width="790" height="440" name="homePageMovie" id="flashObject1" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
}
function flashServices() {
	document.write('<object id="clsid:D27CDB6E-AE6D-11cf-96B8-416553540000" width="790" height="440"><embed src="home2.swf?initSceneNum=5" wmode="transparent" quality="high" bgcolor="#fff" width="790" height="440" name="homePageMovie" id="flashObject1" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
}
function redirectPage(url) {
	window.location = url;
}
function redirectPagePop(theURL) {
	  window.open(theURL)
}

function toggleDiv(divName,state) {
	if (state=="on"){
		if (document.layers) document.layers[''+divName+''].visibility = "show"
			else if (document.all) document.all[''+divName+''].style.visibility = "visible"
			else if (document.getElementById) document.getElementById(''+divName+'').style.visibility = "visible";
			if(document.getElementById("cs-select")){
			document.getElementById("cs-select").style.visibility="hidden";}
	}
	else if (state=="off"){
		if (document.layers) document.layers[''+divName+''].visibility = "hide"
			else if (document.all) document.all[''+divName+''].style.visibility = "hidden"
			else if (document.getElementById) document.getElementById(''+divName+'').style.visibility = "hidden";
			if(document.getElementById("cs-select")){
			document.getElementById("cs-select").style.visibility="visible";
			}
}
}

function menu_tracking(page)
{
    var baseurl = "resources" ;
	if(page == "medical-device-case-study-bd.html"){
		destination = "HCM_US_en_Click_Resources_" + page + "_DropDown_BDCaseStudy";
		destination2 = "/" + destination;
		dcsMultiTrack('DCS.dcsuri', '/destination2','DCSext.pPID','destination');
	}
	if(page == "pharmaceutical-case-study-boiron.html"){
		destination = "HCM_US_en_Click_Resources_" + page + "_DropDown_BoironCaseStudy";
		destination2 = "/" + destination;
		dcsMultiTrack('DCS.dcsuri', '/destination2','DCSext.pPID','destination');
	}
	if(page == "pharmaceutical-case-study-endo.html"){
		destination = "HCM_US_en_Click_Resources_" + page + "_DropDown_EndoCaseStudy";
		destination2 = "/" + destination;
		dcsMultiTrack('DCS.dcsuri', '/destination2','DCSext.pPID','destination');
	}
	if(page == "pharmaceutical-case-study-lansinoh.html"){
		destination = "HCM_US_en_Click_Resources_" + page + "_DropDown_LansinohCaseStudy";
		destination2 = "/" + destination;
		dcsMultiTrack('DCS.dcsuri', '/destination2','DCSext.pPID','destination');
	}
	if(page == "healthcare-device-case-study-samsung.html"){
		destination = "HCM_US_en_Click_Resources_" + page + "_DropDown_SamsungCaseStudy";
		destination2 = "/" + destination;
		dcsMultiTrack('DCS.dcsuri', '/destination2','DCSext.pPID','destination');
	}
	if(page == "healthcare-ups-freight-case-study-steris.html"){
		destination = "HCM_US_en_Click_Resources_" + page + "_DropDown_SterisCaseStudy";
		destination2 = "/" + destination;
		dcsMultiTrack('DCS.dcsuri', '/destination2','DCSext.pPID','destination');
	}
	
	
   
}

function changeState(ID)
{
		document.getElementById(ID).className="on";
}

function hideDiv(id) {
if (document.getElementById) document.getElementById(id).style.display = 'none';
}


function showDiv(id) {
if (document.getElementById) document.getElementById(id).style.display = 'block';
}

function externalLinks() { 
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 for (var i=0; i<anchors.length; i++) { 
  var anchor = anchors[i]; 
  if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") anchor.target = "_blank"; 
 }
}

function getParameter( 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 checkTAC(){
	if(getParameter('tac') == 'success'){
		toggleDiv('tell_colleague_thanks','on'); 	
	}
	if(getParameter('tac') == 'failure'){
		toggleDiv('tell_colleague_error','on'); 	
	}
}

function checkVid(){
	if(getParameter('video') == '0'){
		return 0;
	}
	if(getParameter('video') == '1'){
		return 1;
	}
	if(getParameter('video') == '2'){
		return 2;
	}
	if(getParameter('video') == '3'){	
		return 3;
	}
	if(getParameter('video') == '4'){	
		return 3;
	}
}

function redirectPageFlash(url) {
	if(url == "1"){
		window.location = "distribution-warehousing-logistics/";
	}
	if(url == "2"){
		window.location = "transportation-shipping-freight/";
	}
	if(url == "3"){
		window.location = "specialized-services-healthcare/";
	}
}