
function toggle(name, obj) {
	var ans = document.getElementById(name);
	var leftnav = document.getElementById("leftnav");
	if (leftnav) {
		for (var i = 0; i < leftnav.rows.length; i++) {
			if (leftnav.rows[i].cells[0].className == "first-level-nav-selected") {
				leftnav.rows[i].cells[0].className = "first-level-nav";
			}
			if (leftnav.rows[i].cells[0].className == "second-level-nav" || leftnav.rows[i].cells[0].className == "second-level-nav-selected" || leftnav.rows[i].cells[0].className == "third-level-nav" || leftnav.rows[i].cells[0].className == "third-level-nav-selected") {
				leftnav.rows[i].cells[0].style.display = "none";
			}
			if (leftnav.rows[i].cells[0].innerHTML.toLowerCase().indexOf("brands") > -1) {
				leftnav.rows[i].cells[0].className = "first-level-nav-selected";
			}
		}
	}
	if (ans) {
		if (ans.className == "otherbrands-show") {
			ans.className = "otherbrands";
		} else {
			ans.className = "otherbrands-show";
		}
	}
}
function getServerDomainMC() {
    return document.domain;
}
function popup() {
	window.open("more.htm", "window_name", "width=793,height=456,scrollbar=1");
}
function TDSPopup(pageURL, title, w, h) {
	var left = (screen.width / 2) - (w / 2);
	var top = (screen.height / 2) - (h / 2);
       	window.open(pageURL, "window", "top=" + top + ",left=" + left + ",scrollbars=yes,resizable=yes,width=" + w + ",height=" + h);
	return false;
}
function PopupCenter(pageURL, title, w, h) {
	var left = (screen.width / 2) - (w / 2);
	var top = (screen.height / 2) - (h / 2);
	window.open(pageURL, title, "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width=" + w + ", height=" + h + ", top=" + top + ", left=" + left);
	return false;
}
function feedBackPopup(pageURL, title, w, h) {
	var left = (screen.width / 2) - (w / 2) - 2;
	var top = (screen.height / 2) - (h / 2);
	window.open(pageURL, title, "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, copyhistory=no, width=" + w + ", height=" + h + ", top=" + top + ", left=" + left);
}
function printPopup(pageURL, title, w, h) {
	var left = (screen.width / 2) - (w / 2) - 2;
	var top = (screen.height / 2) - (h / 2);
	window.open(pageURL, title, "toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=no, resizable=yes, copyhistory=no, width=" + w + ", height=" + h + ", top=" + top + ", left=" + left);
}
function photogaleryPopup(pageURL) {
	//var left = (screen.width / 2) - (250/2);
	//var top = (screen.height / 2) - (150/2);
	window.open(pageURL, "PhotoGallery", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, copyhistory=no, top=0, left=0, width=" + screen.width + ", height=" + screen.height);//, width=50, height=50, top=" + top + ", left=" + left);//, width=" + w + ", height=" + h + ", top=" + top + ", left=" + left);	
}
function resizeWindow() {
	var WoffsetHeight = document.getElementById("pgPopup").offsetHeight+30;
	var imgWidth = document.getElementById("pgImg").width + 80;	
	//if(window.navigator.userAgent.indexOf("Firefox")>-1){
		//WoffsetHeight = WoffsetHeight+50;
	//}
	window.resizeTo(imgWidth, WoffsetHeight);
	var x = (screen.width / 2) - (imgWidth / 2) - 2;
	var y = (screen.height / 2) - (WoffsetHeight / 2);
	window.moveTo(x, y);
	window.focus();
}
	
	//method defined for submitting the search form
/*function submitSearch() {
	var url = document.forms[0].action + "&vgnextrefresh=1&param2=" + escape(document.getElementById("param2").value);
	document.getElementById("param2").value=escape(document.getElementById("param2").value)+"Laxmi";
	//document.forms[0].action = url;
	document.forms[0].submit();
}*/
	
	//to open faq question answer.
function flipFAQ(num) {
	var ans = document.getElementById("answer" + num);
	if (ans) {
		if (ans.className == "answer") {
			ans.className = "answer-show";
		} else {
			ans.className = "answer";
		}
	}
}

