// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..
// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..
// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..
// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..
// these are our constants
var req, image, warning, imagepath;
// shorthand for document.getElementById
function d(o)
{
    return document.getElementById(o);
}
// our function to load the image
function loadimage(_imagepath,_imageLoc,_warningLoc)
{
    // hide the image object
    image = d(_imageLoc);
    image.style.display = "none";
    // set our imagepath constant
    imagepath = _imagepath;
    // display a loading message
    warning = d(_warningLoc);
    warning.innerHTML = "<img src='images/loading.gif' border=0>";
    // our XMLHttpRequest to grab the image
    req = getreq();
    req.onreadystatechange = imagexists(imagepath,image,warning);
    req.open("get", imagepath, true);
    req.send(null);     
}
function imagexists(imagepath,image,warning)
{
    // if the XMLHttpRequest is finished loading
    if(req.readyState == 4)
    {
        // and the file actually exists
        if(req.status == 200)
        {
            // say it exists and show the image
            warning.innerHTML = "Image exists";
            image.style.display = "block";
            image.src = imagepath;
        }
        else
        {
            // say it doesn't exist and hide the image
            warning.innerHTML = "Image does not exist";
            image.style.display = "none";
        }
    }
}
function getreq()
{
    if(window.XMLHttpRequest)
        return new XMLHttpRequest();
    else if(window.ActiveXObject)
        return new ActiveXObject("Microsoft.XMLHTTP");
}
// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..
// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..
// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..
// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..// BU AJAX IMAGE LOAD..

function frmLogin(){
	if ((document.fLogin.user.value.length>1) && (document.fLogin.pass.value.length>1))
		document.fLogin.submit();
}

function checkWholeForm(theForm) {
    var why = "";
    //why += checkEmail(theForm.email.value);
    //why += checkPhone(theForm.phone.value);
    //why += checkPassword(theForm.password.value);
    //why += checkUsername(theForm.contentheader.value);
    //why += isEmpty(theForm.notempty.value);
    //why += isDifferent(theForm.different.value);
    //for (i=0, n=theForm.radios.length; i<n; i++) {
    //    if (theForm.radios[i].checked) {
    //        var checkvalue = theForm.radios[i].value;
    //        break;
    //    } 
    //}
    //why += checkRadio(checkvalue);
    why += checkDropdown(theForm.setpoint.selectedIndex);
    if (why != "") {
       alert(why);
       return false;
    }
return true;
}

function checkYorm(theForm) {
    var why = "";
    why += checkYorum(theForm.metin.value);
    //why += checkPhone(theForm.phone.value);
    //why += checkPassword(theForm.password.value);
    //why += checkUsername(theForm.contentheader.value);
    //why += isEmpty(theForm.notempty.value);
    //why += isDifferent(theForm.different.value);
    //for (i=0, n=theForm.radios.length; i<n; i++) {
    //    if (theForm.radios[i].checked) {
    //        var checkvalue = theForm.radios[i].value;
    //        break;
    //    } 
    //}
    //why += checkRadio(checkvalue);
    //why += checkDropdown(theForm.setpoint.selectedIndex);
    if (why != "") {
       alert(why);
       return false;
    }
return true;
}

function checkYorum (strng) {
 var error = "";
 if (strng == "") {
    error = "Yorum yazmadınız.\n";
 }
return error;
}

function checkDropdown(choice) {
    var error = "";
    if (choice == 0) {
       error = "Puan vermediniz. \n";
    }    
return error;
} 

function clearText(thefield) { 
if (thefield.defaultValue == thefield.value) thefield.value = "" 
else if (thefield.value == "") thefield.value = thefield.defaultValue 
}

function hider(id) { 
	
	if (document.getElementById) { // DOM3 = IE5, NS6
			document.getElementById(id).style.display = 'none';				
	} else { 
		if (document.layers) {	
				document.id.display = 'none';
		} else {
				document.all.id.style.display = 'none';
		}
	}
}
function shower(id) { 
	
	if (document.getElementById) { // DOM3 = IE5, NS6
			document.getElementById(id).style.display = 'block';				
	} else { 
		if (document.layers) {	
				document.id.display = 'block';
		} else {
				document.all.id.style.display = 'block';
		}
	}
}