
//For news refresh on home page - Type 1
var newsItem;
var newsCount = 0;

function news_refresh(){
	if(newsCount>=news.length){
		newsCount=0;
	}
	newsItem=news[newsCount++];
	parseMessages();
}
var last='';
function parseMessages(){
	if(last==''){
		setTimeout("news_refresh()",0);
	}else{
		setTimeout("news_refresh()",5000);
	}
	var place=document.getElementById("news_container");
	if(place&&(last==''||last=='place2')){
		place.innerHTML=newsItem;
		last="place";
	}else{   
		var place2=document.getElementById("news_container2");
		if(place2&&(last==''||last=='place')){
			place2.innerHTML = newsItem;
			last="place2";
		}
	}
}





//For opening pop up for tour
var newWin;
//url, target, w, h are required.
function popWin(url,target,w,h,left,top,scroll,menu,toolBar,locBar,dir){
	var args='';
	//left status and resizable out, they are not fully supported.
	if(left=='all'){
		left=top=200;
		scroll=menu=toolBar=locBar=dir=1;
	}
	args+=left?',left='+left:',left=120';
	args+=top?',top='+top:',top=80';
	args+=scroll?',scrollbars=1':',scrollbars=0';
	args+=menu?',menubar=1':',menubar=0';
	args+=toolBar?',toolbar=1':',toolbar=0';
	args+=locBar?',location=1':',location=0';
	args+=dir?',directories=1':',directories=0';
	newWin=window.open(url,target,'width='+w+',height='+h+args);
	if(window.focus&&newWin)newWin.focus();
}

//For news- events refresh on home page - Type 2
	var displayInSeconds=5;
	var newsN=rN=0,newsT;
	function startReel(){
		var e;
		do{newsN++;e=document.getElementById('news'+newsN);}while(e);
		newsN--;
		if(newsN>1){
			if(!rN)
				rN=Math.round((new Date().getSeconds()/60*(newsN-1))+1);
			newsReel(rN);
		}else newsReel(0);
	}
	function newsReel(n){
		var shutItRE=eval('/shutIt/i'),openItRE=eval('/openIt/i');
		if(n){
			var eOff=document.getElementById('news'+n);
			if(eOff)
				eOff.className=eOff.className.replace(openItRE,'shutIt');//'openIt'=>'shutIt'
			n=n<newsN?n+1:1;
			newsT=setTimeout('newsReel('+n+')',displayInSeconds*1000);
		}else n=1;
		var eOn=document.getElementById('news'+n);
		if(eOn)
			eOn.className=eOn.className.replace(shutItRE,'openIt');//'shutIt'=>'openIt'
	}

//JavaScript for Drop-Down Menu Start

//Contents for menu Products
var menuProducts=new Array()
menuProducts[0]='<a href="/products/collaboration/index.html">eTouch SamePage</a>'
menuProducts[1]='<a href="/products/contentmanagement/index.html">eTouch CMS</a>'
menuProducts[2]='<a href="/products/contentintegration/index.html">eTouch Integration</a>'
menuProducts[3]='<a href="/products/contentserver/index.html">eTouch Platform</a>'

//Contents for menu Services, 
var menuServices=new Array()
menuServices[0]='<a href="/services/support.html">Support Services</a>'
menuServices[1]='<a href="/services/professional.html">Professional Services</a>'
menuServices[2]='<a href="/services/implementation.html">Implementation Services</a>'
menuServices[3]='<a href="/services/solutions.html">Solutions</a>'

//Contents for menu Company, 
var menuCompany=new Array()
menuCompany[0]='<a href="/company/news.html">News & Events</a>'
menuCompany[1]='<a href="/company/partners.html">Partners</a>'
menuCompany[2]='<a href="/careers/index.html">Careers</a>'
menuCompany[3]='<a href="/company/contact.html">Contact Us</a>'

