/**
 * added 02.11.2009 by MBL
 * to be able register click on application links in JobsDetail.html  
 *
 */  	

	function ApClCnGetXmlHttpObject() {
		var xmlHttp = null;
		
		try {			  
		  xmlHttp = new XMLHttpRequest();
		}
		catch (e) {
		  // IE
		  try {
		    xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		  }
		  catch (e) {
		    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		  }
		}	
		return xmlHttp;
	}


  function applyClickCounter(url, kid, vid, rid, pid, linkType)
  {
		var xmlHttp = null;				
		xmlHttp = ApClCnGetXmlHttpObject();		
				
		if(xmlHttp != null) {								
			url = 'http://'+url+'/_php_global/apply_click_counter.php?kid='+kid+'&vid='+vid+'&referer_id='+rid+'&portal_id='+pid+'&link_type='+linkType;			
			url = url+'&rnd='+Math.random();						
			//alert(url);			
									
			xmlHttp.onreadystatechange = function() {																									
				if (xmlHttp.readyState == 4) { 
					//alert(xmlHttp.responseText);																
				}
			}						
			//xmlHttp.open('GET', url, true); // async			
			xmlHttp.open('GET', url, false); // sync
			xmlHttp.send(null);
		}
		else {
			//alert('AJAX ERROR');
		}  
  }
  
