/*@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 getList(id, lang){	
		
		xmlhttp.open('POST', "ajaxik.php", false);
		xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		
		sendString = "id=" + id + "&lang=" + lang;	
				
		xmlhttp.send(sendString);
		
		if ( xmlhttp.readyState == 4 ){	
			
			var xmlResponse = xmlhttp.responseText;
		}
		
		
		document.getElementById("news_td").innerHTML = xmlResponse;		
      document.getElementById('NewsTable').className='crvisible';
}



function getArticles(id, lang){  
  
	xmlhttp.open('POST', "get_topics.php", false);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	
	sendString = "id=" + id + "&lang=" + lang;	
		
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}
	
	pop = document.getElementById('AuthorTopics');
	pop.innerHTML = xmlResponse;
    pop_offset (pop, 0, 150);
	pop.className='crvisible';
}


function getActivity(id, lang){  
  
	xmlhttp.open('POST', "get_activity.php", false);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	sendString = "id=" + id + "&lang=" + lang;	
		
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}
	
	document.getElementById("PopupAct").innerHTML = xmlResponse;
	document.getElementById('PopupAct').className='crvisible';
	
	pop = document.getElementById('PopupAct');
	pop.innerHTML = xmlResponse;
	pop_offset (pop, 200, 150 );
	pop.className='crvisible';
	
}

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

function getFullArticle(id, lang){  
  
	xmlhttp.open('POST', "get_article.php", false);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	sendString = "id=" + id + "&lang=" + lang;	
		
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}
	
	pop = document.getElementById('Article');
	pop.innerHTML = xmlResponse;
    pop_offset (pop, 0, 100 );
	pop.className='crvisible';
}


function pop_offset (pop, ox,oy){

	mouse_x = cursorObj.getX();
	mouse_y = cursorObj.getY();
	pop.style.top  = mouse_y + oy + "px";
	pop.style.left = mouse_x + ox + "px";
	
	//pop.style.top = cursorObj.getY() + oy + "px";
	//pop.style.left = cursorObj.getX() + ox + "px";
	//alert('m_x '+mouse_x+"\n"+'m_y '+mouse_y+"\n");

/*	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';
    	//pop.style.top  = ((oy != 0 ? oy : mouse_y)) + 'px';
    	//pop.style.left = ((ox != 0 ? ox : mouse_x)) + 'px';    	
    	
    	//pop.style.top  = ((oy != 0 ? oy : mouse_y)) + 'px';
    	//pop.style.left = ((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';
    	pop.style.top  = (oy != 0 ? oy : 0) + mouse_y + 'px';
    	pop.style.left = (ox != 0 ? ox : 0) + mouse_x + 'px';

	}*/
	
}



function getProject(id, page, lang, x, y){  
  
	xmlhttp.open('POST', "get_project.php", false);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	sendString = "id=" + id + "&page=" + page + "&lang=" + lang;	
		
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}
	/////////////////////////	
	var pops = Array();
	
	pops [0] = 'SendRight' ;
	pops [1] = 'PayRight'  ;
	pops [2] = 'FeedRight' ;
	
	var pops_len = pops.length;		for( i=0; i < pops_len; i++ ){ close( pops[i] ) }
	/////////////////////////	
	
	pop = GEBI('Profile');
	pop.className='open';
	pop.innerHTML = xmlResponse;
	pop_offset (pop, x, y );
	//pop_offset (pop, 0, -700 );
	
	
}




function getFeedRight(id, page, lang){  
  
	xmlhttp.open('POST', "get_feedright.php", false);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	sendString = "id=" + id + "&page=" + page + " &lang=" + lang;	
	sendString += "&ses=" + getCookie2('PHPSESSID') ;	
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}
	
	document.getElementById('SendRight').className='close';
	document.getElementById('PayRight').className='close';
	pop = document.getElementById('FeedRight');
	//alert(pop.className);
	pop.className='open';
	//alert(pop.className);
	pop.innerHTML = xmlResponse;
	//pop_offset (pop, 200, 100 );
	
	
}

