		function addtocart(Gcode,itemno,qty)
		{
			var url = window.location.toString();

			window.location="/createhtml/Addtocart.aspx?item="+ itemno +"&qty=1&sell=''" + "&backurl=" + url;
		}
		function getdata()
		{
			//alert("Here");
				 getUsercontrol() ;
				 getfooter();
		}
		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 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() 
		{
			
			var req = false;
			
					
			var rand_no = Math.random();
			refurl= document.referrer;
					
			url = "/CreateHTML/getheadernormal.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;
		}
		
		
		
		