// JavaScript Document

function hide(pass) { 
var divs = document.getElementsByTagName('div'); 
for(i=0;i<divs.length;i++){ 
if(divs[i].id.match(pass)){
if (document.getElementById) {
divs[i].style.visibility="hidden"; 
divs[i].style.display="none";
}
else 
if (document.layers) // Netscape 4 
document.layers[divs[i]].display = 'hidden'; 
else {
document.all.hideshow.divs[i].visibility = 'hidden';
document.all.hideshow.divs[i].display = 'none';
} 
} 
} 
} 

function show(pass) { 
var divs = document.getElementsByTagName('div'); 
for(i=0;i<divs.length;i++){ 
if(divs[i].id.match(pass)){ 
if (document.getElementById) {
divs[i].style.visibility="visible";
divs[i].style.display="block";
}
else 
if (document.layers) // Netscape 4 
document.layers[divs[i]].display = 'visible'; 
else {
document.all.hideshow.divs[i].visibility = 'visible';
document.all.hideshow.divs[i].display = 'block'; 
}
} 
} 
} 

function tofront(ele) {
document.getElementById(ele).style.zIndex = '100';
}

function toback(ele) {
document.getElementById(ele).style.zIndex = '10';
}

function setactive(ele, cls) {
document.getElementById(ele).className = cls;
}

function getactive(ele) {
return document.getElementById(ele).className;
}

function get(name) {
return document.getElementById(name).value; 
}

function get_radio(name) {
	var radio = document.getElementsByName(name);
for (var i=0; i < radio.length; i++)
   {
   if (radio[i].checked)
      {
      return radio[i].value;
      }
   }
   return null;
}

function get_seat_id() {
	if (get('seat')!='') 	return '4548466,';	else return '';
}

function get_seat_nr() {
	if (get('seat')!='') 	return get('seat')+',';	 else return '';
}

function get_seat() {
	if (get('seat')!='') 	return get('seat');	 else return '';
}

function buy_app() {
	var buy="yes";
	if (get_radio('app')!=null)	{
	if (get_radio('app')=='4548488') {
	if (get_seat()>10) {
		alert('You can choose only 10 additional clients for A20.');
		buy="no";
		}
	}
	if (get_radio('app')=='4548468') {
	if (get_seat()>25) {
		alert('You can choose only 25 additional clients for A50.');
		buy="no";
		}
	}
	if (get_radio('app')=='4548469') {
	if (get_seat()>50) {
		alert('You can choose only 50 additional clients for A100.');
		buy="no";
		}
	}
	if (get_radio('app')=='4548470') {
	if (get_seat()>125) {
		alert('You can choose only 125 additional clients for A250.');
		buy="no";
		}
	}
	if (get_radio('app')=='4548487') {
	if (get_seat()>250) {
		alert('You can choose only 250 additional clients for A500.');
		buy="no";
		}
	}
	if (get_radio('app')=='4548489') {
	if (get_seat()>500) {
		alert('You can choose only 500 additional clients for A1000.');
		buy="no";
		}
	}
	if (buy=="yes") {
	if (get_radio('app')=='4548488') window.open('https://secure.avangate.com/order/checkout.php?PRODS='+get_radio('app')+','+get_seat_id()+get('ship20')+'&QTY=1,'+get_seat_nr()+'1&CART=2', '_blank');
	else window.open('https://secure.avangate.com/order/checkout.php?PRODS='+get_radio('app')+','+get_seat_id()+get('ship')+'&QTY=1,'+get_seat_nr()+'1&CART=2', '_blank');
	}
	}
	else return null;
}

function winPop4(a,b) {
wnd1=window.open(a,b,"width=380,height=400,status=no,toolbar=no,menubar=no,resizable=no,scrollbars=no");
wnd1.focus();
} 

function winPop5(a,b) {
wnd1=window.open(a,b,"width=401,height=70,status=no,toolbar=no,menubar=no,resizable=no,scrollbars=no");
wnd1.focus();
} 

function hidemail2(name) {
document.write('<a class="link" href="javascript: winPop4(&#39;http://www.cososys.com/mini-contact.php?person=' + name + '&#39;, &#39;CoSoSys&#39;);" class="copy">');
}

function hidemail4(name) {
document.write('<a class="link" href="javascript: winPop4(&#39;http://www.cososys.com/partners_contact.php?person=' + name + '&#39;, &#39;CoSoSys&#39;);">');
}