function msdsSearch(pid) {
	if (pid == "") {
		alert("Please enter a product number.");
	} else {
            		//document.msds.pid.value = document.msds.pid.value.toUpperCase();
		var url = ("http://www.actiocms.com/msds_customers_external.cfm?aa=383&ac=JDSF7685&ad=pjuoiklt" + "&ab=" + pid.toUpperCase());
		window.open(url, "msdsPDF", "width=700,height=600,scrollbars=1,resizable=yes");
	}
}
//function defined for printing Project checklist
function printChecklist() {
	var tables = opener.document.getElementsByTagName("table");
	if (tables && tables.length > 0) {
		for (x in tables) {
			if (tables[x].className == "general-content") {
				document.write("<table class='general-content' width='100%'>");
				document.write(tables[x].innerHTML);
				document.write("</table>");
			}
		}
	}
	tables = document.getElementsByTagName("table");
	if (tables && tables.length > 0) {
		for (x in tables) {
			if (tables[x].className == "general-content") {
				tables[x].rows[0].style.display = "none";
				for (j in tables[x].rows) {
					if (tables[x].rows[j].id == "print") {
						tables[x].rows[j].style.display = "none";
					}
				}
			}
		}
	}
	var openerInput = opener.document.getElementsByTagName("input");
	var popupInput = document.getElementsByTagName("input");
	if (openerInput && popupInput) {
		var z = 0;
		for (y in openerInput) {
			if (openerInput[y].type == "checkbox") {
				popupInput[z].checked = openerInput[y].checked;
				z++;
			}
		}
	}
}
	
	//function defined for printing Color Pallete
/*function printColorPallet(){
		var tables = opener.document.getElementsByTagName("table");
		if(tables && tables.length>0){
			for(x in tables){
				if(tables[x].className=='general-content'){
					document.write("<table class='general-content' width='100%'>")
					document.write(tables[x].innerHTML);
					document.write("</table>")
				}
			}
		}
		tables = document.getElementsByTagName("table");
		if(tables && tables.length>0){
			for(x in tables){
				if(tables[x].className=="general-content"){
					tables[x].rows[0].style.display='none';
					for(j in tables[x].rows){
						if(tables[x].rows[j].id=='printbutton'){
							tables[x].rows[j].style.display='none'
						}
						if(tables[x].rows[j].id=='pagination'){
							tables[x].rows[j].style.display='none'
						}
					}
				}
			}
		}
	}*/
