
function getXmlHttp()
{
	var xmlhttp;
	try
	{
		xmlhttp=new XMLHttpRequest();
	}
	catch(e)
	{
		try
		{
			xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e)
			{
				alert('Browser does not support XMLHttp!');
			}
		}
	}
	return xmlhttp;
}

function getMenuData(s,container_id)
{
	container = document.getElementById(container_id);
	var xmlhttp = getXmlHttp();
	var url = '/menu_reader.jsp?key='+s;

	if(xmlhttp)
	{
		xmlhttp.onreadystatechange = function()
										{
											if(xmlhttp.readyState == 4)
											{
												container.innerHTML = xmlhttp.responseText;
											}
											if(xmlhttp.readyState == 2)
											{
												container.innerHTML = '<img style="padding-left: 90px;" src="/images/Processing.gif" />';
											}
										}
		xmlhttp.open('get',url,true);
		xmlhttp.send(null);
	}
	else
	{
		alert('cannot create xmlhttp Object!');
	}
}

function loadJobs(zone,category,country,container_id)
{
	var container = document.getElementById(container_id);
	var xmlhttp = getXmlHttp();
	var url = '/new_job_search.jsp?zone='+zone+'&category='+category+'&country='+country;
	if(xmlhttp)
	{
		xmlhttp.onreadystatechange = function()
										{
											if(xmlhttp.readyState == 4)
											{
												container.innerHTML = xmlhttp.responseText;
												document.getElementById('job_count_display').innerHTML = document.getElementById('_ajax_job_count').innerHTML + ' result(s)';
											}
											if(xmlhttp.readyState == 3)
											//if(xmlhttp.readyState == 2 || xmlhttp.readyState == 1)
											{
												container.innerHTML = '<img style="padding-left: 210px;" src="/images/Processing.gif" />';
											}
										}
		xmlhttp.open('get',url,true);
		xmlhttp.send(null);
	}
	else
	{
		alert('cannot create xmlhttp Object!');
	}

}


function loadNewsAndEvents(type,zone,topic,date,container_id)
{
	var container = document.getElementById(container_id);
	var xmlhttp = getXmlHttp();
	var url = "";
	if(type == 'news')
	{
		url = '/newedge_news_search.jsp?type='+type+'&zone='+zone+'&topic='+topic;
	}
	if(type == 'events_and_conferences')
	{
		url = '/newedge_events_and_conferences_search.jsp?type='+type+'&zone='+zone+'&topic='+topic+'&date='+date;
	}
	if(xmlhttp)
	{
		xmlhttp.onreadystatechange = function()
										{
											if(xmlhttp.readyState == 4)
											{
												container.innerHTML = xmlhttp.responseText;
												document.getElementById('job_count_display').innerHTML = document.getElementById('_ajax_job_count').innerHTML + ' result(s)';
											}
											if(xmlhttp.readyState == 2 || xmlhttp.readyState == 1)
											{
												container.innerHTML = '<img style="padding-left: 210px;" src="/images/Processing.gif" />';
											}
										}
		xmlhttp.open('get',url,true);
		xmlhttp.send(null);
	}
	else
	{
		alert('cannot create xmlhttp Object!');
	}

}
function loadNewsAndEvents2(type,zone,topic,container_id)
{
	var container = document.getElementById(container_id);
	//alert(container);
	var xmlhttp = getXmlHttp();
	var url = "";
	if(type == 'news')
	{
		url = '/newedge_news_search.jsp?type='+type+'&zone='+zone+'&topic='+topic;
	}
	if(type == 'events_and_conferences')
	{
		url = '/newedge_events_and_conferences_search.jsp?type='+type+'&zone='+zone+'&topic='+topic;
	}
	if(xmlhttp)
	{
		xmlhttp.onreadystatechange = function()
										{
											if(xmlhttp.readyState == 4)
											{
												container.innerHTML = xmlhttp.responseText;
												document.getElementById('job_count_display').innerHTML = document.getElementById('_ajax_job_count').innerHTML + ' result(s)';
											}
											if(xmlhttp.readyState == 2 || xmlhttp.readyState == 1)
											{
												container.innerHTML = '<img style="padding-left: 210px;" src="/images/Processing.gif" />';
											}
										}
		xmlhttp.open('get',url,true);
		xmlhttp.send(null);
	}
	else
	{
		alert('cannot create xmlhttp Object!');
	}

}


function loadContacts(key,zone,country,container_id)
{
	var container = document.getElementById(container_id);
	var xmlhttp = getXmlHttp();
	var url;
	if(key == 'hr')
	{
		url = '/hr_contacts_search.jsp?zone='+zone+'&country='+country;
	}
	if(key == 'press')
	{
		url = '/press_contacts_search.jsp?zone='+zone+'&country='+country;
	}
	if(key == 'sales')
	{
		url = '/sales_contacts_search.jsp?zone='+zone+'&country='+country+'&idlaksha=3231223434212312rwrwer323323s1123233234342278234';
	}
	
	if(xmlhttp)
	{
		xmlhttp.onreadystatechange = function()
										{
											if(xmlhttp.readyState == 4)
											{
												var str = xmlhttp.responseText;
												container.innerHTML = str;
												document.getElementById('job_count_display').innerHTML = document.getElementById('_ajax_job_count').innerHTML + ' result(s)';
											}
											if(xmlhttp.readyState == 2 || xmlhttp.readyState == 1)
											{
												//	container.innerHTML = '<div><img style="padding-left: 210px;" src="/images/Processing.gif" /></div>';
											}
										}
		xmlhttp.open('get',url,true);
		xmlhttp.send(null);
	}
	else
	{
		alert('cannot create xmlhttp Object!');
	}

}

