/**
 * CIS JavaScript functions
 * @package CIS
 * @subpackage inc
 * @author Stefan Lingler <sl@pixelwings.com>
 */

function showProfiles(fot) {
	var form=document.forms.searchform;
	form['fot[0]'].value=fot;
	form.submit();
}

function printPage(url) {
	var popup=window.open(url,'POPUP','scrollbars=yes,menubar=no,depend=yes,width=500,height=600,resizable=yes');
	popup.focus();
	popup.onload=function() {
		popup.print();
	}
}

function setAllSectors() {
	document.forms.searchform.all_sectors.value=document.forms.searchform.all_sectors.value!=0?0:1;
	fs_search('searchform');
}



/*
* Select IRC Funtions START
*/
function eoi_getContacts(mode) {
	window.mode=mode;
	
	var element=document.forms.eoi[mode];
	var xml_req=window.xml_req;
  if (xml_req && xml_req.readyState < 4) xml_req.abort();
  if (window.XMLHttpRequest && !xml_req) xml_req=new XMLHttpRequest();
  else if (window.ActiveXObject) xml_req=new ActiveXObject("Microsoft.XMLHTTP");
	
	window.xml_req=xml_req;
	xml_req.onreadystatechange=eoi_setHTML;
  xml_req.open('POST',window.location.pathname+'?mode=eoi_'+mode);
  xml_req.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
  xml_req.send(mode+'='+element.value);
	
}

function eoi_setHTML() {
	switch(window.mode) {
		case 'irc_country':
			var id='eoi_city';
			document.getElementById('eoi_company').style.display='none';
		break;
		case 'irc_city':
			var id='eoi_company';
		break;
	}
	var xml_req=window.xml_req;
	if (xml_req.readyState==4) {
		var result=document.getElementById(id);
		
		if (xml_req.responseText) {
  		result.style.display='block';
  		result.innerHTML=xml_req.responseText;
		}
		else result.style.display='none';
	}
}
/*
* Select IRC Funtions STOP
*/


/*
* IFrame Height Control START
*/
function getCIS_Height() {
		var _src=document.getElementById('CIS_BODY');
		var fs_result=document.getElementById('fs_result');
    if (_src!=null) {
    	var src_h=_src.offsetHeight+100;
		if (fs_result!=undefined) {
			if (!isNaN(fs_result.offsetHeight)) src_h+=(350-fs_result.offsetHeight);
			else src_h+=350;
		}
		return src_h;
  	}
	return 0;
}

function setCIS_Sender(k) {
  if (window.parent.frames.length>0) {
    onload=function() {
      var h,r,t,d;
      h=getCIS_Height();
      t='';
      t+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="0" height="0" id="CIS_SENDER" align="middle">';
      t+='<param name="allowScriptAccess" value="sameDomain" />';
      t+='<param name="movie" value="/CIS_SENDER.swf?CIS_FRAME_HEIGHT='+h+(k?'&CIS_IFRAME='+k:'')+'" />';
      t+='<param name="quality" value="high" />';
      t+='<param name="bgcolor" value="#FFFFFF" />';
      t+='<embed src="/CIS_SENDER.swf?CIS_FRAME_HEIGHT='+h+(k?'&CIS_IFRAME='+k:'')+'" quality="high" bgcolor="#FFFFFF" width="0" height="0" name="CIS_SENDER" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
      t+='<\/object>';
      d=document.getElementById('sender');
      d.innerHTML=t;
    }
  }
}
/*
* IFrame Height Control STOP
*/