function enableSearchEnter(e) {
	var keycode;
	if (window.event) {
		keycode = window.event.keyCode;
	} else {
		if (e) {
			keycode = e.which;
		}
	}
			//else return true;			
	if (keycode == 13) {
		search();
	}
}
function enableMSDSEnter(e, pid) {
	var keycode;
	if (window.event) {
		keycode = window.event.keyCode;
	} else {
		if (e) {
			keycode = e.which;
		}
	}
			//else return true;			
	if (keycode == 13) {
		msdsSearch(pid);
	}
}
function search() {
	var searchText = document.searchForm.param2.value;
	if (searchText && searchText != "") {
		document.searchForm.submit();
	}
}
var PlayVideo = {playWithMediaPlayer:function (videoUrl, downloadUrl) {
                         //"MediaPlayer.MediaPlayer.1"
	var message = "Do you want to download Windows Media Player?";
	if (!isPlayerAvailable("windows media player", "MediaPlayer.MediaPlayer.1") && confirm(message)) {
                              //if(confirm("Do you want to download Windows Media Player?")){
		window.open(downloadUrl);                                        
                              //}else{
                                // top.location = videoUrl;
                              //}
	} else {
		if (window.navigator.userAgent.indexOf("Safari") > -1) {
			window.open(videoUrl);
		} else {
			top.location = videoUrl;
		}
	}
}, playWithRealPlayer:function (videoUrl, downloadUrl) {
                               //rmocx.RealPlayer G2 Control
	var message = "Do you want to download RealPlayer?";
	if (!isPlayerAvailable("realplayer", "rmocx.RealPlayer G2 Control") && confirm(message)) {
                              //if("Do you want to download RealPlayer?"){
		window.open(downloadUrl);
                              //}else{
                              //   top.location = videoUrl;
                             // }
	} else {
		if (window.navigator.userAgent.indexOf("Safari") > -1) {
			window.open(videoUrl);
		} else {
			top.location = videoUrl;
		}
	}
}, playWithQuickTime:function (videoUrl, downloadUrl) {
                          //QuickTimeCheckObject.QuickTimeCheck.1
	var message = "Do you want to download QuickTime?";
	if (!isPlayerAvailable("quicktime", "QuickTimeCheckObject.QuickTimeCheck.1") && confirm(message)) {
                              //if(confirm("Do you want to download QuickTime")){
		window.open(downloadUrl);
                              //}else{
                              //   top.location = videoUrl;
                              //}
	} else {
		if (window.navigator.userAgent.indexOf("Safari") > -1) {
			window.open(videoUrl);
		} else {
			top.location = videoUrl;
		}
	}
}};
function isPlayerAvailable(name, activeXControlName) {
	var isPlayerAvail = false;
	if (navigator.plugins && navigator.plugins.length > 0) {
		for (var i = 0; i < navigator.plugins.length; i++) {
			if (navigator.plugins[i].name.toLowerCase().indexOf(name) >= 0) {
				isPlayerAvail = true;
				break;
			}
		}
	} else {
		if ("ActiveXObject" in window) {
			try {
				var actObj = new ActiveXObject(activeXControlName);
				isPlayerAvail = true;
			}
			catch (e) {
				isPlayerAvail = false;
			}
		}
	}
	return isPlayerAvail;
}
var PageBanner = {
					checkShockwaveFlash:function () {
							var isInstall = false;
							/*if (navigator.plugins && navigator.mimeTypes.length) {
								var a = navigator.plugins["Shockwave Flash"];
								if (a && a.description) {
									version = a.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s)+r/, ".");
									isInstall = true;
								}
							} else {
								if (navigator.userAgent.indexOf("MSIE") > -1 && !window.opera && "ActiveXObject" in window) {
									var b;// = h;
									try {
										b = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
									}
									catch (d) {
										a = 0;
										try {
											b = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
											a = 6;
											b.AllowScriptAccess = "always";
											alert("ShockwaveFlash.ShockwaveFlash.6");
										}
										catch (e) {
											if (a == 6) {
												alert("a == 6");
												version = a.toString();
											}
										}
										try {
											b = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
										}
										catch (f) {
										}
									}
									if (b) {
										a = b.GetVariable("$version").split(" ")[1];
										version = a.replace(/,/g, ".");
										isInstall = true;
									}
								}
							}*/
							
							// Major version of Flash required
							var majorVersion = 10;
							// Minor version of Flash required
							var minorVersion = 0;
							// Revision of Flash required
							var revision = 0;
							isInstall = DetectFlashVer(majorVersion, minorVersion, revision);
							return isInstall;
						}
					, loadBannerImage:function (flashPath, imagePath, title, cssClassName,containerId,imageLink,isNewWindow) {
						var content = "";
						if (flashPath && isSWFlash) {							
							content = "<object classid='clsid:166B1BCA-3F9C-11CF-8075-444553540000' name='Pixies' class='" + cssClassName + "'>";
							content = content + "<param name='src' value='" + flashPath + "'>";
							content = content + "<embed class='" + cssClassName + "' wmode='transparent' src='" + flashPath + "' pluginspage='http://www.macromedia.com/shockwave/download/' name='Pixies'></embed>";
							content = content + "</object>";
						} else if(flashPath) {
							content = "<a href='http://www.adobe.com/go/getflashplayer' target='_blank'><img alt='" + title + "' title='Click here to download flash player plugin' src='" + imagePath + "' class='" + cssClassName + "' border='0'/></a>";
						}
						else {
							if(imageLink){
								content = "<a href='"+imageLink+"' ";
								if(isNewWindow)content = content + " target='_blank'";
								content = content + ">"
							}
							content = content + "<img alt='" + title + "' title='"+ title +"' src='" + imagePath + "' class='" + cssClassName + "' border='0'/>";
							if(imageLink)
								content = content + "</a>";
						}
						var pageBanner = document.getElementById(containerId);
						//alert(pageBanner);
						if(pageBanner){
							pageBanner.innerHTML += content; 
						}
						//return content;
					}
				};

var isSWFlash = PageBanner.checkShockwaveFlash();

//pluginspage='http://www.macromedia.com/shockwave/download/'
//codebase='http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=7,0,2,0'
