		var globalTextID = "0";
		var sCount=0;
		function translator()
		{
			
			win = open("translator.htm","","width=820,height=550,taskbar=no, scrollbars=no, menubar=no,left=0,top=0,screenX=400,screenY=300")
			//win = open("","","width=520,height=550,taskbar=no, scrollbars=no, menubar=no,left=0,top=0,screenX=400,screenY=300")
		}
		
		function openMediaGallery(sectionid, sideID,templateID)
		{
			win = open("imageGallery.aspx?templateID="+templateID+"&sideID="+sideID+"&section=" + sectionid,"","width=820,height=480,taskbar=no, scrollbars=yes, menubar=no,left=200,top=180,screenX=400,screenY=300")
			win.document.close();      
		}
		function OpenUploadNew(sectionid, sideID,templateID)
		{
			win = open("UploadNewImage.aspx?templateID="+templateID+"&sideID="+sideID+"&section=" + sectionid,"","width=820,height=700,taskbar=no, scrollbars=yes, menubar=no,left=200,top=180,screenX=400,screenY=300")
			win.document.close();      
		}
		function OpenCrop(sectionid, sideID,templateID)
		{			
			win = open("imageGallery.aspx?templateID="+templateID+"&sideID="+sideID+"&section=" + sectionid,"","width=820,height=700,taskbar=no, scrollbars=yes, menubar=no,left=200,top=180,screenX=400,screenY=300")
			win.document.close();      
		}
		
		function MakeHidden()
		{
			document.getElementById('nav').style.display = "none";
		}
		
			function openGallery(sectionid, sideID,templateID)
			{
				win = open("CustomPhotos.aspx?sideID="+sideID+"&templateid="+templateID+"&section=" + sectionid,"","resizable=0,width=820,height=600,taskbar=no, scrollbars=yes, status=yes, menubar=no,left=200,top=180,screenX=400,screenY=300")
				win.document.close();      
			}			
				
			function convertSpaces(str) 
			{
				var out = "", flag = 0;
				for (i = 0; i < str.length; i++) 
				{
					if (str.charAt(i) != " ") 
					{
						out += str.charAt(i);
						flag = 0;
					}
					else 
					{
						if(flag == 0) 
						{
							out += "+";
							flag = 1;
						}
					}
				}
				return out;
			}

			function SaveMe(NewContent)
			{		
				document.getElementById('savecontent').value=NewContent;	
				document.btmsaveform.submit();
			}			

			function ShowMenu() {
				
				if (document.getElementById('nav').style.display == "none") {
					document.getElementById('nav').style.display = "";
				} else {
					document.getElementById('nav').style.display = "none";
				}
			}
			
			function DeleteMe(textID)
			{
					
				//Create random number to prevent browser from caching the image
				var date = new Date();
				var ran_number = String(date.getHours()) + String(date.getMinutes()) + String(date.getSeconds()) + String(date.getMilliseconds());
				
				//find the value of dynamic textbox
				//replace the div content and call aspx page
				document.getElementById('hiddenDiv').innerHTML = "<img border ='0' src='/Cards/Save/delete.aspx?a=del&textid=" + textID+"'>";
			}

			
		
			
			function PageStart()
			{
			if (document.getElementById('CurrentSelected'))
				document.getElementById('CurrentSelected').value = 0;				
			}
			
			window.onload = PageStart;

