		function chkEnterPress4Search(e)
		{
			if(e.keycode==9)
			{
			return clear();
			}

			if(e.keyCode==13)
			{
				return search();
			}


		}
		function search()
		{
			
			if(trimWhitespace(document.getElementById('txtSearch').value)=="Search")
			{
				alert("Please enter the search string.");
				//document.getElementById('txtSearch').select();
				document.getElementById('txtSearch').focus();
				return false;
			}
			if(trimWhitespace(document.getElementById('txtSearch').value).length==0)
			{
				alert("Please enter the search string.");
				document.getElementById('txtSearch').select();
				document.getElementById('txtSearch').focus();
				return false;
			}
			if(trimWhitespace(document.getElementById('txtSearch').value).length <=2)
			{
				alert("Please enter the search string greater than 2 character.");
				document.getElementById('txtSearch').select();
				document.getElementById('txtSearch').focus();
				return false;
			}
			else
			{
				var keyword = document.getElementById('txtSearch').value;
				
				
				document.location.href="/newsearch/Global_search.aspx?txtSearch=" + keyword + "&exact=exact&ordersearch=popular";
				
				return true;
			}
		}
		function BuyProduct(url)
		{
			window.location =url; 

		}
		
		function AddToCartProductlink(id,qty,itemno)
		{
			var itemno= id;
			id="txt_" + id
			qty=document.getElementById(id).value;
			var url = window.location.toString();
			var name1=qty;
			for( j=0;j<name1.length;j++)
			{
					ch = name1.charAt(j);
					if((ch>='0' && ch<='9')|| (ch==' '))
					{
					continue;
					}
					else
					{
							alert("Please Enter Valid Quantity");
							document.getElementById(id).select();
							document.getElementById(id).focus();
							return false;	
					}	

			}
			if(trimWhitespace(document.getElementById(id).value)=="0")
			{

				alert("Please Enter valid Quantity");
				document.getElementById(id).select();
				document.getElementById(id).focus();
				return false;
			}
			if(trimWhitespace(document.getElementById(id).value).length==0)
			{
				status="False"
				alert("Please Enter valid Quantity");
				document.getElementById(id).select();
				document.getElementById(id).focus();
				return false;
			}
				//alert(url);
				
			var rand_no2 = Math.random();
			window.location="/CreateHtml/Addtocart.aspx?item="+ itemno +"&qty=" + qty + "&sell=''&backurl=" + url + "&simply=" + rand_no2 ;
		}
		
		function trimWhitespace(string) 
		{
			var newString  = '';
			var substring  = '';
			beginningFound = false;
			
			// copy characters over to a new string
			// retain whitespace characters if they are between other characters
			for (var i = 0; i < string.length; i++) 
			{
				
				// copy non-whitespace characters
				if (string.charAt(i) != ' ' && string.charCodeAt(i) != 9) 
				{
					
					// if the temporary string contains some whitespace characters, copy them first
					if (substring != '') 
					{
						newString += substring;
						substring = '';
					}
					newString += string.charAt(i);
					if (beginningFound == false) beginningFound = true;
				}
				
				// hold whitespace characters in a temporary string if they follow a non-whitespace character
				else if (beginningFound == true) substring += string.charAt(i);
			}
			return newString;
		}
		
		
		
		

		function getUsercontrol(id,refpage) 
		{
			//alert(id);
			var req = false;
			var pageno=parseInt(id);
					
			var rand_no = Math.random();
			url=refpage;
			refurl= document.referrer;
						
			//url = "/CreateHTML/testcat.aspx?M1=Cabling%20Products&sub1=internal"
			url = url + "&page=" + pageno  + "&simply=" + rand_no + "&refurl=" + refurl
			
						
			// For Safari, Firefox, and other non-MS browsers
			if (window.XMLHttpRequest) {
				try {
				req = new XMLHttpRequest();
				} catch (e) {
				req = false;
				}
			} else if (window.ActiveXObject) {
				// For Internet Explorer on Windows
				try {
				req = new ActiveXObject("Msxml2.XMLHTTP");
				} catch (e) {
				try {
					req = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {
					req = false;
				}
				}
			}
			//var element = document.getElementById("linksbody");
			/*if (!element) {
			alert("Bad id " + id +
			"passed to clientSideInclude." +
			"You need a div or span element " +
			"with this id in your page.");
			return;
			}*/
			if (req)
			 {
				// Synchronous request, wait till we have it all
				req.open('GET', url, false);
				req.send(null);
				//alert("here");
				
				//element.innerHTML = req.responseText;
				var str =req.responseText;
				try {
				document.close(); 				
				document.write(str);
				} catch (e) {}
				document.close();
				//document.div1.document.write(str);
				try {
				document.getElementById('lblpageno').focus();
				} catch (e) {}
						
				
			} 
		}
		
		function getdata(id,refurl)
		{
			
			//getUsercontrol('0',refurl) 
			getheader();
			getfooter();
			
		}
		
		function Show()
		{
			document.getElementById("popcat").style.display="block";

		}
		function Hide()
		{
			/* hide the pop-up */
			document.getElementById("popcat").style.display="none";
			
			
		}
		function Showright()
		{
			document.getElementById("popright").style.display="block";

		}
		function Hideright()
		{
			/* hide the pop-up */
			document.getElementById("popright").style.display="none";
					
					
		}
		function getmaincat(catname) 
		{
			
			var req = false;
								
			var rand_no = Math.random();
			refurl= document.referrer;		
			//url = "/CreateHTML/testcat.aspx?M1=Cabling%20Products&sub1=internal"
			url = "/CreateHtml/getmaincat.aspx?catname=" + catname  + "&simply=" + rand_no + "&refurl=" + refurl
			
						
			// For Safari, Firefox, and other non-MS browsers
			if (window.XMLHttpRequest) {
				try {
				req = new XMLHttpRequest();
				} catch (e) {
				req = false;
				}
			} else if (window.ActiveXObject) {
				// For Internet Explorer on Windows
				try {
				req = new ActiveXObject("Msxml2.XMLHTTP");
				} catch (e) {
				try {
					req = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {
					req = false;
				}
				}
			}
			if (req)
			 {
				// Synchronous request, wait till we have it all
				req.open('GET', url, false);
				req.send(null);
				//alert("here");
				
				//element.innerHTML = req.responseText;
				var str =req.responseText;
				//var anlyticscode=getgoogle();
				//alert(anlyticscode);
				//str = str + anlyticscode;
				try {
				document.close(); 				
				document.write(str);
				} catch (e) {}
				document.close();
				//document.div1.document.write(str);
								
				
			} 
		}
		function getgoogle()
		{
			var stranalytics='<script type="text/javascript">'
			stranalytics += 'var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");'
			stranalytics += 'document.write(unescape("%3Cscript src="" + gaJsHost + "google-analytics.com/ga.js" type="text/javascript"%3E%3C/script%3E"));'
			stranalytics += '</script>'
			stranalytics += '<script type="text/javascript">'
			stranalytics += 'var pageTracker = _gat._getTracker("UA-350390-1");'
			stranalytics += 'pageTracker._trackPageview();'
			stranalytics += '</script>'
			return stranalytics;
		}
		function getheader() 
		{
			
			var req = false;
			
					
			var rand_no = Math.random();
			refurl= document.referrer;
					
			url = "/CreateHTML/getheader.aspx?simply=" + rand_no + "&refurl=" + refurl
			//alert(url);
					
						
			// For Safari, Firefox, and other non-MS browsers
			if (window.XMLHttpRequest) {
				try {
				req = new XMLHttpRequest();
				} catch (e) {
				req = false;
				}
			} else if (window.ActiveXObject) {
				// For Internet Explorer on Windows
				try {
				req = new ActiveXObject("Msxml2.XMLHTTP");
				} catch (e) {
				try {
					req = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {
					req = false;
				}
				}
			}
			
			if (req)
			 {
				// Synchronous request, wait till we have it all
				req.open('GET', url, false);
				req.send(null);
				
				
				//element.innerHTML = req.responseText;
				var str =req.responseText;
				try {
				document.getElementById('headercon').innerHTML=str
				} catch (e) {}
				document.close();
				
						
				
			} 
		}
		
		function getfooter() 
		{
			
			var req = false;
			
					
			var rand_no = Math.random();
			refurl= document.referrer;
					
			url = "/CreateHTML/getfooter.aspx?simply=" + rand_no + "&refurl=" + refurl
			//alert(url);
					
						
			// For Safari, Firefox, and other non-MS browsers
			if (window.XMLHttpRequest) {
				try {
				req = new XMLHttpRequest();
				} catch (e) {
				req = false;
				}
			} else if (window.ActiveXObject) {
				// For Internet Explorer on Windows
				try {
				req = new ActiveXObject("Msxml2.XMLHTTP");
				} catch (e) {
				try {
					req = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {
					req = false;
				}
				}
			}
			
			if (req)
			 {
				// Synchronous request, wait till we have it all
				req.open('GET', url, false);
				req.send(null);
				
				
				//element.innerHTML = req.responseText;
				var str =req.responseText;
				try {
				document.getElementById('footercon').innerHTML=str
				} catch (e) {}
				document.close();
				
						
				
			} 
		}
		function google()
		{
			window.location.href = "http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk=" + document.location.href + "&title=" + document.title;
		}
		function Digg()
		{
			window.location.href = "http://digg.com/submit?phase=2&url="+document.location.href+"&title="+document.title;
		}
		function FURL()
		{
			window.location.href = "http://www.furl.net/store?s=f&to=0&u="+document.location.href+"&ti="+document.title;
		}
		function REDDIT()
		{
			window.location.href = "http://reddit.com/submit?url="+document.location.href+"&title="+document.title;
		}
		function STUMBLEUPON()
		{
			window.location.href = "http://www.stumbleupon.com/submit?url="+document.location.href+"&title="+document.title;
		}
		function TECHNORATI()
		{
			window.location.href = "http://technorati.com/faves?add="+document.location.href;
		}
		function SQUIDOO()
		{
			window.location.href = "http://www.squidoo.com/lensmaster/bookmark?"+document.location.href+"&title="+document.title;
		}
		function WINDOWS()
		{
			window.location.href = "https://favorites.live.com/quickadd.aspx?marklet=1&mkt=en-us&url="+document.location.href+"&title="+document.title;
		}
		function YAHOO()
		{
			window.location.href = "http://myweb.yahoo.com/myresults/bookmarklet?u="+document.location.href+"&t="+document.title;
		}
		function ASK()
		{
			window.location.href = "http://myjeeves.ask.com/mysearch/BookmarkIt?v=1.2&t=webpages&url="+document.title.href+"&title="+document.title;
		}
		