function toggleSection(selected, nav) {
    var imgPost = "";
    var divs = document.getElementsByTagName('DIV');
    var selectedContainer = selected + 'Container';
    var selectedTitle = selected + 'Title';
    var selectedImg = selected + 'Img';
    var selectedTitleElem = document.getElementById(selectedTitle);
    var selectedImgElem = document.getElementById(selectedImg);
	//alert("selectedImgElem : "+selectedImgElem)
    for (a=0; a<divs.length; a++) {
        if (divs[a].id == selectedContainer) {
        	var style = divs[a].style
        	style.display = style.display? "":"block"
            //alert(selectedTitleElem.className)
        	//selectedTitleElem.className = selectedTitleElem.className? "":"open"
            if (nav == 1){
                imgPost = "14px 8px"
            } else {
                imgPost = "2px 9px"
            }

            if (selectedImgElem != null){
			//alert("Dsiplay : '"+selectedImgElem.style.background+"'")
				if (selectedImgElem.style.background.search("navBul.gif")<0){
                    selectedImgElem.style.background = "url('/meta_elements/gif/navBul.gif') no-repeat "+imgPost;
                } else {
                    selectedImgElem.style.background = "url('/meta_elements/gif/navBul_selected.gif') no-repeat "+imgPost;
                }
            }
        }
    }
}

function SetPage(o){
				//document.search.page.value = o;
				var kbName = "" ;
				var kblen =	document.search.kb.length;
				for(i=0; i< kblen ; i++){
					if(	document.search.kb[i].checked)
						kbName = kbName + document.search.kb[i].title + ", ";
				}
				//alert("kbName = " +kbName);
				document.search.kbName.value = 	kbName.substring(0, ((kbName.length) - 2) );
				document.search.submit();
					
			}
			function HLight(o,v){
				if(v == 0){o.style.background="666699";}else{o.style.background="ccccff"}
				o.style.textDecoration = "none";
				o.style.color = "ffffff";
			}

			function docSubmit(o){
				var valid = true;
				var errmsg = 'The following errors occured:\n\n';
				/*if (frmprod.chk_lang.value.length == 0 )
				{
					alert("Please select language to search.");
					document.frmprod.chk_lang.focus();
					return false;
				} 
					else 
				{	
				if (o.qu_text.value == ''){
					valid=false; errmsg += 'Please Enter a Word, Phrase, or Article ID.';
					o.qu_text.focus();
				}*/
				if (!valid) alert(errmsg);
				return valid;
			}

			function sorts(i){
				//alert (i);
					document.search.sort(i).checked = true;

				//alert (document.search.sort(i).checked);
					document.search.submit();
			}

			function ToggleSelected(oCol, sTag, sFunc){
				aTags = oCol.getElementsByTagName(sTag);
				for (i=0;i<aTags.length;i++){
					if (aTags[i].id.substring(0,4) == 'chk_' || aTags[i].id.substring(0,2) == 'kb'){
						if (sFunc=='Check'){aTags[i].checked = true;
						}
						else aTags[i].checked = false;
					}
				}
			}

			function SetSearch(){
				var val = document.search.previous.value;

				document.search.qu.value = document.search.previous.value.substring(2,document.search.previous.value.length);
				document.search.qu.focus();
			}

			function PopVer(o){
				document.search.version.options.length = 1;
				document.search.module.options.length = 1;
				document.frames("pipe").location = 'fillproducts.asp?product=' + o.options[o.selectedIndex].value;
			}

			function toggleopts(){
				advancedoptions.style.display = (advancedoptions.style.display == 'block' ? 'none' : 'block');
				showhide.innerHTML = (showhide.innerHTML == 'Hide' ? 'Show' : 'Hide');
				search.advopts.value = (search.advopts.value == 'hide' ? 'show' : 'hide');
			}

			function SetProdVerMod(){
				document.frames("frapro").location = "glbCareselectProddoc.asp?p_productCategory=" + document.search.p_productCategory.value + "&p_productkey=" + document.search.p_productkey.value+ "&chk_lang=" + document.search.chk_lang.value;
				//document.frames("frapro").location = "glbCaresubProductSelect.asp?p_productkey=" + document.search.p_productkey.value + "&p_modulekey=" + search.p_modulekey.value + "&p_versionkey=" + search.p_versionkey.value;
			}

			function UnCheckSources(){
				/*document.search.chk_ct.disabled = true;
				document.search.chk_de.disabled = true;
				document.search.chk_dfs.disabled = true;
				document.search.chk_sim.disabled = true;
				document.search.chk_hdd.disabled = true;
				
				document.search.chk_ct.checked = false;
				document.search.chk_de.checked = false;
				document.search.chk_dfs.checked = false;
				document.search.chk_sim.checked = false;*/
			}

			function CheckSources(){
				/*document.search.chk_ct.disabled = false;
				document.search.chk_de.disabled = false;
				document.search.chk_dfs.disabled = false;
				document.search.chk_sim.disabled = false;
				document.search.chk_hdd.disabled = false;*/
			}
			
		function openTips(){
			window.open("/support/index?page=helppage&cat=SEARCH_TIPS", "searchTips", 'scrollbars,width=580,height=500,left=400,top=10');

		}
		
		function openHelpTips(url){	
          window.open(url, "searchTips",        'scrollbars,width=590,height=500,left=400,top=10')

}


function changebreadcromb(str)
{
	var newstr = str.toString();
	//alert(newstr);
	//alert(document.getElementById("divAdd").innerHTML );
	document.getElementById("divAdd").innerHTML = newstr;
	
  
}



function emailCheck(stremail) {

       
	    var str = stremail;
		
		var status = true;
		
		if(str!=null && str!="")
		{
			var at="@"
			var dot="."
			
			var lat=str.indexOf(at)
			var lstr=str.length
			var ldot=str.indexOf(dot)
			if (str.indexOf(at)==-1){		  
			   status = false
			}	
			if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
			    status = false
				//alert("1");
			}
			if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
				status = false
				//alert("2");
			}
			if (str.indexOf(at,(lat+1))!=-1){
				status = false
				//alert("3");
			}
			if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
				status = false
				//alert("4");
			}
			//if (str.substring(dot,str)==""){
//				status = false
//				alert("5");
//			}
			if (str.indexOf(dot,(lat+2))==-1){
				status = false
				//alert("6");
			}
			if (str.indexOf(" ")!=-1){
				status = false
				//alert("7");
			}
			if(status == false)
			{
			  document.getElementById("msg").innerHTML = "Please enter a valid Email address"; 
			  return false
			}else
			{ 
			   document.getElementById("msg").innerHTML = ""; 
			  return true	
			} 
		}else 				
		{
		     document.getElementById("msg").innerHTML = "Please enter all required fields"; 
		     return false
		}  
		
}