//Contents for menu Support, 
var menuSupport=new Array()
menuSupport[0]='<a href="http://support.etouch.net/cm/wiki/FAQ.wiki/home/home.html" target="supportWindow">FAQ</a>'
menuSupport[1]='<a href="http://support.etouch.net/cm/newui/wiki/issuelisting.jsp?projectname=Knowledgebase" target="supportWindow">Knowledgebase</a>'
menuSupport[2]='<a href="http://support.etouch.net/cm/newui/wiki/forumlisting.jsp?projectname=Discussion%20Forum" target="supportWindow">Discussion Forum</a>'
menuSupport[3]='<a href="http://support.etouch.net/cm/wiki/support.Workshops%20and%20Webinars.wiki/home/home.html" target="supportWindow">Workshops & Webinars</a>'
menuSupport[4]='<a href="http://support.etouch.net/cm/newui/wiki/issuelisting.jsp?projectname=Feedback%20and%20Feature%20Requests" target="supportWindow">Feature Requests</a>'
menuSupport[5]='<a href="http://support.etouch.net/cm/wiki/Downloads.wiki/home/home.html" target="supportWindow">Downloads</a>'
menuSupport[6]='<a href="http://support.etouch.net/cm/wiki/support.Plugins.wiki/home/home.html" target="supportWindow">Plugins Support</a>'

		
var menuwidth='165px' //default menu width
var menubgcolor='#EFEFEF'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu

//JavaScript for Drop-Down Menu End



//-- Start functions for Request Information Form

var servleturl = "";

/**
 * Used in "Request Information" form
 * Sets servlet URL for based on location (dev/stg/prd)
 * Called from "body onLoad"
 */
function setServletURL()
{
	var url = window.location.href;
	var domain = getDomain(url);
	if(domain == "development1.etouch.net")
	{
		servleturl = "http://etask.etouch.net/etouchsalesdev";
		//servleturl = "http://etask.etouch.net/etouchsales";
	}
	else if(domain == "staging1.etouch.net")
	{
		servleturl = "http://etask.etouch.net/etouchsalesstg";
		//servleturl = "http://etask.etouch.net/etouchsales";
	}
	else
	{
		servleturl = "http://etask.etouch.net/etouchsales";
	}
}

/**
 * Used in "Request Information" form
 * Gets domain of "Request Information" form
 * Called from "setServletURL()"
 */
function getDomain(url) 
{
   return url.match(/:\/\/(.[^/]+)/)[1];
}

/**
 * Every "Request for Information" link will call this function
 * Usage: <a onClick="getSourceAndForward(1)" href="#nogo">Request Information</a>
 * The parameter "1" signifies that its the first link on a particular page.
 * For subsequent links on the same page, use "2", "3", etc. as parameters.
 * For e.g. <a onClick="getSourceAndForward(2)" href="#nogo">Request Information</a>
 */
function getSourceAndForward(linkId)
{
	var tr = window.location.pathname 
	len = tr.length 
	file = "";
	filepart = "";
	url = "";
	for (i = len; i > 0; i--) 
	{ 
		vb = tr.substring(i,i+1) 
		if (vb == "/") 
		{ 
			file = tr.substring(i+1,len);
			filepart = file.split(".");
			url = "/company/information_request.html?source_page="+filepart[0]+" "+linkId;
			break;
		} 
	}
	window.location.href = url;
}

/**
 * Used in "Request Information" form
 * Gets query string variables from URL
 * Called from "body onLoad"
 */
function getQueryString() 
{
	var qsParm = new Array();
	var query = window.location.search.substring(1);
	var parms = query.split('&');
	for (var i=0; i<parms.length; i++) 
	{
		var pos = parms[i].indexOf('=');
		if (pos > 0) 
		{
			var key = parms[i].substring(0,pos);
			var val = parms[i].substring(pos+1);
			qsParm[key] = val;
		}
	}
	document.contactForm.sourcePage.value = qsParm['source_page'];
	disableRequestType(document.contactForm.sourcePage.value);
}

