// JavaScript Document

// change object class
function changeStyle(obj,classpassed){
	document.getElementById(obj).className=classpassed;
}



function showHideComments(id,cn1,cn2,action,label1,label2){
    var propertyContent=document.getElementById(id);
    var html='';
    if(action == '1'){//action 1 show comments
       //propertyContent.className= cn1;
       html+="<a href=\"javascript:changeStyle('tr" + id + "','hide');showHideComments('" + id + "','" + cn1 + "','" + cn2 + "','2','" + label1 + "','" + label2 + "')\" class=\"" + cn1 + "\">" + label2 + "</a>";
       propertyContent.innerHTML=html;
    }else{ //else  hide comments
        //propertyContent.className= cn2;
        html+="<a href=\"javascript:changeStyle('tr" + id + "','show');showHideComments('" + id + "','" + cn1 + "','" + cn2 + "','1','" + label1 + "','" + label2 + "')\" class=\"" + cn2 + "\">" + label1 + "</a>";
        propertyContent.innerHTML=html;
    }
}



function showHideCommentstd(id,cn1,cn2,action,label1,label2){
    var propertyContent=document.getElementById(id);
    var html='';
    if(action == '1'){//action 1 show comments
       //propertyContent.className= cn1;
       html+="<a href=\"javascript:changeStyle('tr" + id + "','hide');showHideCommentstd('" + id + "','" + cn1 + "','" + cn2 + "','2','" + label1 + "','" + label2 + "')\" class=\"" + cn1 + "\">" + label2 + "</a>";
       propertyContent.innerHTML=html;
    }else{ //else  hide comments
        //propertyContent.className= cn2;
        html+="<a href=\"javascript:changeStyle('tr" + id + "','show-td');showHideCommentstd('" + id + "','" + cn1 + "','" + cn2 + "','1','" + label1 + "','" + label2 + "')\" class=\"" + cn2 + "\">" + label1 + "</a>";
        propertyContent.innerHTML=html;
    }
}


function showHideOptions(id){
    var options = document.getElementById(id);
    if(!options.checked){
         changeStyle(id + "1",'hide');
         changeStyle(id + "2",'hide');
    }else{
        changeStyle(id + "1",'show');
        changeStyle(id + "2",'show');
    }
}


function showHideOptions2(id,id2){
    var options = document.getElementById(id);
    if(!options.checked){
         changeStyle(id2,'hide');
         
    }else{
        changeStyle(id2,'show');
        
    }
}




function submitform(id){
    var formid = document.getElementById(id);
    
    formid.submit();
}

    var myPopup;
    function openpopups(pag){
        myPopup = window.open(pag,"mywin","resizable=yes,width=780,height=400,scrollbars=yes,left=100,top=100");
        myPopup.focus();
    }
    
function verifyProperty(propertyID){
	var answer=confirm("This option will verify this property and automatically let be visible \n");
	if(answer==true){
		location.href='http://rentalo.com/web/client/myRentalo.cgi?verify=1&propertyID='+propertyID;
	}
}

function unverifyProperty(propertyID){
	var answer=confirm("This option will delete the property and the session saved for client and pasword will be changed\n");
	if(answer==true){
		location.href='http://rentalo.com/web/client/myRentalo.cgi?unverify=1&propertyID='+propertyID;
	}
}