/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@end @*/

if (!xmlhttp && typeof(XMLHttpRequest) != 'undefined') {
	
  var xmlhttp = new XMLHttpRequest();
}

function GetCountry(ip){
	
	xmlhttp.open('POST', "http://www.formyip.com/ipcountry_popup.php", false);
	
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	sendString = "ipaddresses=" + ip ;	
		
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}	
	
	alert(xmlResponse);	
}

function getImage(img){  
  
	xmlhttp.open('POST', "get_image.php", false);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	sendString = "img=" + img ;	
		
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}
	
	pop = document.getElementById('PopupImg');
	pop.innerHTML = xmlResponse;
	pop_offset (pop, 0, 0 );
	pop.className='show';
}


function open_div(id, player){  
  
	xmlhttp.open('POST', "get_video.php", false);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	
	sendString = "id=" + id + "&player=" + player;	
		
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}
	
	pop = document.getElementById('PopupVideo');
	pop.innerHTML = xmlResponse;
	pop_offset (pop, 300, 150 );
	pop.className = 'show';
}

function pop_offset (pop, ox,oy){

	mouse_x = cursorObj.getX();
	mouse_y = cursorObj.getY();
	

	var is_ie    = /MSIE/.test(navigator.userAgent);
		
	if (is_ie)
	{
    	pop.style.top  = (document.body.scrollTop + (oy > 0 ? oy : mouse_y)) + 'px';
    	pop.style.left = (document.body.scrollLeft + (ox > 0 ? ox : mouse_x)) + 'px';
	}
	else
	{
    	pop.style.top  = (window.scrollY + (oy > 0 ? oy : mouse_y)) + 'px';
    	pop.style.left = (window.scrollX + (ox > 0 ? ox : mouse_x)) + 'px';
	}
	
}