function ConfirmDeleteRecord(url, text)
{
	if(confirm(text) == true)
	{
		window.location = url;
	}
	return;
}

function show_element(id)
{
	obj = document.getElementById(id);
	 
	if(obj)
	{
		obj.style.display = "";
	}
}

function hide_element(id)
{
	obj = document.getElementById(id);
	
	if(obj)
	{
		obj.style.display = "none";
	}
}

function change_bg(id, bgcolor)
{
	obj = document.getElementById(id);
	 
	if(obj)
	{
		obj.style.backgroundColor = bgcolor;
	}
}



function openwin(theURL, wi, he, sc)
{
	var s=",width="+wi+",height="+he+",scrollbars="+sc;
	var cwin = window.open(theURL, "winMaruniPict", "toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=1"+s, true);
	cwin.focus();
	return true;
}

var mail_upload_file;
mail_upload_file = 0;

function changeFeedbackSubject(subject_id)
{
    if(subject_id == 1)
    {
        show_element('formFeedback_tr_phone');
        // show_element('formFeedback_tr_sms');
    }
    else
    {
        hide_element('formFeedback_tr_phone');
        // hide_element('formFeedback_tr_sms');
    }
}

function display_description(e, descr_obj)
{
	pos_x = e.pageX?e.pageX:(e.clientX + document.body.scrollLeft);
	
	pos_y = e.pageY?e.pageY:(e.clientY + document.body.scrollTop);
	
	pos_x += 10;
	
	pos_y += 0;
	
	pos_y += document.body.scrollTop;
	descr_obj.style.top = pos_y + "px";		
	
	descr_obj.style.left = pos_x + "px";
	
	descr_obj.style.display = "inline";
}

function move_description(e, descr_obj)
{
	pos_x = e.pageX?e.pageX:(e.clientX + document.body.scrollLeft);
	
	pos_y = e.pageY?e.pageY:(e.clientY + document.body.scrollTop);
	

	pos_x += 10;
	
	pos_y += 0;

	descr_obj.style.top = pos_y + "px";		
	
	descr_obj.style.left = pos_x + "px";
}

function hide_description(descr_obj)
{
	descr_obj.style.display = "none";
}

/* 

    Emoticons

*/

function Emoticon(id, text)
{
    obj = document.getElementById(id);
    	 
	if(obj)
	{
	    obj.value = obj.value + text;
	    obj.focus();
	}
}

function wait(millis) 
{
    var date = new Date();
    var curDate = null;

    do { curDate = new Date(); } 
    while(curDate-date < millis);
}