/**
 * Used in "Request Information" form
 * Disables "Request Type" drop-down if the source is known
 * Called from "getQueryString()"
 */
function disableRequestType(sourcePage)
{
	if(sourcePage == 'undefined' || sourcePage == 'contact 1' || sourcePage == 'contact%201')
	{
		//alert();
	}
	else
	{
		for(var i=0; i<document.contactForm.requestType.length; i++)
		{
			if(document.contactForm.requestType[i].value == 'collateral_request')
			{
				document.contactForm.requestType[i].selected = true;
				document.contactForm.form_type.value = 	document.contactForm.requestType[i].value;
				document.contactForm.requestType.disabled = true;
				break;
			}
		}
	}
}

/**
 * Used in "Request Information" form
 * Validates "Request Information" form
 * Called when "Submit" button is clicked
 */
function submitContactForm()
{
	if(document.contactForm.firstName.value == '')
	{		
		alert("Please enter a valid First Name.");
		document.contactForm.firstName.focus();
		return false;
	}
	else if (document.contactForm.lastName.value == '')
	{
		alert("Please enter a valid Last Name.");
		document.contactForm.lastName.focus();
		return false;
	}
	else if (document.contactForm.email.value == '')
	{
			alert("Please enter a valid Email Address.");
			document.contactForm.email.focus();
			return false;
	}
	else if (echeck(document.contactForm.email.value)==false)
	{
			document.contactForm.email.focus();
			return false;
	}	
	else if (document.contactForm.sPhone.value == '')
	{
		alert("Please enter a valid Phone Number.");
		document.contactForm.sPhone.focus();
		return false;
	}
	/*
	else if(validatePhone(document.contactForm.sPhone) == false)
	{
			document.contactForm.sPhone.focus();
			return false;
	}
	*/
	else if (document.contactForm.company.value == '')
	{
		alert("Please enter a valid Company Name.");
		document.contactForm.company.focus();
		return false;
	}
	else if (document.contactForm.form_type.value == '-1' || document.contactForm.form_type.value == '')
	{
		alert("Please select a valid Request Type");
		document.contactForm.requestType.focus();
		return false;
	}
	else if (document.contactForm.requestDetails.value == '')
	{
		alert("Please enter valid Request Details");
		document.contactForm.requestDetails.focus();
		return false;
	}
	else if (document.contactForm.captchaText.value == '')
	{
		alert("Please enter the Image Verification Text");
		document.contactForm.captchaText.focus();
		return false;
	}
	if (document.contactForm.form_type.value == 'collateral_request')
	{
		document.contactForm.Collateral.value = document.contactForm.requestDetails.value;
	}
	return true;
}

/**
 * Used in "Request Information" form 
 * Gets "Request Information" form fields
 */
function getParams()
{
	var form_type = document.contactForm.form_type.value;
	var firstName = document.contactForm.firstName.value;
	var lastName = document.contactForm.lastName.value;
	var email = document.contactForm.email.value;
	var company = document.contactForm.company.value;
	var sPhone = document.contactForm.sPhone.value;
	var requestDetails = document.contactForm.requestDetails.value;
	var sourcePage = document.contactForm.sourcePage.value;
	var collateral = document.contactForm.Collateral.value;

	params =  "form_type="+form_type+"&firstName="+firstName+"&lastName="+lastName+"&email="+email+"&company="+company+"&sPhone="+sPhone+"&requestDetails="+requestDetails+"&sourcePage="+sourcePage+"&Collateral="+collateral;

	return params;
}

/**
 * Used in "Request Information" form 
 * Shows/hides error-success-form divs
 */
