	var getipport;
	(function() {
			ChangeDropdowns = function(value) {
					//var new_height = ('0');
					//document.getElementById('ghostpage').height = new_height;
					if(value == "emty") {
                            var new_height = ('0');
							var new_src = ('');
							document.getElementById('ghostpage').height = new_height;
							document.getElementById('ghostpage').src = new_src;
                    }
					if(value == "cod2") {
                            var new_height = ('650');
							var new_src = ('http://www.cheapgamehosting.com/ajaxfiles/cod2.php');
							document.getElementById('ghostpage').height = new_height;
							document.getElementById('ghostpage').src = new_src;
                    }
					if(value == "cod4") {
                            var new_height = ('650');
							var new_src = ('http://www.cheapgamehosting.com/ajaxfiles/cod4.php');
							document.getElementById('ghostpage').height = new_height;
							document.getElementById('ghostpage').src = new_src;
                    }
                    if(value == "css") {
                            var new_height = ('580');
							var new_src = ('http://www.cheapgamehosting.com/ajaxfiles/css.php');
							document.getElementById('ghostpage').height = new_height;
							document.getElementById('ghostpage').src = new_src;
                    }
            }
			
            getipport = function() {
                var xmlhttp = false;
                if (window.XMLHttpRequest) {
                    // code for IE7+, Firefox, Chrome, Opera, Safari
                    xmlhttp = new XMLHttpRequest();
                } else {
                    // code for IE6, IE5
                    xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
                }
                if(!xmlhttp) return;
                xmlhttp.onreadystatechange = function() {
                    if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
                        //document.getElementById('txtHint').innerHTML = xmlhttp.responseText;
							if (document.forms['form'].elements['hostname'].value === '') {
							alert( "Please enter a hostname." );
							document.getElementById("form").hostname.focus()
							return false ;
							}
							if (document.forms['form'].elements['rcon'].value === '') {
							alert( "Please enter a rcon password." );
							document.getElementById("form").rcon.focus()
							return false ;
							}
							if (xmlhttp.responseText == "full") {
								document.getElementById('txtHint').innerHTML = "All servers are currently in use try again later";
							}
							else {
								var ipport = xmlhttp.responseText.split(":",2);
                                document.getElementById('form').action = "http://"+ ipport[0] + "/exec2.php";
								document.forms['form'].elements['port'].value = ipport[1];
								document.forms['form'].elements['ip'].value = ipport[0];
								document.getElementById('form').submit()
						}
                    }
                }
                xmlhttp.open('GET', 'querie.php');
                xmlhttp.send();
            }
    })();
