var xmlHttp

function GetXmlHttpObject()
{ 
	var objXMLHttp=null
	if (window.XMLHttpRequest)
	{
		objXMLHttp=new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	
	return objXMLHttp
}

//-------------------------------------------------------------------------------
function SwitchMenuAjax(str,strResLooper)
{
	//alert(str)
	//alert(strResLooper)
	xmlHttp=GetXmlHttpObject()
	//MOZILA
	if (window.XMLHttpRequest) {
        xmlHttp = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	//STR = CityID
	var url="/GetSubSections.asp"
	url=url+"?ResponseID=" + str 
	url=url+"&ResLooper=" + strResLooper 
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function stateChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		//alert(ResponseID);
	    var resText = xmlHttp.responseText;
		//var PlaceId = resText.charAt(0);
		var ResArray = resText.split("|");
		var PlaceId = ResArray[0];
		//alert('PlaceId:'+PlaceId);
		var wholeHTML = ResArray[1];
		//var wholeHTML = resText.substring(1,lenght(resText)-1);// mid(resText,1,length(resText)-1)
		//alert('wholeHTML:'+wholeHTML);
		document.all('sub_' + PlaceId).innerHTML=wholeHTML;
		//document.all('sub_' + PlaceId).style.display = '';
				
		if (document.all('sub_' + PlaceId).style.display == '')
		{
			//alert('true');
			document.all('sub_' + PlaceId).style.display = 'none';
		}
		else
		{
			//alert('false');
			document.all('sub_' + PlaceId).style.display = '';
		
		}
		
	
		//document.getElementById("Responce" + PlaceId).innerHTML=wholeHTML;
	} 
} 

function SwitchMenu(obj)
{
try{
	
	if (document.all('sub_' + obj).style.display == 'none')
		{
		//alert('true');
		document.all('sub_' + obj).style.display = '';
		//document.all('img_' + obj).src = 'imgs/answer_bullet.gif';
		//document.all('img_' + obj).alt = '1';

		}
	else
		{
		//alert('false');
		document.all('sub_' + obj).style.display = 'none';
		//document.all('img_' + obj).src = 'imgs/question_bullet.gif';
		//document.all('img_' + obj).alt = '1';
		}
	}
catch(e){}
}

function SwitchMenu2(obj)
{
try{
	
	if (document.all('sub_' + obj).style.display == 'none')
		{
		//alert('true');
		document.all('sub_' + obj).style.display = '';
		//document.all('img_' + obj).src = 'imgs/answer_bullet.gif';
		//document.all('img_' + obj).alt = '1';

		}
	else
		{
		//alert('false');
		document.all('sub_' + obj).style.display = 'none';
		//document.all('img_' + obj).src = 'imgs/question_bullet.gif';
		//document.all('img_' + obj).alt = '1';
		}
	}
catch(e){}
}


//Change by alex 13/07/06
function Open_PopupResponse(intValue,intParentID)
	{
		// alert (intParentID);
		 var ScreenWidth=window.screen.width;
	   	 var ScreenHeight=window.screen.height;
		 var movefromedge=0;
		 placementx=(ScreenWidth/2)-((600)/2);
		 placementy=(ScreenHeight/2)-((650+50)/2);
	     address = "Show_AddResponse.asp?DynamicContentID=" + intValue + "&ParentID=" + intParentID 
		 prm = "width=550,height=595,toolbar=0,location=0,directories=0,status=1,scrollbars=yes,menubar=0,resizable=1,left="+placementx+",top="+placementy+",screenX="+placementx+",screenY="+placementy+","
	     WinPop=window.open(address,'window1',prm);
	}
	
	function Open_PopupResponseAuthor(intValue,intParentID,RespAuthorID)
	{
		// alert (intParentID);
		 var ScreenWidth=window.screen.width;
	   	 var ScreenHeight=window.screen.height;
		 var movefromedge=0;
		 placementx=(ScreenWidth/2)-((600)/2);
		 placementy=(ScreenHeight/2)-((650+50)/2);
	     address = "Show_AddResponse.asp?DynamicContentID=" + intValue + "&ParentID=" + intParentID + "&AuthorID=" + RespAuthorID
		 prm = "width=550,height=595,toolbar=0,location=0,directories=0,status=1,scrollbars=yes,menubar=0,resizable=1,left="+placementx+",top="+placementy+",screenX="+placementx+",screenY="+placementy+","
	     WinPop=window.open(address,'window1',prm);
	}
	
	


function Open_PopupPrint(intValue,intType)
	{
		/* ****************************
		intType
		*******************************
		0 = print
		1 = doc file
		*******************************
		*/
		 var ScreenWidth=window.screen.width;
	   	 var ScreenHeight=window.screen.height;
		 var movefromedge=0;
		 placementx=(ScreenWidth/2)-((550)/2);
		 placementy=(ScreenHeight/2)-((600+50)/2);
	     address = "Show_Chosen_Print.asp?DynamicContentID=" + intValue + "&DocType=" + intType
	     prm = "width=550,height=600,toolbar=0,location=0,directories=0,status=1,scrollbars=auto,menubar=0,resizable=1,left="+placementx+",top="+placementy+",screenX="+placementx+",screenY="+placementy+","
	     WinPop=window.open(address,'window1',prm);
	}
	
	
	
	function winPopup()
	{
		/* ****************************
		intType
		*******************************
		0 = print
		1 = doc file
		*******************************
		*/
		 var ScreenWidth=window.screen.width;
	   	 var ScreenHeight=window.screen.height;
		 var movefromedge=0;
		 placementx=(ScreenWidth/2)-((458)/2);
		 placementy=(ScreenHeight/2)-((382+50)/2);
	     address = "PopUp.asp"
	     prm = "width=408,height=332,toolbar=0,location=0,directories=0,status=1,scrollbars=yes,menubar=0,resizable=1,left="+placementx+",top="+placementy+",screenX="+placementx+",screenY="+placementy+","
	     WinPop=window.open(address,'window1',prm);
	}
	
	
