/*@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();
}

function getScrollXY() {
	
	var scrOfX = 0, scrOfY = 0;
	
	if( typeof( window.pageYOffset ) == 'number' ) {
		
		//Netscape compliant
		scrOfY = window.pageYOffset;
		scrOfX = window.pageXOffset;
	} 
	else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		
		//DOM compliant
		scrOfY = document.body.scrollTop;
		scrOfX = document.body.scrollLeft;
	} 
	else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		
		//IE6 standards compliant mode
		scrOfY = document.documentElement.scrollTop;
		scrOfX = document.documentElement.scrollLeft;
	}
	
	return [ scrOfX, scrOfY ];	
}

function DoCheckout(number){
		
	xmlhttp.open('POST', "update_additional.php", false);	
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	
	var dom_1 = document.getElementById("domain_1").value;
	var dom_2 = document.getElementById("domain_2").value;
	
	var domen = dom_1 + "." + dom_2;	
	
		if( document.getElementById("opt_1").selected == true ){
			
			domen = domen + " (1 month)";
		}
		
		if( document.getElementById("opt_3").selected == true ){
			
			domen = domen + " (3 months)";
		}
		
		if( document.getElementById("opt_6").selected == true ){
			
			domen = domen + " (6 months)";
		}
		
		if( document.getElementById("opt_11").selected == true ){
			
			domen = domen + " (11 months)";
		}		
	
	sendString = "number=" + number + "&domen=" + domen;	
	
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
		
		document.getElementById("NA_AMOUNT").value = document.getElementById("billing_cycle").value;
		document.getElementById("EDP_AMOUNT").value = document.getElementById("billing_cycle").value;
		document.getElementById("order_form").submit();
	}		
}


function UpdatePic(pic_id, img_r){
	
	xmlhttp.open('POST', "update_picture.php", false);
	
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	
	sendString = "Id=" + pic_id + "&img_r=" + img_r;	
	
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}	
	
	document.getElementById("popup_pic").innerHTML = xmlResponse;	
}

function OpenDescription(id, lang){
	
	xmlhttp.open('POST', "show_description.php", false);
	
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	
	sendString = "id=" + id + "&lang=" + lang;	
	
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}	
	
	WinXY = getScrollXY();		
	
	document.getElementById("desc_div").innerHTML = xmlResponse;
	
	document.getElementById("desc_div").style.top = 500 + WinXY[1] + "px";
	
	document.getElementById("desc_div").style.display = "block";
		
}


function AddAddonDates(Id){	
	
	xmlhttp.open('POST', "addon_in_shop.php", false);
	
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	
	var address = document.getElementById('addon_address').value;
	var phone = document.getElementById('addon_phone').value;
	var postal_code = document.getElementById('addon_postal_code').value;
	
	sendString = "id=" + Id + "&address=" + address + "&phone=" + phone + "&postal_code=" + postal_code;		
	
	//alert(sendString);
	
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}	
}

function ShowSightes(id, lang){
	
	xmlhttp.open('POST', "show_sightes.php", false);
	
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	
	sendString = "Id=" + id + "&lang=" + lang;	
	
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}	
	
	WinXY = getScrollXY();
	
	document.getElementById("sightes_div").innerHTML = xmlResponse;	
	document.getElementById("sightes_div").style.top = 150 + WinXY[1];
	document.getElementById("sightes_div").style.visibility = 'visible';	
}

function ShowGallaryPics(id, lang){
	
	xmlhttp.open('POST', "show_gallary_pics.php", false);
	
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	
	sendString = "Id=" + id + "&lang=" + lang;	
	
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}	
	
	document.getElementById("gallary_div").innerHTML = xmlResponse;	
	document.getElementById("gallary_div").style.visibility = 'visible';	
}