/* All rights reserved (c) 2009 iPlussoft.com */

function handleResponse(doc, obj, dv){
var data = doc.getElementById(obj);
document.getElementById(dv).innerHTML = data.innerHTML;
}

function GetResponse(url){
document.getElementById('ajax').innerHTML = '<div align="center">Loading<br/><img src="ajax-loader.gif"></div>';
document.getElementById('loader').innerHTML = '<iframe src="'+url+'" style="width: 1px; height: 1px;"></iframe>';
}

function select_all(CheckValue){
	var objCheckBoxes = document.forms[0].elements['selcontacts[]'];
	if(!objCheckBoxes)
	return;

	var countCheckBoxes = objCheckBoxes.length;
	if(!countCheckBoxes)
		objCheckBoxes.checked = CheckValue;
	else
		for(var i = 0; i < countCheckBoxes; i++)
			objCheckBoxes[i].checked = CheckValue;
}

function initpos(){
/* center invite box */
var box = document.getElementById('ibox');

if (window.innerWidth || window.innerHeight){ 
docwidth = window.innerWidth; 
docheight = window.innerHeight; 
}
if (document.body.clientWidth || document.body.clientHeight){ 
docwidth = document.body.clientWidth; 
docheight = document.body.clientHeight; 
}

box.style.left = (docwidth/2)-(parseInt(box.style.width)/2);
box.style.top = docheight*0.15;

wbox.style.width = docwidth;
wbox.style.height = docheight;
}

function enable(bool){
var wbox = document.getElementById('wbox');
var ibox = document.getElementById('ibox');
if (bool) {
	wbox.style.visibility = 'visible';
	ibox.style.visibility = 'visible';
}else{
	wbox.style.visibility = 'hidden';
	ibox.style.visibility = 'hidden';
}
}

function preload(){

    if (document.images) {
	preloadimage = new Image();

	image_url = new Array();	
	image_url[0] = "ajax-loader.gif";
	image_url[1] = "ajax-loader2.gif";

	var i = 0;
	for(i=0; i<=3; i++) 
		preloadimage.src = image_url[i];
	}

}
