/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@end @*/

if (!xmlhttp && typeof(XMLHttpRequest) != 'undefined') {
	
  var xmlhttp = new XMLHttpRequest();
}

/******* GLOBALS [BEGIN] *******/
var is_opera = /opera\/9/i.test(navigator.userAgent);
var is_gecko = /gecko/i.test(navigator.userAgent);
var is_ie    = /MSIE/.test(navigator.userAgent);
/******* GLOBALS [END] *******/

function setCookie ( name, value, exp_y, exp_m, exp_d, path, domain, secure )
{
  var cookie_string = name + "=" + escape ( value );

  if ( exp_y )
  {
    var expires = new Date ( exp_y, exp_m, exp_d );
    cookie_string += "; expires=" + expires.toGMTString();
  }

  if ( path )
        cookie_string += "; path=" + escape ( path );

  if ( domain )
        cookie_string += "; domain=" + escape ( domain );
  
  if ( secure )
        cookie_string += "; secure";
  
  document.cookie = cookie_string;
}

function deleteCookie ( cookie_name )
{
  var cookie_date = new Date ( );  // current date & time
  cookie_date.setTime ( cookie_date.getTime() - 1 );
  document.cookie = cookie_name += "=; expires=" + cookie_date.toGMTString();
}
////////////////////////////////

var Try = new Object();
Try.these = function() {
	var returnValue;
	for (var i = 0; i < arguments.length; i++) {
		var lambda = arguments[i];
		try {
			returnValue = lambda();
			break;
		} catch (e) {}
	}
	return returnValue;
}


function post2(core, form, what, lang){
	
	xmlhttp.open('POST', core , false);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	sendString = "ajax=" + what +"&year="+document.getElementById('year').value+"&month="+document.getElementById('month').value+"&lang="+lang;
	xmlhttp.send(sendString);
	//alert(sendString); return false;
	if ( xmlhttp.readyState == 4 ){	
		// alert(xmlhttp.responseText); return false;
		if(xmlhttp.responseText=='1'){
		form.submit();	
		}else{		
		document.getElementById('mess').innerHTML = xmlhttp.responseText;
		document.getElementById('pop_alert').className = 'show';
		}
	}

	return false;
}

function get_more( obj, what,  id ){

    xmlhttp.open('POST', "get_more.php", false);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	sendString = "what=" + what + "&id="+ id;
	var td = document.getElementById(obj);
	td.innerHTML = '';
	var r = xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	

		td.innerHTML = xmlhttp.responseText;
		td.className = 'show';
	}
	
    return false;

}
 


function get_list(num){
	
	xmlhttp.open('POST', "get_more.php", false);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	sendString = "what=list" + what + "&id="+ num;
	var td = document.getElementById('mir_list');
	td.innerHTML = '';
	xmlhttp.send(sendString);
	//alert(sendString);
	if ( xmlhttp.readyState == 4 ){	
		
		td.innerHTML = xmlhttp.responseText;
		td.className = 'show';
	}
	
    return false;
	
	
}

function get_info(num, gid){
	
	xmlhttp.open('POST', "get_more.php", false);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	sendString = "what=info" + what + "&id="+ num+ "&gid="+gid;
	var td = document.getElementById('mir_info');
	td.innerHTML = '';
	xmlhttp.send(sendString);
	//alert(sendString);
	if ( xmlhttp.readyState == 4 ){	
		
		td.innerHTML = xmlhttp.responseText;
		td.className = 'show';
	}
	
    return false;
	
}



function get_mir( num, gid){

	get_data( 'list', num, gid);
	get_data( 'info', num, gid);
	get_data( 'gallery', num, gid);
	
	get_image( num, gid);
	/* return false;*/
}

function get_image(num, gid){
	
    var flashMovie=getFlashMovieObject('mirmenu');
	xmlhttp.open('POST', "get_mir2.php", false);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	sendString = "what=gid&id="+ num+ "&gid="+gid;
	//alert(sendString);
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
		
		bb = xmlhttp.responseText;
		//alert(bb);
		flashMovie.SetVariable('_root.num_', num );
		flashMovie.SetVariable('_root.gid_', bb );
	}
	//alert(bb);
	
	//flashMovie.SetVariable('_root.gid_', gid );

	flashMovie.flashFunction();
	
		 
}


function getFlashMovieObject(movieName)
{
  return window.document[movieName] ? window.document[movieName] : document.getElementById(movieName);
}

function get_data(what, num, gid){
	xmlhttp.open('POST', "get_mir2.php", false);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	sendString = "what=" + what + "&id="+ num+ "&gid="+gid;
	var td = document.getElementById('mir_'+what );
	td.innerHTML = '';
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
		
		td.innerHTML = xmlhttp.responseText;
		
	}

	//return false;
	
}


/*function rebuildFlash (jfont, jtext, jcolor, jtextcolor) 
{
    var flashMovie=getFlashMovieObject('rozefla');
    flashMovie.SetVariable( '_root.rfont', jfont );
    flashMovie.SetVariable( '_root.rosetext', jtext );
    flashMovie.SetVariable( '_root.rcolor', jcolor );
    flashMovie.SetVariable( '_root.rtextcolor', jtextcolor );
		flashMovie.flashFunction();
}
function getFlashMovieObject(movieName)
{
  if (window.document[movieName]) 
  {
      return window.document[movieName];
  }
 	return document.getElementById(movieName);
}

function open_div(id){
	document.getElementById(id).className='show';
}

function close_div(id){	
	document.getElementById(id).className='hide';
}

*/