function getPayRight(id, page, lang)	{  
  
	xmlhttp.open('POST', "get_payright.php", false);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	sendString = "id=" + id + "&page=" + page + " &lang=" + lang;	
		
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){		
		var xmlResponse = xmlhttp.responseText;
	}
	
	GEBI('SendRight').className='close';
	GEBI('FeedRight').className='close'
	pop = GEBI('PayRight');
	pop.className='open';
	pop.innerHTML = xmlResponse;
	pop.style.position='absolute';
	pop_offset (pop, 0, -150 );
	
	
}


function getSendRight(id, page, lang) {  
  
	var h = GEBI('send');
	h.p_i.value = id;
	GEBI('PayRight').className='close';
	//GEBI('Feed').className='close';
	GEBI('FeedRight').className='close'
	pop = document.getElementById('SendRight');
	pop.className='open';
	pop.style.position='absolute';
	pop_offset (pop, 250, -150 );
	
}
////////////////////////////////////
////////////////////////////////////

function getFeedRight2(form_id, id, page, lang)	{  
	
	GEBI('SendRight').className='close';
	GEBI('PayRight').className='close';
	pop = GEBI('FeedRight');
	GEBI(form_id).p_i.value = id;
	//GEBI('p_i').value=id;
	pop.className='open';
	pop.style.position='absolute';
	pop_offset (pop, 0, -250 );
	pop_offset (pop, 0, -300 );
		
}



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

function PopImg(div_w, id, img, lang, x, y ){  
  
	xmlhttp.open('POST', "get_image.php", false);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	sendString = "id=" + id + "&img=" + img + "&lang=" + lang;	
		
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}
	
	//document.getElementById('SendRight').className='close';
	//document.getElementById('FeedRight').className='close'	
	pop = document.getElementById('PopImg');
	document.getElementById('Profile').className='close';
	pop.width     = div_w;
	pop.className = 'open';
	pop.innerHTML =  xmlResponse;
	pop_offset (pop, x, y );
	//pop_offset (pop, 0, -550 );
	
}


//       showPop(id, path ,item_id, page, lang, x, y)
var struct_div = new Array();
function showPop(id, path ,item_id, page, x, y){

var div_len =	struct_div.length; for (i = 0; i < div_len; i++) {GEBI(struct_div[i]).innerHTML=''; GEBI((struct_div[i])).className='open'; }		
	
////////////////////

	xmlhttp.open('POST', path , false);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	sendString  = "close=" + id + "&id=" + item_id + "&page=" + page ;	
	sendString += "&ses=" + getCookie('PHPSESSID') ;
		
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}
	
	pop = document.getElementById(id);
	pop.className='open';
	pop.innerHTML = xmlResponse;
	pop_offset (pop, x, y );
	
////////////////////
	
	
	
}


function PopImg71(id, src, alt, w , h ,  x , y){
	
	pop = document.getElementById(id);
	pop.className='open';
	document.getElementById('i_p').innerHTML = '<img src="'+src+'" alt="'+alt+'" width="'+w+'" height="'+h+'">';
	pop_offset (pop, x, y );
	
}

function PopImg77(id, src, alt, w , h ,  x , y, is_pop){
	//alert(document.getElementById(id+'_img').parentNode)
	pop = document.getElementById(id);
	pop.className='open';
	document.getElementById(id+'_img').innerHTML = '<img src="'+src+'" alt="'+alt+'" width="'+w+'" height="'+h+'">';
	document.getElementById(id+'_txt').innerHTML = alt;
	if(is_pop == 1 ) pop_offset (pop, x, y );
	
}
function showPop777(id, path ,item_id, x, y) {
////////////////////

	xmlhttp.open('POST', path , false);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	sendString  = "close=" + id + "&id=" + item_id  ;	
	sendString += "&ses=" + getCookie('PHPSESSID') ;
		
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}
	
	pop = document.getElementById(id);
	pop.className='open';
	pop.innerHTML = xmlResponse;
	pop_offset (pop, x, y );
	
////////////////////
		
}
