function embedPageIFrame(source)
{
	document.write( '<iframe name="content" src="' + source + '" width="100%" height="100%" scrolling="auto" frameborder="none"></iframe> ' );
}

function embedFlashObject(asset, height, width, color, xmlPath, stylesPath)
	{
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
		document.write('height="' + height + '"');
		document.write('width="' + width + '">');
		document.write('<param name="src" value="' + asset + '">');
		document.write('<param name="allowScriptAccess" value="sameDomain" />');
		document.write('<param name="FlashVars" value="xmlPath=' + xmlPath + '&stylesPath=' + stylesPath + '" />');
		document.write('<param name="align" value="middle">');
		document.write('<param name="quality" value="high">');
		document.write('<param name="bgcolor" value="' + color + '">');
		document.write( '<embed ' );
		document.write( '  src="' + asset + '" ' );
		document.write( '  name="' + name + '"' );
		document.write( '  height="' + height + '" ' );
		document.write( '  width="' + width + '" ' );
		document.write( '  align="middle" ' );
		document.write( '  quality="high" ' );
		document.write( '  allowScriptAccess="sameDomain" ' );
		document.write( '  FlashVars="xmlPath=' + xmlPath + '&stylesPath=' + stylesPath + '"');
		document.write( '  scale="aspect" ' );
		document.write( '  pluginspage="http://www.macromedia.com/go/getflashplayer" ' );
		document.write( '  bgcolor="' + color + '" ' );
		document.write( '  type="application/x-shockwave-flash">' );
		document.write( '</embed>' );
		document.write('</object>');
	}


function updateCount(get2009Count, get2010Count, get2011Count, get2012Count) {	
	document.getElementById("year2009").innerHTML="("+get2009Count+")";
	document.getElementById("year2010").innerHTML="("+get2010Count+")";
	document.getElementById("year2011").innerHTML="("+get2011Count+")";
	document.getElementById("year2012").innerHTML="("+get2012Count+")";
}

function sortCategories() {
	var getCategory=document.getElementById("listCategories").value;
	getCategory=parseInt(getCategory);
	url="";
	switch(getCategory) {
		case 0:
			url="/WhatWeDo/ToolsforPractice.aspx";
			break;
		case 1: 
			url="/WhatWeDo/ToolsforPractice/General.aspx";
			break;
		case 18: 
			url="/WhatWeDo/ToolsforPractice/Pulmonology.aspx";
			break;
		case 2: 
			url="/WhatWeDo/ToolsforPractice/Anesthesiology.aspx";
			break;
		case 3: 
			url="/WhatWeDo/ToolsforPractice/Cardiology.aspx";
			break;
		case 21: 
			url="/WhatWeDo/ToolsforPractice/Urology.aspx";
			break;
		case 10: 
			url="/WhatWeDo/ToolsforPractice/InfectiousDisease.aspx";
			break;
		case 11: 
			url="/WhatWeDo/ToolsforPractice/Nephrology.aspx";
			break;
		case 5: 
			url="/WhatWeDo/ToolsforPractice/ENT.aspx";
			break;
		case 6: 
			url="/WhatWeDo/ToolsforPractice/Emergency.aspx";
			break;
		case 12: 
			url="/WhatWeDo/ToolsforPractice/Neurology.aspx";
			break;
		case 19: 
			url="/WhatWeDo/ToolsforPractice/Radiology.aspx";
			break;
		case 14: 
			url="/WhatWeDo/ToolsforPractice/Oncology.aspx";
			break;
		case 16: 
			url="/WhatWeDo/ToolsforPractice/Pediatrics.aspx";
			break;
		case 7: 
			url="/WhatWeDo/ToolsforPractice/Gastroenterology.aspx";
			break;
		case 8: 
			url="/WhatWeDo/ToolsforPractice/Geriatrics.aspx";
			break;
		case 9: 
			url="/WhatWeDo/ToolsforPractice/Hematology.aspx";
			break;
		case 17: 
			url="/WhatWeDo/ToolsforPractice/Psychiatry.aspx";
			break;
		case 13: 
			url="/WhatWeDo/ToolsforPractice/Obstetricsgynecology.aspx";
			break;
		case 15: 
			url="/WhatWeDo/ToolsforPractice/Orthopedics.aspx";
			break;
		case 20: 
			url="/WhatWeDo/ToolsforPractice/Rheumatology.aspx";
			break;
		case 4: 
			url="/WhatWeDo/ToolsforPractice/Endocrinology.aspx";
			break;
	}
	window.location.href=url+"?cat="+getCategory;
}

window.onload = init;

function init() {
	setCategory();
}

function setCategory() {
	var getLocation=window.location.href;
	if (getLocation.indexOf("cat=") > -1) {
		category=getLocation.substring(getLocation.indexOf("cat=")+4, getLocation.length);
		document.getElementById("listCategories").selectedIndex=category;
	
		optionHtml=document.getElementById("listCategories").options[document.getElementById("listCategories").selectedIndex].innerHTML;
		if (optionHtml != "All") {
			document.getElementById("articlesTitle").innerHTML+=": "+optionHtml;
		}
	}
	
	if (getLocation.indexOf("2011.aspx") > -1) {
		document.getElementById("articlesTitle").innerHTML+=": 2011";
	}
	if (getLocation.indexOf("2010.aspx") > -1) {
		document.getElementById("articlesTitle").innerHTML+=": 2010";
	}
	if (getLocation.indexOf("2009.aspx") > -1) {
		document.getElementById("articlesTitle").innerHTML+=": 2009";
	}
}