function showErrorSuccessDiv(response)
{
	if(response == "SUCCESS")
	{
		show("success");
		document.getElementById('successSpan').innerHTML = 
		'<H3><img src="../images/icon_success.gif" alt="Success" align="absmiddle">Thank you!</H3><p>Your request is registered. eTouch team will contact you as soon as possible.</p>';

	}
	else if(response == "ERROR")
	{
		show("error");
	}
	else
	{
		var tb  = document.getElementById("filelist");
		tb.innerHTML = "<ul>"+response+"</ul>";
		show("success");
		document.getElementById('successSpan').innerHTML = 
		'<H3><img src="../images/icon_success.gif" alt="Success" align="absmiddle">Thank you!</H3><p>Please click the links below to download the collaterals you requested. If you need more information, please let us know.</p>';		
		show("fileinfo");	
	}
	//hide("frm_contact");
	hide("requestType");
}

/**
 * Used in "Request Information" form 
 * Downloads a file when its link is clicked
 * Called when file name link is clicked
 * Usage: <a href="javascript:void(0);" onclick="downloadFile(<FILE_NAME>);return false;">
 * The above string is returned by "SalesWebinarLicenseServlet" when the 
 * "Request Information" is submitted via AJAX
 */
function downloadFile(fileName)
{
	var url = servleturl+"/submit?form_type=download_document&file_name="+fileName;
	window.open(url);
}

/**
 * Used in "Request Information" form  
 * Populates "form_type" hidden field
 * Called on change of "requestType" drop-down
 * Usage: <select name="requestType" onChange="populateFormType()">
 */
function populateFormType()
{
	document.contactForm.form_type.value = document.contactForm.requestType.value;
}

function redirectToSourcePage()
{
	history.go(-1);	
}

/**
 * Used in "Request Information" form  
 * Validates email address
 * Called from "submitContactForm()"
 */
function echeck(str) 
{
	var at="@";
	var dot=".";
	var lat=str.indexOf(at);
	var lstr=str.length;
	var ldot=str.indexOf(dot);
	var domainstr = str.substring(lat+1,ldot);

	var invalidaddress=new Array(); // list of blocked emails
	invalidaddress[0]="hotmail";
	invalidaddress[1]="yahoo";
	invalidaddress[2]="rocketmail";

	for(i=0; i < invalidaddress.length; i++)
	{
		if ( domainstr == invalidaddress[i])
		{
			alert("Please use your corporate email address instead of web email addresses like hotmail or yahoo.");
			return false;
		}
	}

	if (str.indexOf(at)==-1){
	   alert("Please enter a valid Email Address.");
	   return false;
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   alert("Please enter a valid Email Address.");
	   return false;
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		alert("Please enter a valid Email Address.");
		return false;
	}

	 if (str.indexOf(at,(lat+1))!=-1){
		alert("Please enter a valid Email Address.");
		return false;
	 }

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		alert("Please enter a valid Email Address.");
		return false;
	 }

	 if (str.indexOf(dot,(lat+2))==-1){
		alert("Please enter a valid Email Address.");
		return false;
	 }

	 if (str.indexOf(" ")!=-1){
		alert("Please enter a valid Email Address.");
		return false;
	 }	 
	 return true;					
}

/**
 * Used in "Request Information" form  
 * Validates phone number
 * Called from "submitContactForm()"
 */
function validatePhone(textfield) 
{
     phoneOK = true;
     var digits = 0;
     for (var i=0; i < textfield.value.length; i++) 
	 {
		var theChar = textfield.value.charAt(i);
        if ((theChar >= "0") && (theChar <= "9")) 
		{
           digits++;
           continue;
        }
        if (theChar == " ") continue;
        if (theChar == "-") continue;
        if (theChar == "(") continue;
        if (theChar == ")") continue;
		if (theChar == "+") continue;
        phoneOK = false;
     }

     phoneOK = phoneOK;
     if (!phoneOK) 
	 {
        alert("Phone number can contain numbers and optionally these characters: +,-,(,)");
        textfield.focus();
        textfield.select();
     }
     return phoneOK;
 }
 
function show(id)
{
     if (document.getElementById(id).style.display == 'none')
     {
          document.getElementById(id).style.display = '';
     }
}
function hide(id)
{
          document.getElementById(id).style.display = 'none';

}
//-- End functions for Request Information Form