function showHighlight(obj)
{
	obj.className = 'tr_highlight';
}

function deHighlight(obj)
{
	obj.className = '';
}


function loadVideo(container_id,url)
{
	var url = "/video_player.jsp?do_media="+url;
	GB_showCenter('Video', url,315,390);
	return;
}
function loadVideoHomepage(container_id,url)
{
	var url = url;
	GB_showCenter('Video', "../../../../../"+url,604,1000);
	return;
}


function loadGreyPage(url){
	var page = "";
	if(url==undefined){
		page = "http://www1.newedgegroup.com/formtool/primebrokerage/PBManagerRegistration.html";
	}else{
		page = url;			
	}
	GB_showCenter('',page,600,700);
	return;
}
function loadAlternative(url){
	var page = "";
	if(url==undefined){
		page = "http://www1.newedgegroup.com/formtool/primebrokerage/PBManagerRegistration.html";
	}else{
		page = url;			
	}
	GB_showCenter('',page,600,700);
	return;
}


function loadVideoPlayer(url){
	GB_showCenter('Video', "/video/"+url,416,484);
	return;
}


function loadHomePageNews(container_id)
{
	var container = document.getElementById(container_id);
	

	var xmlhttp = getXmlHttp();
	var url = "/home_page_news.jsp";
	

	if(xmlhttp)
	{
		xmlhttp.onreadystatechange = function()
										{
											if(xmlhttp.readyState == 4)
											{
												container.innerHTML = xmlhttp.responseText;												
											}
											if(xmlhttp.readyState == 2 || xmlhttp.readyState == 1)
											{
												container.innerHTML = '<img id="loading-ajax" style="padding-left: 100px;" src="/images/AjaxLoadingIcon.gif" />';
											}
										}
		xmlhttp.open('get',url,true);
		xmlhttp.send(null);
	}
	else
	{
		alert('cannot create xmlhttp Object!');
	}
}
/*annata added */
 function SetDays(selectedmonth,selectedyear,container_id,ddname)
	 {
	 
		var xmlhttp = getXmlHttp();
		if(xmlhttp)
		{
			var rand2 = Math.random();
			rand2 = rand2 +":"+Math.random();
			var url = '/MonthCountry.jsp?monthval='+selectedmonth+'&yearval='+selectedyear+'&param=month&ddname='+ddname+'&selecteddate=-1&cache='+rand2;
		
			xmlhttp.onreadystatechange = function()
										{
											if(xmlhttp.readyState == 4)
											{
													document.getElementById(container_id).innerHTML = xmlhttp.responseText;
											}
											if(xmlhttp.readyState == 3)
											{
												document.getElementById(container_id).innerHTML = '<img src="/images/Processing.gif" />';
											}
										}
			xmlhttp.open('get',url,true);
			xmlhttp.send(null);
		}
		else
		{
			alert('cannot create AJAX request!');
		
		 }
   }

function SetDaysbynews(selectedmonth,selectedyear,container_id,ddname,selecteddate)
	 {
	 
		var xmlhttp = getXmlHttp();
		if(xmlhttp)
		{
			var rand2 = Math.random();
			rand2 = rand2 +":"+Math.random();
			var url = '/MonthCountry.jsp?monthval='+selectedmonth+'&yearval='+selectedyear+'&param=month&ddname='+ddname+'&selecteddate='+selecteddate+'&cache='+rand2;
		
			xmlhttp.onreadystatechange = function()
										{
											if(xmlhttp.readyState == 4)
											{
													document.getElementById(container_id).innerHTML = xmlhttp.responseText;
											}
											if(xmlhttp.readyState == 3)
											{
												document.getElementById(container_id).innerHTML = '<img src="/images/Processing.gif" />';
											}
										}
			xmlhttp.open('get',url,true);
			xmlhttp.send(null);
		}
		else
		{
			alert('cannot create AJAX request!');
		
		 }
   }
 
 
   function getcountrylistbyzone(zoneid,container_id)
		{
		
		  var xmlhttp = getXmlHttp();
		if(xmlhttp)
		{
			var rand3 = Math.random();
			rand3 = rand3 +":"+Math.random();
			var url = '/MonthCountry.jsp?param=countrylist&zoneid='+zoneid+'&countryid=-1&cache='+rand3;
		
			xmlhttp.onreadystatechange = function()
										{
											if(xmlhttp.readyState == 4)
											{
													document.getElementById(container_id).innerHTML = xmlhttp.responseText;
											}
											if(xmlhttp.readyState == 3)
											{
												document.getElementById(container_id).innerHTML = '<img src="/images/Processing.gif" />';
											}
										}
			xmlhttp.open('get',url,true);
			xmlhttp.send(null);
		}
		else
		{
			alert('cannot create AJAX request!');
		
		 }
		} 
		
		
function Setcountrylistbynews(zoneid,container_id,countryid)
		{
		
		  var xmlhttp = getXmlHttp();
		if(xmlhttp)
		{
			var rand3 = Math.random();
			rand3 = rand3 +":"+Math.random();
			var url = '/MonthCountry.jsp?param=countrylist&zoneid='+zoneid+'&countryid='+countryid+'&cache='+rand3;
		
			xmlhttp.onreadystatechange = function()
										{
											if(xmlhttp.readyState == 4)
											{
													document.getElementById(container_id).innerHTML = xmlhttp.responseText;
											}
											if(xmlhttp.readyState == 3)
											{
												document.getElementById(container_id).innerHTML = '<img src="/images/Processing.gif" />';
											}
										}
			xmlhttp.open('get',url,true);
			xmlhttp.send(null);
		}
		else
		{
			alert('cannot create AJAX request!');
		
		 }
		} 


