function alertSize(axis,offset) {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth-offset;
    myHeight = window.innerHeight-offset;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth-offset;
    myHeight = document.documentElement.clientHeight-offset;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth-offset;
    myHeight = document.body.clientHeight-offset;
  }
  if (axis=='x') return ( Math.floor(Math.random()*myWidth));
  if (axis=='y') return ( Math.floor(Math.random()*myHeight));
}



var ix_domain = 'http://test.ix-studio.com.ua/cardeal/'; //set domain   
var ix_loading_img = ix_domain + 'images/loading.gif';//set image path   
var ix_loading_msg = '';//set loading message   
var xmlhttp_obj = false;
//create the XMLHttpRequest
function ix_xmlhttp()
	{   
	if (window.XMLHttpRequest)
		{ // if Mozilla, Safari etc   
		xmlhttp_obj = new XMLHttpRequest();   
		}
	else if (window.ActiveXObject)
		{ // if IE   
		try
			{   
			xmlhttp_obj = new ActiveXObject("Msxml2.XMLHTTP");   
			}
		catch (e)
			{   
			try
				{   
				xmlhttp_obj = new ActiveXObject("Microsoft.XMLHTTP");   
				}
			catch (e)
				{   
				}   
			}   
		}
	else
		{   
		xmlhttp_obj = false;   
		}   
	return xmlhttp_obj;   
	} 

//get content via GET   
function ix_getcontent(url, containerid, resplace)
	{   
 	 var resplace = (resplace == null) ? false : resplace;
  	var xmlhttp_obj = ix_xmlhttp();   
//	alert(containerid);
	if (resplace)
	document.getElementById(containerid).innerHTML= '<img align="middle" height="20spx" src="' + ix_loading_img + '" />&nbsp;' + ix_loading_msg; 
	else
	document.getElementById(containerid).innerHTML+= '<img align="middle" height="20spx" src="' + ix_loading_img + '" />&nbsp;' + ix_loading_msg; 
	xmlhttp_obj.onreadystatechange = function()
		{   
		ix_loadpage(xmlhttp_obj, containerid);   
		}   
	xmlhttp_obj.open('GET', noCache(url), true);   
	xmlhttp_obj.send(null);   
	}        

function ix_loadpage(xmlhttp_obj, containerid)
	{   
	if ( xmlhttp_obj.readyState == 4 && xmlhttp_obj.status == 200 )
		{  
		document.getElementById(containerid).innerHTML = xmlhttp_obj.responseText;   
		}   
	} 
	
function noCache(uri)
	{
	return uri.concat(/\?/.test(uri)?"&":"?","noCache=",(new Date).getTime(),".",Math.random()*1234567)
	};	
	