//-- Show Hide Case-studies as per Industries & Solutions Starts



<!--
/**
 * Functions for Case Studies page
 * START
 */

//-- Add id of new case study content div here
//-- Note: Length of all 3 arrays should be same
var divList = new Array('gscrs','regulatory_submission','medicinal_compounds_and_project_management','clinical_trials_submission_tracking','global_regulatory_affairs_portal','enterprise_collaboration_portal','medicinal_products_dictionary','customer_and_billing_data_warehouse');

//-- Add industry of new case study content div here
//-- Note: Length of all 3 arrays should be same
var industryList = new Array('pharma','pharma','pharma','pharma','pharma','pharma','pharma','energy');

//-- Add solution of new case study content div here
//-- Note: Length of all 3 arrays should be same
var solutionList = new Array('we','we','we','we','km','km','km','bi');

/**
 * Display Divs using List control
 */
function displayDivsFromDropdown(listObj)
{
	for(var i=0; i<listObj.length; i++)
	{
		if(listObj.options[i].selected && listObj.options[i].value != 0)
		{
			var category = (listObj.options[i]).getAttribute('category');
			var subcategory = (listObj.options[i]).getAttribute('subcategory');
			displayDivs(category,subcategory);
			break;
		}
	}
}

/**
 * Display Divs from using Links
 */
function displayDivs(category,subcategory)
{
	var displayDivList = new Array();
	
	hideDisplayDiv();

	if(category == 'all')
	{
		for(var i=0; i<divList.length; i++)
		{
			displayDivList[i] = divList[i];
		}
	}
	else if(category == 'industry')
	{
		for(var i=0; i<industryList.length; i++)
		{
			if(subcategory == 'all')
			{
				displayDivList[i] = divList[i];
			}
			else
			{
				if(industryList[i] == subcategory)
				{
					displayDivList[i] = divList[i];
				}
			}
		}
	}
	else if(category == 'solution')
	{
		for(var i=0; i<solutionList.length; i++)
		{
			if(subcategory == 'all')
			{
				displayDivList[i] = divList[i];
			}
			else
			{
				if(solutionList[i] == subcategory)
				{
					displayDivList[i] = divList[i];
				}
			}
		}
	}

	showDisplayDiv(category,subcategory,displayDivList);
}

/**
 * Render Display Div
 */
function showDisplayDiv(category,subcategory,displayDivList)
{
	var displayDiv = createHeaderDiv(category,subcategory);
	var subcategoryMap = new Map();
	for(var i=0; i<displayDivList.length; i++)
	{
		if(displayDivList[i])
		{
			if(category == 'industry' && subcategory == 'all')
			{
				var subcategoryDivs = subcategoryMap.get(industryList[i]);
				if(subcategoryDivs == null)
				{
					subcategoryMap.put(industryList[i],Array(displayDivList[i]));
				}
				else
				{
					subcategoryDivs[subcategoryDivs.length] = displayDivList[i];
				}
			}
			else if(category == 'solution' && subcategory == 'all')
			{
				var subcategoryDivs = subcategoryMap.get(solutionList[i]);
				if(subcategoryDivs == null)
				{
					subcategoryMap.put(solutionList[i],Array(displayDivList[i]));
				}
				else
				{
					subcategoryDivs[subcategoryDivs.length] = displayDivList[i];
				}
			}
			else
			{
				displayDiv = displayDiv + '<div class="case_study_item">'+document.getElementById(displayDivList[i]).innerHTML+'</div>';
			}
		}
	}

	if((category == 'industry' || category == 'solution') && subcategory == 'all')
	{
		var keys = subcategoryMap.keySet();
		for(var i = 0; i<keys.length; i++)
		{
			var subcategorydivlist = subcategoryMap.get(keys[i]);
			displayDiv = displayDiv + createSubHeaderDiv(keys[i]);
			for(var j=0; j<subcategorydivlist.length; j++)
			{
				displayDiv = displayDiv + '<div class="case_study_item">'+document.getElementById(subcategorydivlist[j]).innerHTML+'</div>';
			}
		}
	}
	document.getElementById('displayDiv').innerHTML = displayDiv;
}

