function add_more_option()
{
	var id=document.forms['form'].display_count.value;
	
	if(id<=14)
	{
		if(document.getElementById('image'+id).style.display=="" || document.getElementById('image'+id).style.display=="none")
		document.getElementById('image'+id).style.display="block";
		document.forms['form'].display_count.value = (1*id)+1;
	}
	else
	{
	alert("SORRY!! You can not add a opnion with more than 15 options Now");
	}

}

function delete_more_option()
{
	var id=(document.forms['form'].display_count.value)*1-1;
	
	obj=document.forms['form'].elements["option[]"];
	if(id>0)
	{
		idd=id-1;
		document.getElementById('image'+id).style.display="none";
		document.forms['form'].display_count.value = id;
	}
	else
	{
	alert("SORRY!! You can not add a opnion with less than 1 options");
	}

}
function delete_more_option2()
{
	var myTextField = document.getElementById('display_count');
	myTextField.value = 1;
}

function expand(id){
	if(document.getElementById(id).style.display=='none'){
		document.getElementById(id).style.display='block';
		document.getElementById('img'+id).innerHTML='<img src="images/minus.gif">';
	}
	else {
		document.getElementById(id).style.display='none';
		document.getElementById('img'+id).innerHTML='<img src="images/plus.gif">';
	}
}
function expand2(id){
	if(document.getElementById(id).style.display=='none'){
		document.getElementById(id).style.display='';
		document.getElementById('img'+id).innerHTML='<img src="images/minus.gif">';
	}
	else {
		document.getElementById(id).style.display='none';
		document.getElementById('img'+id).innerHTML='<img src="images/plus.gif">';
	}
}



function popitup(url,name,width,height) {
	newwindow=window.open(url,name,'height='+height+',width='+width+',scrollbars=yes,resizable=yes');
	if (window.focus) {newwindow.focus()}
	return false;
}

var marked_row = new Array;
function markAllSelectedRows(container_id) {
    var rows = document.getElementById(container_id).getElementsByTagName('tr');
    var unique_id;
    var checkbox;
    for ( var i = 0; i < rows.length; i++ ) {

        checkbox = rows[i].getElementsByTagName( 'input' )[0];
		
        if ( checkbox && checkbox.type == 'checkbox' ) {
            unique_id = checkbox.name + checkbox.value;
            if ( checkbox.disabled == false ) {
                checkbox.checked = true;
                if ( typeof(marked_row[unique_id]) == 'undefined' || !marked_row[unique_id] ) {
                    rows[i].className += ' selected_bg';
                    marked_row[unique_id] = true;
                }
            }
        }
    }
    return true;
}


function unMarkSelectedRows( container_id ) {
    var rows = document.getElementById(container_id).getElementsByTagName('tr');
    var unique_id;
    var checkbox;

    for ( var i = 0; i < rows.length; i++ ) {

        checkbox = rows[i].getElementsByTagName( 'input' )[0];

        if ( checkbox && checkbox.type == 'checkbox' ) {
            unique_id = checkbox.name + checkbox.value;
            checkbox.checked = false;
            rows[i].className = rows[i].className.replace(' selected_bg', '');
            marked_row[unique_id] = false;
        }
    }

    return true;
}