/**
 * Clear display Div
 */
function hideDisplayDiv()
{
	document.getElementById('displayDiv').innerHTML = '';
}

/**
 * Create Header Div
 */
function createHeaderDiv(category,subcategory)
{
	var divs = document.getElementsByTagName('div');

	var header = '';
	for (var i=0;i<divs.length;i++) 
	{
		if(divs[i].getAttribute('category') == category && divs[i].getAttribute('subcategory') == subcategory)
		{
			//header = document.getElementById(divs[i].id).outerHTML;
			if(divs[i].getAttribute('subcategory') != 'all')
			{
				header = '<div>'+document.getElementById(divs[i].getAttribute('category')+'_all').innerHTML+'</div>';
			}
			header = header + '<div>'+document.getElementById(divs[i].id).innerHTML+'</div>';
		}
	}
	return header;
}

/**
 * Create Sub Header Div
 */
function createSubHeaderDiv(subcategory)
{
	var divs = document.getElementsByTagName('div');
	var header = '';
	for (var i=0;i<divs.length;i++) 
	{
		if(divs[i].getAttribute('subcategory') == subcategory)
		{
			//header = document.getElementById(divs[i].id).outerHTML;
			header = '<div>'+document.getElementById(divs[i].id).innerHTML+'</div>';
		}
	}
	return header;
}

/*
 * Functions for JS HashMap implementation
 * START
 */
function Map()
{
    // members
    this.keyArray = new Array(); // Keys
    this.valArray = new Array(); // Values
        
    // methods
    this.put = put;
    this.get = get;
    this.size = size;  
    this.clear = clear;
    this.keySet = keySet;
    this.valSet = valSet;
    this.showMe = showMe;   // returns a string with all keys and values in map.
    this.findIt = findIt;
    //this.remove = remove;
}

function put( key, val )
{
    var elementIndex = this.findIt( key );
    
    if( elementIndex == (-1) )
    {
        this.keyArray.push( key );
        this.valArray.push( val );
    }
    else
    {
        this.valArray[ elementIndex ] = val;
    }
}

function get( key )
{
    var result = null;
    var elementIndex = this.findIt( key );

    if( elementIndex != (-1) )
    {   
        result = this.valArray[ elementIndex ];
    }  
    
    return result;
}
/*
function remove( key )
{
    var result = null;
    var elementIndex = this.findIt( key );

    if( elementIndex != (-1) )
    {
        this.keyArray = this.keyArray.removeAt(elementIndex);
        this.valArray = this.valArray.removeAt(elementIndex);
    }  
    
    return ;
}
*/
function size()
{
    return (this.keyArray.length);  
}

function clear()
{
    for( var i = 0; i < this.keyArray.length; i++ )
    {
        this.keyArray.pop(); this.valArray.pop();   
    }
}

function keySet()
{
    return (this.keyArray);
}

function valSet()
{
    return (this.valArray);   
}

function showMe()
{
    var result = '';
    
    for( var i = 0; i < this.keyArray.length; i++ )
    {
        result += 'Key: ' + this.keyArray[ i ] + '\tValues: ' + this.valArray[ i ] + '\n';
    }
    return result;
}

function findIt( key )
{
    var result = (-1);

    for( var i = 0; i < this.keyArray.length; i++ )
    {
        if( this.keyArray[ i ] == key )
        {
            result = i;
            break;
        }
    }
    return result;
}
/*
function removeAt( index )
{
  var part1 = this.slice( 0, index);
  var part2 = this.slice( index+1 );

  return( part1.concat( part2 ) );
}
Array.prototype.removeAt = removeAt;
*/
//-- JS HashMap implementation - END


//-- Functions for Case Studies page - END

//-->


//-- Show Hide Case-studies as per Industries & Solutions Starts